20.07.2010, 13:32
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!
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.
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.}