Sttorm 18 Postado Maio 16, 2018 Share Postado Maio 16, 2018 Talkactions -- <talkaction words="!antired" event="script" value="antired.lua"/> function onSay(cid, words, param) local storage = 43686 if (param == '') then doSendMagicEffect(getCreaturePosition(cid), 2) return doPlayerSendTextMessage(cid, 25, "Digite !PVP ON ou OFF") end if (param == 'OFF') then doSendMagicEffect(getCreaturePosition(cid), 2) setPlayerStorageValue(cid, storage, 1) return doPlayerSendTextMessage(cid, 25, "Você desabilitou o PVP") end if (param == 'ON') then doSendMagicEffect(getCreaturePosition(cid), 2) setPlayerStorageValue(cid, storage, -1) return doPlayerSendTextMessage(cid, 25, "Você habilitou o PVP") end end CreatureScripts -- <event type="attack" name="offattack" event="script" value="killdeath.lua"/> -- <event type="statschange" name="offstats" event="script" value="killdeath.lua"/> -- registerCreatureEvent(cid, offattack) -- registerCreatureEvent(cid, offstats) local storage = 43686 function onAttack(cid, target) local pos = getCreaturePosition(cid) if isPlayer(cid) and isPlayer(target) and getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, 23, "Você não pode atacar enquanto estiver com o PvP OFF") doSendMagicEffect(pos, 2) return false end return true end function onStatsChange(cid, attacker, type, combat, value) local storage = 43686 if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) and isPlayer(attacker) then if getPlayerStorageValue(attacker, storage) == 1 then doPlayerSendTextMessage(attacker, 23, "Você não pode atacar enquanto estiver com o PvP OFF") doSendMagicEffect(getCreaturePosition(attacker), 2) return false end end return true end ITALOx reagiu a isso 1 Link para o comentário Compartilhar em outros sites More sharing options...
ITALOx 10 Postado Março 11, 2019 Share Postado Março 11, 2019 Em 16/05/2018 em 16:02, PedroHL disse: Talkactions -- <talkaction words="!antired" event="script" value="antired.lua"/> function onSay(cid, words, param) local storage = 43686 if (param == '') then doSendMagicEffect(getCreaturePosition(cid), 2) return doPlayerSendTextMessage(cid, 25, "Digite !PVP ON ou OFF") end if (param == 'OFF') then doSendMagicEffect(getCreaturePosition(cid), 2) setPlayerStorageValue(cid, storage, 1) return doPlayerSendTextMessage(cid, 25, "Você desabilitou o PVP") end if (param == 'ON') then doSendMagicEffect(getCreaturePosition(cid), 2) setPlayerStorageValue(cid, storage, -1) return doPlayerSendTextMessage(cid, 25, "Você habilitou o PVP") end end CreatureScripts -- <event type="attack" name="offattack" event="script" value="killdeath.lua"/> -- <event type="statschange" name="offstats" event="script" value="killdeath.lua"/> -- registerCreatureEvent(cid, offattack) -- registerCreatureEvent(cid, offstats) local storage = 43686 function onAttack(cid, target) local pos = getCreaturePosition(cid) if isPlayer(cid) and isPlayer(target) and getPlayerStorageValue(cid, storage) == 1 then doPlayerSendTextMessage(cid, 23, "Você não pode atacar enquanto estiver com o PvP OFF") doSendMagicEffect(pos, 2) return false end return true end function onStatsChange(cid, attacker, type, combat, value) local storage = 43686 if value >= 1 and (type == STATSCHANGE_HEALTHLOSS or (getCreatureCondition(cid, CONDITION_MANASHIELD) and type == STATSCHANGE_MANALOSS)) and isPlayer(attacker) then if getPlayerStorageValue(attacker, storage) == 1 then doPlayerSendTextMessage(attacker, 23, "Você não pode atacar enquanto estiver com o PvP OFF") doSendMagicEffect(getCreaturePosition(attacker), 2) return false end end return true end Pega para tfs 0.4? 860. Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados