function onCombat(cid, target)
if(isPlayer(cid) and isPlayer(target)) then
if(getConfigValue("noDamageToGuildMates")) then
if(getPlayerGuildId(cid) == getPlayerGuildId(target)) then
return false
end
end
if(getConfigValue("noDamageToPartyMembers")) then
if(getPlayerParty(cid) == getPlayerParty(target)) then
return true
end
end
end
return true
end
<event type="combat" name="Protection" event="script" value="protection.lua"/>
registerCreatureEvent(cid, "Protection")
function onCombat(cid, target)
if isPlayer(target) then
if not getPlayerParty(cid) or not getPlayerParty(target) then
return true
end
if getPlayerParty(cid) == getPlayerParty(target) then
return false
end
end
return true
end
function onCombat(cid, target)
if isPlayer(target) then
if not getPlayerParty(cid) or not getPlayerParty(target) then
return true
end
if getPlayerParty(cid) == getPlayerParty(target) then
return false
end
end
return true
end
registerCreatureEvent(cid, "Protection")
<event type="combat" name="Protection" event="script" value="protection.lua"/>
print("Script load test.")