Anti CP Teleports
#4

You asked for ideas, I'm not going to write you an Anti-Cheat. That takes time and testing and I don't like giving incomplete code or untested code.

I doubt anyone else will either, however I will give you a starting point.

So I would start like this:

-- List --
1. Find OnPlayerEnterRaceCheckpoint
2. Check if its the first checkpoint, and if it is ignore it and just store the current time ( using gettime() ) to a variable such as 'LastCheckpointTime'.
3. If its not the first checkpoint, then use 'GetDistanceToPoint' to get the distance, then you need to grab the max speed of the vehicle + 10 for lag / high fps. Then you can do 'distance / speed' as that will equal the minimum time it will take to get there.
4. Using the 'LastCheckpointTime' you can get the time it took. ( gettime() - LastCheckpointTime[ playerid ] ) will give you the time it took the player to enter the next checkpoint. Now compare the time with the one from list item 3
5. Check if the player is faster then the minimum time. If they are you can send admins a message or ban them, that depends on you.


-- Useful Things --

Time = Distance / Speed - this is useful for working out the time it takes to get from A - B
Link to Vehicle Max Speeds
Reply


Messages In This Thread
Anti CP Teleports - by SpaceRP - 01.03.2017, 21:36
Re: Anti CP Teleports - by azzerking - 02.03.2017, 00:13
Re: Anti CP Teleports - by SpaceRP - 02.03.2017, 10:17
Re: Anti CP Teleports - by azzerking - 02.03.2017, 18:23

Forum Jump:


Users browsing this thread: 1 Guest(s)