Postado Agosto 24, 2017 7 anos Solução @frank007 seria estranho um comando só pra você não poder atacar, em todo caso, script talkactions: local msg = "Agora seu sistema PvP está %s." function onSay(cid, words, param) local _table = { ["on"] = {"ativado", 1}, ["off"] = {"desativado", 0}, } if _table[param:lower()] then local mode = _table[param:lower()] setPlayerStorageValue(cid, 91821, mode[2]) doPlayerSendTextMessage(cid, 27, "Seu pvp foi "..msg:format(mode[1])) end return true end tag xml da talkactions: <talkaction words="!pvp" event="script" value="NomeDoArquivo.lua"/> creaturescripts: Spoiler function onCombat(cid, target) if isPlayer(target) and isPlayer(cid) then if getPlayerStorageValue(cid, 91821) <= 0 then doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o falando !pvp on.") return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "PvPCombat") setPlayerStorageValue(cid, 91821, 1) return true end tags do creaturescripts.xml: <event type="combat" name="PvPCombat" event="script" value="NomeDoArquivo.lua"/> <event type="login" name="PvPLogin" event="script" value="NomeDoArquivo.lua"/>
Postado Agosto 24, 2017 7 anos Autor @KotZletY essa parte vai tudo em um script so e nao vai nada em login? function onCombat(cid, target) if isPlayer(target) and isPlayer(cid) then if getPlayerStorageValue(cid, 91821) <= 0 then doPlayerSendCancel(cid, "Você está com o modo PvP desligado. Se quiser atacar outros jogadores, ative-o falando !pvp on.") return false end end return true end function onLogin(cid) registerCreatureEvent(cid, "PvPCombat") setPlayerStorageValue(cid, 91821, 1) return true end
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.