[NtoLost.com] Anti-red System

Sttorm
Por Sttorm
em Actions e Talkactions

Sttorm

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/04/15Posts: 22Gênero: Masculino

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  

 

 

 

 

 

ITALOx

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/07/15Posts: 99Gênero: MasculinoChar no Tibia: [ADM] Ricky
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.

 

Servidor Dragon Ball Tibia: https://www.facebook.com/DBOevolutiononline (EM ANDAMENTO)