Postado Outubro 16, 2015 9 anos Como faço pra quando player premium falar !buypromotion ele comprar, e se não for premium aparecer você precisa de premium accounttfs 0.3.0
Postado Outubro 16, 2015 9 anos function onSay(cid, words, param) local newvoc = getPromotedVocation(getPlayerVocation(cid)) local price = 20000 if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= price then doPlayerSetVocation(cid,newvoc) doPlayerRemoveMoney(cid, price) doPlayerSendCancel(cid, "Parabens voce foi promovido.") else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end <talkaction words="!buypromotion" event="script" value="seuarquivo.lua"/> Tenta isso. Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Outubro 17, 2015 9 anos Autor function onSay(cid, words, param) local newvoc = getPromotedVocation(getPlayerVocation(cid)) local price = 20000 if getPlayerPremiumDays(cid) > 0 then if getPlayerMoney(cid) >= price then doPlayerSetVocation(cid,newvoc) doPlayerRemoveMoney(cid, price) doPlayerSendCancel(cid, "Parabens voce foi promovido.") else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end <talkaction words="!buypromotion" event="script" value="seuarquivo.lua"/> Tenta isso. deu esse erro: [17/10/2015 00:17:47] Lua Script Error: [TalkAction Interface] [17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:onSay[17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:14: attempt to call global 'getPlayerPromotionLevel' (a nil value)[17/10/2015 00:17:47] stack traceback:[17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:14: in function <data/talkactions/scripts/promotion.lua:8>
Postado Outubro 17, 2015 9 anos deu esse erro: [17/10/2015 00:17:47] Lua Script Error: [TalkAction Interface] [17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:onSay[17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:14: attempt to call global 'getPlayerPromotionLevel' (a nil value)[17/10/2015 00:17:47] stack traceback:[17/10/2015 00:17:47] data/talkactions/scripts/promotion.lua:14: in function <data/talkactions/scripts/promotion.lua:8> Humm, você não tem essa função, "vou arrumei". function onSay(cid, words, param) local vocs = { [1] = 5, -- master sorcerer [2] = 6, -- elder druid [3] = 7, -- royal paladin [4] = 8, -- elite knight } local newvoc = vocs[getPlayerVocation(cid)] local price = 20000 if getPlayerPremiumDays(cid) >= 0 then if getPlayerMoney(cid) >= price then if vocs[getPlayerVocation(cid)] then doPlayerSetVocation(cid,newvoc) doPlayerRemoveMoney(cid, price) doPlayerSendCancel(cid, "Parabens voce foi promovido.") else doPlayerSendCancel(cid, "Voce nao pode ser promovido.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end Editado Outubro 17, 2015 9 anos por Caronte I'm sexy and i know it. (veja o histórico de edições) Se quiser sua dúvida tirada, mande PM com os links, e não com a dúvida (outros podem ter a mesma dúvida, e o fórum serve para ser usado). Tópicos: [FAQ] BBCODE [LIB] Constant [RME] Administrando bordas. [TALK] Broadcast Editável. [TALK] Sugest. [TALK] Checkpoint. [MOVE] Pântano pegajoso. [ACTION] Piggy Bank. (Cassino). [GLOBAL] Uptime Ad. [C0DE] Consertando 'Invalid Password' [PROGRAM] Quest Maker
Postado Outubro 18, 2015 9 anos Autor Humm, você não tem essa função, "vou arrumei". function onSay(cid, words, param) local vocs = { [1] = 5, -- master sorcerer [2] = 6, -- elder druid [3] = 7, -- royal paladin [4] = 8, -- elite knight } local newvoc = vocs[getPlayerVocation(cid)] local price = 20000 if getPlayerPremiumDays(cid) >= 0 then if getPlayerMoney(cid) >= price then if vocs[getPlayerVocation(cid)] then doPlayerSetVocation(cid,newvoc) doPlayerRemoveMoney(cid, price) doPlayerSendCancel(cid, "Parabens voce foi promovido.") else doPlayerSendCancel(cid, "Voce nao pode ser promovido.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce nao tem dinheiro suficiente.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "Voce precisa ser premium para usar esse comando.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end obrigado por arrumar, "funcionou" mas Não "funcionou"porque até freeaccounts estão conseguindo se promover.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.