08.06.2011, 19:40
Hello,
So this is nothing like IsPlayerInRangeOfPoint, well it is, but this function is looking X and Y Coordinates. There is nothing like Float:range. Here is the code.
So this is nothing like IsPlayerInRangeOfPoint, well it is, but this function is looking X and Y Coordinates. There is nothing like Float:range. Here is the code.
pawn Код:
stock IsPlayerInRange(Float:Start_X, Float:Start_Y, Float:End_X, Float:End_Y, playerid){
new Float:Current_X, Float:Current_Y, Float:Current_Z;
GetPlayerPos(playerid, Current_X, Current_Y, Current_Z);
if(Start_X >= Current_X && End_X <= Current_X && Start_Y <= Current_Y && End_Y >= Current_Y){
return 1;
}else{
return 0;
}
}
Start_X must always be higher value than End_X, and Start_Y smaller than End_Y...