para que sistema de points ?
5
1.9k
06 de julho de 2011 às 15:05
07 de julho de 2011 às 15:51
Uso o do gesior msm 8.6...Nao e por storage.
info
Grupo: Infante
Registrado: 13/10/08
Posts: 1.6k
Reputação: +420
Char no Tibia: Demonbholder

12 de julho de 2011 às 23:25
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 Julho 12 por Demonbholder





info
Grupo: Campones
Registrado: 12/01/11
Posts: 28
Reputação: 0
Tipo do script: Talkactions
Protocolo (versão do Tibia): 8.6
Servidor utilizado:TFS
Nível de experiência: Medio
Adicionais/Informações: Eu queria um comando de add poins pelo god....Possivel?
REP++