[Tutorial] Admin-only zones
#10

Yes, good! And I bet, if we poke that if structure, and use up the "trash" Z coords thats sitting in the pos[2], we can convert the memory-eating Z coords into a 3D ADMINAREA!
pawn Код:
stock IsPlayerInArea(playerid, Float:min_x, Float:max_x, Float:min_y, Float:max_y, Float:min_z, Float:max_z){    
new Float:pos[3]; //Save his position this this triple-var.    
GetPlayerPos(playerid,pos[0],pos[1],pos[2]); //Save his X in pos[0], his Y in pos[1] and his Z in pos[2].
   if(min_x <= pos[0] && max_x >= pos[0] && min_y <= pos[1] && max_y >= pos[1] && min_z <= pos[2] && max_z >= pos[2] ) return 1; //Checks if the player is in the area, and if so returns 1.    
return 0; //Else it returns 0.}
I mean this. See the function's last two params! They are now asking Z values. And the last two if statement is Z too. Now you can create admin zones under a bridge without the risk of the innocent players die when stunt/rp/whatever ON the bridge. They die if they UNDER the bridge.
Reply


Messages In This Thread
Admin-only zones - by Hiddos - 13.07.2010, 10:17
Re: Admin-only zones - by MartinDaniel - 13.07.2010, 10:23
Re: Admin-only zones - by iZN - 13.07.2010, 10:28
Re: Admin-only zones - by Hiddos - 13.07.2010, 10:32
Re: Admin-only zones - by KJ1 - 13.07.2010, 15:31
Re: Admin-only zones - by Hiddos - 13.07.2010, 17:51
Re: Admin-only zones - by Aleluja - 13.07.2010, 21:27
Re: Admin-only zones - by bartje01 - 19.07.2010, 20:29
Re: Admin-only zones - by Kar - 19.07.2010, 21:31
Re: Admin-only zones - by pocok1 - 20.07.2010, 13:32
Re: Admin-only zones - by [Lsrcr]Sandra - 23.07.2010, 06:28

Forum Jump:


Users browsing this thread: 1 Guest(s)