Ir para conteúdo
  • 0

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0

function onSay(cid, words, param)

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

if type(par) == "table" and #par == 2 and isPlayer(getCreatureByName(par[1])) and tonumber(par[2]) then
doPlayerSendTextMessage(getCreatureByName(par[1]), 27, "You will be kicked in 5 seconds to get more points.")
addEvent(addPoints, 5000, getCreatureByName(par[1]), tonumber(par[2]))
else
doPlayerSendCancel(cid, "Wrong param.")
end

return TRUE
end

function getPoints(cid)
return tonumber(db.getResult("SELECT `premium_points` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. ";"):getDataString("premium_points"))
end

function addPoints(cid, points)

local acc = getPlayerAccountId(cid)
local pp = getPoints(cid)

if isCreature(cid) then
doRemoveCreature(cid)
end

db.executeQuery("UPDATE `accounts` SET `premium_points` = ".. pp + points .." WHERE `id` = " .. acc .. ";")
end

 

Não testei.

 

Usa assim: !nomeDaTalk Demonbholder, 3000

Editado por Demonbholder
Link para o comentário
https://xtibia.com/forum/topic/160687-comando-addpoints/#findComment-1063983
Compartilhar em outros sites

×
×
  • Criar Novo...