IsPlayerInArea Help
#10

This should work:
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetTimerEx("CheckArea", 1000, true, "i", playerid);
    return 1;
}
   
forward CheckArea(playerid);
public CheckArea(playerid)
{
    if(IsPlayerInArea(playerid,2424,-1758,2640,-1620))
    {
        SendClientMessage(playerid,COLOR_GREEN,"Your on Property of GS Watch Your back");
    }
    else
    {
       SendClientMessage(playerid, COLOR_RED,"You're not on Property of GS.");
    }
    return 1;
}

stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(minx < x < maxx && miny < y < maxy) return true;
    return false;
}
NOTE: This WILL spam the player with messages once they spawn, it would be better to assign it to a command rather than a timer.
Reply


Messages In This Thread
IsPlayerInArea Help - by trapstar2020 - 15.09.2012, 05:55
Re: IsPlayerInArea Help - by CoDeZ - 15.09.2012, 06:01
Respuesta: IsPlayerInArea Help - by Marricio - 15.09.2012, 06:02
Re: IsPlayerInArea Help - by clarencecuzz - 15.09.2012, 06:20
Re: IsPlayerInArea Help - by trapstar2020 - 15.09.2012, 06:33
Re: IsPlayerInArea Help - by trapstar2020 - 15.09.2012, 06:42
Re: IsPlayerInArea Help - by JaKe Elite - 15.09.2012, 06:48
Re: IsPlayerInArea Help - by clarencecuzz - 15.09.2012, 07:11
Re: IsPlayerInArea Help - by trapstar2020 - 15.09.2012, 08:00
Re: IsPlayerInArea Help - by clarencecuzz - 15.09.2012, 08:07

Forum Jump:


Users browsing this thread: 4 Guest(s)