08.02.2014, 18:57
Save the owner of each gangzone in a variable?
You should get the idea with those examples; The player color one is a good one as long as no one has repeated colors, however with this way you could add flexibility to check more things, list zone owners, etc..
If you don't need these things then go with the colors one. Remember getplayercolor only works if setplayercolor is used before.
pawn Код:
forward OnPlayerCaptureZone(playerid, zoneid);
public OnPlayerCaptureZone(playerid, zoneid)
{
Owner[zoneid] = playerid;
return 1;
}
forward OnPlayerAttemptCaptureZone(playerid, zoneid);
public OnPlayerAttemptCaptureZone(playerid, zoneid)
{
if(Owner[zoneid] == playerid)
return 0;
}
If you don't need these things then go with the colors one. Remember getplayercolor only works if setplayercolor is used before.