20 horas atrás, Henrique Gomes disse:Eae Galera blz ? Eu queria pedir a ajuda de vocês para editar essa script para min, o erro que está dando é que os comando ta indo ao contrario, eu falo !pvp on, desativa, falo !pvp off ativa, será que alguém poderia min ajuda por favor ? desde já, obrigado.
Creaturescript:
function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, 123456) == 1 then return false end end return trueendfunction onTarget(cid,target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid,123456) == 1 then doPlayerSendCancel(cid, "Reative o PVP para atacar um jogador.") return false end end return trueendfunction onLogin(cid) registerCreatureEvent(cid, "PVPTarget") registerCreatureEvent(cid, "PVPCombat") return trueend.xml :
<event type="login" name="PVPLogin" event="script" value="script.lua"/><event type="target" name="PVPTarget" event="script" value="script.lua"/><event type="combat" name="PVPCombat" event="script" value="script.lua"/>talkactions:
function onSay(cid, words, param, channel) if param == "" then return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") end if isInArray({"on","off"}, param) then local value = param == "on" and 1 or 0 local status = param == "on" and "ativou" or "desativou" doPlayerSetStorageValue(cid, 123456, value) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você "..status.." o PVP.") else doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") end return trueendTag:
<talkaction words="!pvp" event="script" value="pvpsystem.lua"/>
não sei o motivo do erro.
testa assim : (talkactions)
function onSay(cid, words, param, channel) if param == "" then return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") end if param == 'on' then doPlayerSetStorageValue(cid, 123456, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ativou o PVP.") elseif param == 'off' then doPlayerSetStorageValue(cid, 123456, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você desativou o PVP.") else doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") endreturn trueend






info
Grupo: Visconde
Registrado: 15/03/16
Posts: 327
Reputação: +12
Gênero: Masculino
Eae Galera blz ? Eu queria pedir a ajuda de vocês para editar essa script para min, o erro que está dando é que os comando ta indo ao contrario, eu falo !pvp on, desativa, falo !pvp off ativa, será que alguém poderia min ajuda por favor ? desde já, obrigado.
Creaturescript:
function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, 123456) == 1 then return false end end return trueendfunction onTarget(cid,target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid,123456) == 1 then doPlayerSendCancel(cid, "Reative o PVP para atacar um jogador.") return false end end return trueendfunction onLogin(cid) registerCreatureEvent(cid, "PVPTarget") registerCreatureEvent(cid, "PVPCombat") return trueend.xml :
talkactions:
function onSay(cid, words, param, channel) if param == "" then return doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") end if isInArray({"on","off"}, param) then local value = param == "on" and 1 or 0 local status = param == "on" and "ativou" or "desativou" doPlayerSetStorageValue(cid, 123456, value) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você "..status.." o PVP.") else doPlayerSendCancel(cid, "Escolha se quer deixar o PVP on ou off.") end return trueendTag:
<talkaction words="!pvp" event="script" value="pvpsystem.lua"/>
Editado Janeiro 4 por Henrique Gomes