Tente assim:
function onSay(cid, words, param, channel)
local w = {
item = 9971,
count = 10
}
local pid = getPlayerGUID(cid)
local id = {
["club"] = {vocation = {1}, id = 1},
["sword"]= {vocation = {2}, id = 2},
["axe"] = {vocation = {vocation = {2}, id = 3},
["distance"] = {vocation = {3}, id = 4},
["shield"] = {vocation = {1, 2, 3} id = 5}
}
if (param == '') then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Como usar: !comprar club.")
return true
end
if(id[param:lower()]) then
if(getPlayerSkill(cid, id[param:lower()]) < 350) then
if(isInArray(id[param:lower()].vocation(getPlayerVocation(cid))) then
if doPlayerRemoveItem(cid,w.item,w.count) then
doRemoveCreature(cid, true)
db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. w.count .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. id[param:lower()].id ..";")
else
doPlayerSendCancel(cid, "You do not have the required item.")
end
else
doPlayerSendCancel(cid, "Voce não pode comprar este skill.")
end
else
doPlayerSendCancel(cid, "Skill's limit reached.")
end
else
doPlayerSendCancel(cid, "Unknown skill.")
end
return true
end
flw





info
Grupo: Conde
Registrado: 16/06/08
Posts: 998
Reputação: +185
Gênero: Masculino
Alguem pode me ajudar a colocar assim:
Vocation 1 compra club e shield.
Vocation 2 compra sword, axe e shield.
Vocation 3 compra distance e shield.
No script a baixo qualquer pessoa pode comprar skills, paladin comprando sword e talzz...
rep+ pra quem ajuda
function onSay(cid, words, param, channel) local w = { item = 9971, count = 10 } local pid = getPlayerGUID(cid) local id = { ["club"] = 1, ["sword"]= 2, ["axe"] = 3, ["distance"] = 4, ["shield"] = 5 } if (param == '') then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Como usar: !comprar club.") return true end if(id[param:lower()]) then if(getPlayerSkill(cid, id[param:lower()]) < 350) then if doPlayerRemoveItem(cid,w.item,w.count) then doRemoveCreature(cid, true) db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. w.count .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. id[param:lower()] ..";") else doPlayerSendCancel(cid, "You do not have the required item.") end else doPlayerSendCancel(cid, "Skill's limit reached.") end else doPlayerSendCancel(cid, "Unknown skill.") end return true end