Need anti cheat
#7

IIRC scrolling into a vehicle doesn't call OnPlayerEnterVehicle. You can probably set a variable there, but you also have to put the PutPlayerInVehicle function into account as well as it doesn't call it either.

Example:
pawn Код:
new PlayerEnterVehicle[MAX_PLAYERS] = INVALID_VEHICLE_ID;
PutPlayerInVehicle(playerid, vehicleid, seat) {
     if(PutPlayerInVehicle(playerid, vehicleid, seat) == 1) {
            PlayerEnterVehicle[playerid] = vehicleid;
     }

     return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
     PlayerEnterVehicle[playerid] = vehicleid;
     return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate) {
     if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) {
           if(PlayerEnterVehicle[playerid] != GetPlayerVehicleID(playerid)) BanEx(playerid, "Vehicle Teleport Hacks");
           PlayerEnterVehicle[playerid] = INVALID_VEHICLE_ID;
     }
 
     return 1;
}

public OnPlayerConnect(playerid) PlayerEnterVehicle[playerid] = INVALID_VEHICLE_ID;
Reply


Messages In This Thread
Need anti cheat - by keyvanik - 24.03.2016, 21:52
Re: Need anti cheat - by Joron - 24.03.2016, 21:56
Re: Need anti cheat - by keyvanik - 24.03.2016, 22:03
Re: Need anti cheat - by N0FeaR - 24.03.2016, 22:18
Re: Need anti cheat - by keyvanik - 24.03.2016, 22:25
Re: Need anti cheat - by Phar - 24.03.2016, 22:29
Re: Need anti cheat - by Abagail - 24.03.2016, 22:34
Re: Need anti cheat - by Phar - 26.03.2016, 07:23
Re: Need anti cheat - by keyvanik - 31.03.2016, 07:40

Forum Jump:


Users browsing this thread: 1 Guest(s)