Anti CP Teleports
#1

Do you some has idea how create anti checkpoint teleport?
Reply
#2

On the assumption that you have your checkpoints stored in an array or iterator, I would get the current checkpoint position and the next checkpoint position, I would then use a function like GetDistanceToPoint, to work out how far the checkpoints are from each other, then you will need to find out the minimum time it would take to get to that checkpoint either by the vehicle they are using or by the max speed of the fastest vehicle.

You then store the time in a variable so when the player hits that checkpoint, you can then check how long it took them to get there and if they are faster then the minimum time, then send a message to admins or ban them ( but only after testing it is 100% ), remember lag can have an impact on it.
Reply
#3

Example?
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)