SA-MP Forums Archive
Airbrake protection - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Airbrake protection (/showthread.php?tid=134649)



Airbrake protection - andrewp - 17.03.2010

So, I had an idea for airbreak protection for if someone's in jail. Could someone point me in the direction on how to code this?

Here's how it works:

When someone is arrested (in cops and robbers), then they are sent to jail and a timer starts. I want it so that if the person is not in the range of the jail cell and the timer is still going, then they are automatically banned. I know how to do Ban();, but how would I check if they aren't in range but the timer is still going.

Thanks


Re: Airbrake protection - ScottCFR - 17.03.2010

Just use an Anti-Cheat


Re: Airbrake protection - andrewp - 17.03.2010

Quote:
Originally Posted by AndrewP
Could someone point me in the direction on how to code this?



Re: Airbrake protection - philmckrakin - 17.03.2010

Set the timer to 1 second (1000) and have the repeat set to true, then inside the timer func you want to do
if (!isplayerinrangeofpoint(playerid, x, y, z, range))
{
Ban();
}

and be sure to use killtimer when the player leaves the cell/jail
one more note you will need to use settimerex for this aswell.

but in the end I recomend you finding an anti cheat because there are better (but more complex) ways to do it

Hope this puts you on your path xD

Happy scripting /phil



Re: Airbrake protection - andrewp - 17.03.2010

Quote:
Originally Posted by philmckrakin
Set the timer to 1 second (1000) and have the repeat set to true, then inside the timer func you want to do
if (!isplayerinrangeofpoint(playerid, x, y, z, range))
{
Ban();
}

and be sure to use killtimer when the player leaves the cell/jail
one more note you will need to use settimerex for this aswell.

but in the end I recomend you finding an anti cheat because there are better (but more complex) ways to do it

Hope this puts you on your path xD

Happy scripting /phil
Thanks!


Re: Airbrake protection - philmckrakin - 17.03.2010

Np xD