How to detect car warp and avoid it?
#1

Hey guys, so I've been doing some searches over the internet about how to detect and avoid car warp and car hacks in general. I've had some results but luckily for me they weren't working once I runned some tests. If anyone could explain me or show me a working script that avoids these hacks then that would be great and I would be thankful.
Reply
#2

Car wrap can be detected easily - when player gets into vehicle in regular way, OnPlayerEnterVehicle is called (right when player press F to enter), right after that - OnPlayerStateChange (when player is already in vehicle).

When cheats for vehicle wrap are used there's to call to OnPlayerEnterVehicle, just OnPlayerStateChange. Also therr may be cheat which calls OnPlayerEnterVehicle but with very small delay. You can set variable for each player (lastVehicleEntryAttempt[MAX_PLAYERS]) and store GetTickCount() there each time OnPlayerEnterVehicle is called, and then check this variable in OnPlayerStateChange - if GetTickCount() - lastVehicleEntryAttempt[playerid] is less then 1000 (too fast) or more than 5000-10000 (too slow or didn't called OnPlayerEnterVehicle for last 5-10 seconds) you should prevent this player from entering vehicle. Don't kick or ban them just if that condition worked once - players can lag or just start entry - go AFK ... 10 seconds past ... - return to game - finaly sit in vehicle.

Hope that helps.
Reply
#3

Quote:
Originally Posted by prineside
Посмотреть сообщение
Car wrap can be detected easily - when player gets into vehicle in regular way, OnPlayerEnterVehicle is called (right when player press F to enter), right after that - OnPlayerStateChange (when player is already in vehicle).

When cheats for vehicle wrap are used there's to call to OnPlayerEnterVehicle, just OnPlayerStateChange. Also therr may be cheat which calls OnPlayerEnterVehicle but with very small delay. You can set variable for each player (lastVehicleEntryAttempt[MAX_PLAYERS]) and store GetTickCount() there each time OnPlayerEnterVehicle is called, and then check this variable in OnPlayerStateChange - if GetTickCount() - lastVehicleEntryAttempt[playerid] is less then 1000 (too fast) or more than 5000-10000 (too slow or didn't called OnPlayerEnterVehicle for last 5-10 seconds) you should prevent this player from entering vehicle. Don't kick or ban them just if that condition worked once - players can lag or just start entry - go AFK ... 10 seconds past ... - return to game - finaly sit in vehicle.

Hope that helps.
Apparently hackers can warp a vehicle without even entering them, thanks for the explanation tho, it helped me out partly but I still got the problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)