SA-MP Forums Archive
how to check if someone is around a coordinate? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to check if someone is around a coordinate? (/showthread.php?tid=387585)



how to check if someone is around a coordinate? - niels44 - 25.10.2012

hey everyone,

as some of you know, im working on AntiCheat for my server, but now i am stuck at a problem

pawn Код:
if(GetPlayerSpeed(playerid) >= 260 && !IsPlayerInPlane(playerid))
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y , z);
        if(z != 0)
        {
            return 0;
        }
        else
        {
            SetTimerEx("CheckSpeedHacker", 3000, false, "d", playerid);
            PlayerInfo[playerid][Speed] = GetPlayerSpeed(playerid);
        }
    }
how to check if the player's Z coord is around 0? i already tried something like !~, but that gave me errors...

i want to check if someone is NOT around 0 z coords, then it should just return 0, and not go further in the antispeedhack, but if he is around 0 and going 260 mph, then it should...

greets niels


Re: how to check if someone is around a coordinate? - _Khaled_ - 25.10.2012

REMOVED


Re: how to check if someone is around a coordinate? - Finn - 25.10.2012

pawn Код:
if(-1.0 < z < 1.0)
{
    // z is more than -1 and less than 1.0
}



Re: how to check if someone is around a coordinate? - niels44 - 25.10.2012

ty , sorry for late reply