ta certo ao meu ver..
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
seta a vocação do player, retorna a vocação do player + 4
ta certo ao meu ver..
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
seta a vocação do player, retorna a vocação do player + 4
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +150
Gênero: Masculino

Vou falar pra ele testar,
qualquer coisa posto aqui.
Abraços!!
info
Grupo: Conde
Registrado: 21/03/12
Posts: 651
Reputação: +89
Char no Tibia: Pussycat !

Dei Uma Editada Nele Nao Sei se vai funfar aki !! pq to sem ot no pc e muito ocupado se nao ate baixava pra testar
ate
function onSay(cid, words, param)local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(t[1])
local premiumdays = tonumber(t[2])
if (not t[1]) then
doPlayerSendCancel(cid, "You must fill with a player name.")
elseif (premiumdays < 0) then
doPlayerAddPremiumDays(player, premiumdays)
doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".")
doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.")
elseif (premiumdays >= 1 and premiumdays < 150) then
doPlayerAddPremiumDays(player, premiumdays)
getPromotedVocation(voc) ---Poem O Id da Vocation
doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".")
doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.")
elseif (premiumdays > 0) then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
end
return TRUE
end
info
Grupo: Conde
Registrado: 30/06/11
Posts: 631
Reputação: +371
Char no Tibia: Warrior of Mort

Se não funcionar dos geitos anteriormente ditos, tente assim:
function onSay(cid, words, param)
local t = string.explode(param, ",")
local player = getPlayerByNameWildcard(t[1])
local premiumdays = tonumber(t[2])
if (not t[1]) then
doPlayerSendCancel(cid, "You must fill with a player name.")
elseif (premiumdays < 0) then
doPlayerAddPremiumDays(player, premiumdays)
doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".")
doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.")
elseif (premiumdays >= 1 and premiumdays < 150) then
doPlayerAddPremiumDays(player, premiumdays)
if getPlayerPromotionLevel(cid) < 1 then
setPlayerPromotionLevel(cid, 1)
doPlayerSendTextMessage(player,25,"You are promoted.")
end
doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".")
doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.")
end
return TRUE
end
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +150
Gênero: Masculino

Alguém pode mover o Tópico?
O meu deu certo =)
info
Grupo: Marquês
Registrado: 18/05/11
Posts: 1.1k
Reputação: +150
Gênero: Masculino
E ai galera, to tentando arrumar um script aqui pra um amigo meu, ele quer que quando o player receba os dias de premium, receba também uma promotion.
Tentei isso:
function onSay(cid, words, param) local t = string.explode(param, ",") local player = getPlayerByNameWildcard(t[1]) local premiumdays = tonumber(t[2]) if (not t[1]) then doPlayerSendCancel(cid, "You must fill with a player name.") elseif (premiumdays < 0) then doPlayerAddPremiumDays(player, premiumdays) doPlayerSendTextMessage(cid,22,"You have removed " .. t[2] .. " premium days from " .. player .. ".") doPlayerSendTextMessage(player,25,"You have lost " .. t[2] .. " premium days.") elseif (premiumdays >= 1 and premiumdays < 150) then doPlayerAddPremiumDays(player, premiumdays) doPlayerSetVocation(cid, getPlayerVocation(cid)+4) doPlayerSendTextMessage(cid,22,"You have added " .. premiumdays .. " premium days from " .. getCreatureName(player) .. ".") doPlayerSendTextMessage(player,25,"You received " .. premiumdays .. " premium days.") elseif (premiumdays > 0) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) end return TRUE endTentei adicionar aquela linha:
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
Mas não sei se fiz certo.
Quem puder ajudar.
Valew!!
Editado Abril 24 por PsyMcKenzie