13.04.2009, 06:14
hey...
i was using is playerinarea for some stuff, and was finding it was being annoying - i wanted to see if someone was in an elevator, but people not in the elevator BUT below it were being counted... so i made a modification to isplayerinarea:
stock IsPlayerInBox(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y, Float:max_z, Float:min_z){
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y && Z <= max_z && Z >= min_z) return 1;
return 0;}
idk if its been done before, but meh
i was using is playerinarea for some stuff, and was finding it was being annoying - i wanted to see if someone was in an elevator, but people not in the elevator BUT below it were being counted... so i made a modification to isplayerinarea:
stock IsPlayerInBox(playerid, Float:max_x, Float:min_x, Float:max_y, Float:min_y, Float:max_z, Float:min_z){
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X <= max_x && X >= min_x && Y <= max_y && Y >= min_y && Z <= max_z && Z >= min_z) return 1;
return 0;}
idk if its been done before, but meh