Tenta essa função que acabei de fazer
usasse assim doPlayerRemoveLevelInPorcent(getPlayerGUID(cid), 25)
function doPlayerRemoveLevelInPorcent(id, porcent)
new_lvl = math.floor(getPlayerLevel(cid)*percent/100)
return db.executeQuery("UPDATE `players` SET `level` = " .. new_lvl .. " WHERE `id` = " .. id)
end








info
Grupo: Campones
Registrado: 19/09/12
Posts: 11
Reputação: 0
Char no Tibia: TrinYdade
Olá galera conheço um pouco de scripting porem presiso de ajuda neste.
Presiso que ao tomar ban o player perca 25% de seus leveis isto seria possivel ?
alguem pode fazer pra mim
abaixo esta meu script de ban
function onSay(cid, words, param, channel)
local t = param:explode(",")
local name, days = t[1], tonumber(t[2])
local player = getPlayerByName(t[1])
if name then
if days then
local acc = getAccountIdByName(name)
if acc ~= 0 then
local tempo = days * 24 * 3600
doAddAccountBanishment(acc, target, os.time() + tempo, 5, 2, 'Banido por bular regras', 0)
doRemoveCreature(player)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player não existe.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode adicionar essa
quantidade de dia(s) de dias de banimento.")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "esse player nao existe.")
end
return TRUE
end
dou RES+ pra quem puder me ajudar abraços...