22.11.2015, 11:38
You can try finding out how fast the player is able to switch between enter/exit at OnPlayerUpdate.
I have a working algorithm which detects the troll which need the player to be in the vehicle. But with few modifications you can make it detect if a player enter/exits very fast.
The code is in C++.
I have that in OnPlayerUpdate. The code looks huge of course but you can cut it by half (my code has alot of unnecessary stuff).
You will have to now do the tick difference checks when the vehicleid changes. My code give above does the tick difference calculations if and only if the player is in a vehicle.
I have a working algorithm which detects the troll which need the player to be in the vehicle. But with few modifications you can make it detect if a player enter/exits very fast.
The code is in C++.
Code:
if (PlayerList[playerid]->IsAntiCheatEnabled(CheatType::VEHICLE_TROLL_CHEAT)) { switch (PlayerList[playerid]->AntiCheatStatus[CheatType::VEHICLE_TROLL_CHEAT]) { case AntiCheatCommands::CHECK: { int vehicleid = GetPlayerVehicleID(playerid); if (vehicleid != 0) { if (PlayerList[playerid]->vehicleid != vehicleid) { int tick = GetTickCount(); if (tick - PlayerList[playerid]->LastVehicleChangeTick < MIN_VEHICLE_SWITCH_TIME) { if (++(PlayerList[playerid]->WarningCount[CheatType::VEHICLE_TROLL_CHEAT]) >= MaxDetectionProbes[CheatType::VEHICLE_TROLL_CHEAT]) { for (list <Interface *>::iterator p = InterfaceList.begin(); p != InterfaceList.end(); p++) (*p)->CheatCallback(playerid, CheatType::VEHICLE_TROLL_CHEAT, 0, 0, 0, 0.0); PlayerList[playerid]->WarningCount[CheatType::VEHICLE_TROLL_CHEAT] = 0; } } PlayerList[playerid]->LastVehicleChangeTick = tick; PlayerList[playerid]->vehicleid = vehicleid; } } break; } case AntiCheatCommands::SKIP: break; default: PlayerList[playerid]->AntiCheatStatus[CheatType::VEHICLE_TROLL_CHEAT]--; } }
You will have to now do the tick difference checks when the vehicleid changes. My code give above does the tick difference calculations if and only if the player is in a vehicle.