• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Permission to attacking player or not

cykor119

New Member
Joined
Aug 8, 2010
Messages
151
Solutions
1
Reaction score
4
I need a script that:

Player 1 has a Storage 1000
And Player 2 has Storage 2000

These two players can be attacked. But when Player 1 met a another player with the same storage (player 1 and player 3 have storage in 1000) that they can not attack yourself, unless they are in a party or a war guilds.
 
I write that script but i need more: "If they are in party or be in War Guild can attack target."

Code:
function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getCreatureStorage(cid, 6666) == 1 and getCreatureStorage(target, 6666) == 1 then
return doPlayerSendCancel(cid, 'You may not attack your team mates.') and false
elseif getCreatureStorage(cid, 3333) == 1 and getCreatureStorage(target, 3333) == 1 then
return doPlayerSendCancel(cid, 'You may not attack your team mates.') and false
end
end
return true
end
 
Last edited:
Here is a script for it.
You will not able able to attack people with same storage value (storage 6666) or party members, or guild members.
PHP:
function onCombat(cid, target)
   if isPlayer(cid) and isPlayer(target) then
     if (getCreatureStorage(cid, 6666) == getCreatureStorage(target, 6666)) or (getPartyLeader(cid) == getPartyLeader(target)) or (getPlayerGuildId(cid) == getPlayerGuildId(target)) then
       doPlayerSendCancel(cid, 'You may not attack your team mates.')
       return false
     end
   end
   return true
end
 
Back
Top