Postado Dezembro 15, 2016 8 anos gente estou aqui mais uma vez para pedir ajuda de vcs com um Script, queria que o player só pode-se usar o comando !transformar tento uma certa storage. versão : 8.60 Tfs 0.4 servidor Derivado aqui vai o Script para analise: local config = { --[vocation id] = { level, nova voc, looktype, efeito} -- Goku [7] = { 700, 8, 9, 114} } function onSay(cid, words, param, channel) local voc = config[getPlayerVocation(cid)] if voc then if getPlayerLevel(cid) >= voc[1] then doPlayerSetVocation(cid, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!") doCreatureSay(cid, "Transformar", 19) local outfit = {lookType = voc[3]} doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getCreaturePosition(cid), voc[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.") end else doPlayerSendCancel(cid, "Nao é possível se transformar.") end return true end quem poder ajudar agradeço mt, REP+ Editado Dezembro 16, 2016 8 anos por dissolima problema resolvido (veja o histórico de edições)
Postado Dezembro 15, 2016 8 anos local config = { --[vocation id] = { level, nova voc, looktype, efeito, storage} -- Goku [7] = { 700, 8, 9, 114, 43902} } function onSay(cid, words, param, channel) local voc = config[getPlayerVocation(cid)] if (getCreatureStorage(uid, key) >= 1) then if voc then if getPlayerLevel(cid) >= voc[1] then doPlayerSetVocation(cid, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!") doCreatureSay(cid, "Transformar", 19) local outfit = {lookType = voc[3]} doCreatureChangeOutfit(cid, outfit) doSendMagicEffect(getCreaturePosition(cid), voc[4]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.") end else doPlayerSendCancel(cid, "Nao é possível se transformar.") end else doPlayerSendCancel(cid, "Nao é possível se transformar.") end return true end Para poder usar a transformação tu tem que usar o método "doSetStorage(storage, valor)", com o argumento valor maior igual à um. Editado Dezembro 15, 2016 8 anos por otteN (veja o histórico de edições) Nem todo loop infinito é ruim ;P User *eu = new User("otteN"); RepSystem<User> *myRep = new RepSystem<User>("jóinha"); myRep->setAlvo(eu); /* só por ser criado já sou o melhor membro */ while(eu->isMelhorMembro()){ myRep->reputar(); }
Postado Dezembro 15, 2016 8 anos Autor mt Obrigado, não testei ainda mai pelo que ví. está tudo OK :D REP+ aew pela ajuda
Postado Dezembro 15, 2016 8 anos Solução local config = { --[vocation id] = { level, nova voc, looktype, efeito} [7] = {700, 8, 9, 114, 43902} } local storage = 123 function onSay(cid, words, param, channel) local voc = config[getPlayerVocation(cid)] if not voc then doPlayerSendCancel(cid, "Nao é possível se transformar.") return true end if getPlayerStorageValue(cid, storage) ~= 1 then doPlayerSendCancel(cid, "Nao é possível se transformar.") return true end if getPlayerLevel(cid) < voc[1] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.") return true end doPlayerSetVocation(cid, voc[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!") doCreatureSay(cid, "Transformar", 19) doCreatureChangeOutfit(cid, {lookType = voc[3]}) doSendMagicEffect(getCreaturePosition(cid), voc[4]) return true end Discord: vankk #7765 Precisando de ajuda? Entre em contato comigo via Discord. Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.
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.