Jump to content

[NtoLost.com] Anti-red System


Sttorm

Recommended Posts

IbpT13s.png

 

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  

 

Link to comment
Share on other sites

  • 9 months later...
Em 16/05/2018 em 16:02, PedroHL disse:

IbpT13s.png

 

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 to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...