Ir para conteúdo

Featured Replies

Postado

e se você quiser adicionar points para todos os player do ot que estejam online/offline você usa:

local count = 5

db.executeQuery("UPDATE players SET points = "..getPoints(cid).."+"..count)

nesse caso vai adicionar 5 points para todos os jogadores do server.

quero só pra um.

aquilo era só um exemplo cara, vc pode usar o comando lá em cima /addpoints nome,points

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • Respostas 24
  • Visualizações 2.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • em lib/functions vc adiciona: function getPoints(cid) local check = db.getResult("SELECT `points` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. " LIMIT 1") return check:getDataInt

  • axei esse script do VODKART ai tentei editar pra BÁU local coin = 8301 local lever = { [6001] = {15,9080}, [6002] = {25,8866}, [6003] = {15,7730}, [6004] = {25,8983} } function onUse

  • 1° Abra o programa Sqlite 2° na parte superior do programa tem a aba "Tools",clica nela e seleciona "Open SQL query editor" ou (ALT + E) se preferir 3° Vai abrir uma janela branca,nela você coloca

Postado
  • Autor

não man eu sei que o /addpoints Rollback,30 funciona só que ele não funciona pra player offline se tiver como eu agradeço se n tiver tbm valeu =]

tk-melhor.pngpolitico_mensalao.gif

5wwbk5.gif

Postado

function onSay(cid, words, param)

if(words == "!points") then

return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem "..getPoints(cid).." Points.")

elseif(words == "!rankpoints") then

local max_players,str = 20,""

str = "--[ RANK POINTS ]--\n\n"

query = db.getResult("SELECT `name`, `points` FROM `players` WHERE `points` > -1 AND `id` > 6 AND `group_id` < 2 ORDER BY `points` DESC, `name` ASC;")

if (query:getID() ~= -1) then k = 1 while true do

str = str .. "\n " .. k .. ". " .. query:getDataString("name") .. " - [" .. query:getDataInt("points") .. "]"

k = k + 1

if not(query:next()) or k > max_players then break end end query:free()end

if str ~= "" then doShowTextDialog(cid,6500, str) end

elseif(words == "/addpoints") then

if getPlayerAccess(cid) == 5 then

local t = string.explode(param, ",")

if not t[1] or not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end

local player,points = getPlayerByName(t[1]),t[2]

local pid = getPlayerByNameWildcard(t[1])

if not pid then

local guid  = getPlayerGUIDByName(t[1])

if guid == nil then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player doesn't exists.") return true

end

db.executeQuery("UPDATE `players` SET `points` = `points` + " .. t[2] .. " WHERE `id` = "..guid) 

else

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram adicionados "..points.." Points no seu character.")

addPoints(player,points)

end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você adicionou "..points.." Points do jogador "..t[1])

end

elseif(words == "/delpoints") then

if getPlayerAccess(cid) == 5 then

local t = string.explode(param, ",")

if not t[1] or not t[2] then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end

local player = getPlayerByName(t[1])

local points = t[2]

local pid = getPlayerByNameWildcard(t[1])

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then

return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "você removeu "..points.." Points do jogador "..t[1])

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Foram removidos "..points.." Points do seu character.")

removePoints(player,points)

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Você agora tem "..getPoints(player).." Points.")

end

elseif(words == "/setpoints") then

if getPlayerAccess(cid) == 5 then

local t = string.explode(param, ",")

if not t[1] or not t[2] then return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") end

local player = getPlayerByName(t[1])

local points = t[2]

local pid = getPlayerByNameWildcard(t[1])

if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then

return TRUE,doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Agora o jogador "..t[1].." tem "..points.." Points no seu character.")

doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "agora você tem "..points.." Points do seu character.")

setPoints(player,points)

end

end

return true

end

MAIS ALGUMA COISA SENHOR?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo