Gang zone prevent to capture again
#2

Save the owner of each gangzone in a variable?

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;
}
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.
Reply


Messages In This Thread
Gang zone prevent to capture again - by davve95 - 08.02.2014, 18:53
Re: Gang zone prevent to capture again - by CuervO - 08.02.2014, 18:57
Re: Gang zone prevent to capture again - by ross8839 - 08.02.2014, 19:26
Re: Gang zone prevent to capture again - by davve95 - 08.02.2014, 19:45
Re: Gang zone prevent to capture again - by CuervO - 08.02.2014, 19:56
Re: Gang zone prevent to capture again - by davve95 - 09.02.2014, 13:53
Re: Gang zone prevent to capture again - by CuervO - 10.02.2014, 03:36
Re: Gang zone prevent to capture again - by davve95 - 10.02.2014, 15:37
Re: Gang zone prevent to capture again - by davve95 - 13.02.2014, 14:23
Re: Gang zone prevent to capture again - by Lordzy - 13.02.2014, 15:46

Forum Jump:


Users browsing this thread: 1 Guest(s)