15.08.2015, 16:47
Quote:
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. |
