Looking for anti Troll car
#5

The SA-MP data wouldn't report multiple drivers, I don't believe. But the troll modification doesn't call OnPlayerEnterVehicle for the vehicle, but it will show up as a state change, there is no need for any type of looping to detect the cheat.

pawn Код:
#include <a_samp>
new playerEnteringVehicle[MAX_PLAYERS];

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

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(playerEnteringVehicle[playerid] == INVALID_VEHICLE_ID || playerEnteringVehicle[playerid] != GetPlayerVehicleID(playerid)) {
            // most likely warp hacked
            return 1;
        }
       
        playerEnteringVehicle[playerid] = INVALID_VEHICLE_ID;
        return 1;
    }
   
    return 1;
}

public OnPlayerDisconnect(playerid, reason) {
    playerEnteringVehicle[playerid] = INVALID_PLAYER_ID;
    return 1;
}

stock PutPlayerInVehicleEx(playerid, vehicleid, seatid)
{
    if(vehicleid != INVALID_VEHICLE_ID && seatid != 128)
    {
        playerEnteringVehicle[playerid] = vehicleid;
    }
   
    PutPlayerInVehicle(playerid, vehicleid, seatid);
   
    return 1;
}

#if defined _ALS_PutPlayerInVehicle
  #undef PutPlayerInVehicle
#else
#define _ALS_PutPlayerInVehicle
#endif
#define PutPlayerInVehicle PutPlayerInVehicleEx
This should work in detecting warp hackers.
Reply


Messages In This Thread
Looking for anti Troll car - by VenomMancer - 30.06.2015, 15:49
Re: Looking for anti Troll car - by Suicidal.Banana - 30.06.2015, 16:01
Re: Looking for anti Troll car - by Ritzy2K - 30.06.2015, 17:20
Re: Looking for anti Troll car - by Suicidal.Banana - 30.06.2015, 17:50
Re: Looking for anti Troll car - by Abagail - 30.06.2015, 18:00

Forum Jump:


Users browsing this thread: 1 Guest(s)