Ir para conteúdo

Posts Recomendados

Gente,quando eu uso o comando !promotion da o segunte erro:

[23/02/2011 21:13:38] Lua Script Error: [TalkAction Interface]

[23/02/2011 21:13:38] data/talkactions/scripts/promotion.lua:onSay

[23/02/2011 21:13:38] data/talkactions/scripts/promotion.lua:22: attempt to call global 'setPlayerPromotionLevel' (a nil value)

[23/02/2011 21:13:38] stack traceback:

[23/02/2011 21:13:38] [C]: in function 'setPlayerPromotionLevel'

[23/02/2011 21:13:38] data/talkactions/scripts/promotion.lua:22: in function <data/talkactions/scripts/promotion.lua:2>

Alguem me ajuda ae:

-- [( Script created by Doidin and MatheusMkalo for XTibia.com )] --

function onSay(cid, words, param, channel)

 

local config = {

[1] = {level = 20, valor = 20000},

[2] = {level = 20, valor = 20000},

[3] = {level = 20, valor = 20000},

[4] = {level = 20, valor = 20000},

vipsconfig = {onlyvips = "no", storagevip = 1020}, -- Apenas players vips "yes" ou "no" e o storage da vip.

onlypremmy = "yes" -- Apenas players premium accounts "yes" or "no".

}

 

if config.onlypremmy == "yes" and not isPremium(cid) then

return doPlayerSendTextMessage(cid, 23, "Sorry, only premium players.")

end

if config.vipsconfig.onlyvips == "yes" and getPlayerStorageValue(cid, config.vipsconfig.storagevip) - os.time() <= 0 then

return doPlayerSendTextMessage(cid, 23, "Sorry, only vips players.")

end

if config[getPlayerVocation(cid)] then

if getPlayerLevel(cid) >= config[getPlayerVocation(cid)].level then

if doPlayerRemoveMoney(cid, config[getPlayerVocation(cid)].valor) then

setPlayerPromotionLevel(cid, 1)

doPlayerSendTextMessage(cid, 22, "Congratulations, you have been successfully promoted!")

doSendMagicEffect(cid, 14)

else

doPlayerSendTextMessage(cid, 23, "You need "..config[getPlayerVocation(cid)].valor.." gold coins to promote.")

end

else

doPlayerSendTextMessage(cid, 23, "You need level "..config[getPlayerVocation(cid)].level.." to promote.")

end

else

doPlayerSendTextMessage(cid, 23, "Sorry, you already promoted.")

end

return TRUE

end

Link para o comentário
https://xtibia.com/forum/topic/152254-promotion-87/
Compartilhar em outros sites

×
×
  • Criar Novo...