13.08.2012, 12:58
Hello guys , after following a tutorial here on how to check if player is in area
i have this piece of code :
but now when i use afk command even if i am not at the area it stops it.
any help please? :/
i have this piece of code :
pawn Код:
stock IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) return 1;
return 1;
}
CMD:afk
{
if(IsPlayerInArea(playerid, 201.4599, 1858.0775, 257.3467, 1833.5784)) return SendClientMessage(playerid,COLOR_RED,"Sorry but you can not use this command here");
return1;
}
any help please? :/