IsPlayerInArea not working. [ REP ++ ]
#1

pawn Код:
forward CheckAdminArea();
public CheckAdminArea()
{
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInArea(i,2082.2393,2417.5349,1203.1693,1363.7429))
        {
            SetPlayerHealth(i,0); // Kills him, for example.
        }
    }
    return 1;
}
//At on gm init
SetTimer("CheckAdminArea",3000,1);
//Stock:
stock IsPlayerInArea(playerid,Float:max_x,Float:min_x,Float:max_y,Float:min_y)
{
    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]) return 1; //Checks if the player is in the area, and if so returns 1.
    return 0; //Else it returns 0.
}
i teleported to 2082.2393 walked a lil bit and nothing happens!
Reply


Messages In This Thread
IsPlayerInArea not working. [ REP ++ ] - by buburuzu19 - 09.12.2014, 08:39
Re: IsPlayerInArea not working. [ REP ++ ] - by Threshold - 09.12.2014, 10:41

Forum Jump:


Users browsing this thread: 1 Guest(s)