Looking for anti Troll car -
VenomMancer - 30.06.2015
Hello guys.
In my server have player with troll cheat.
the cheat is make player who in vehicle will flying up.
Who know how to stop it ?
#sorryformybadenglish
Re: Looking for anti Troll car -
Suicidal.Banana - 30.06.2015
Ban the player.
In all seriousness, you prolly cant detect what player is doing it, because they're not doing it trough a route that SA-MP provides, so you have no way of knowing what playerid initiated movement on a vehicle.
Maybe you can get a bit more pleasing awnser in some of the anti-cheat thread's floating around, there might actually be a way to detect, personally, i dont know of any.
Oh and your English is fine, making your entire post bold is kinda useless though :P
Re: Looking for anti Troll car -
Ritzy2K - 30.06.2015
Its remote jacking.. I dont think you can script an anti cheat against it..ban em.
Re: Looking for anti Troll car -
Suicidal.Banana - 30.06.2015
Hmm, remote jacking as in carjacking? where multiple players are in the driver seat of a vehicle?
Then you could actually detect it:
0] Make an array in which you can store player-vehicle pairs. (for example using playerid as key and vehicleid as value)
1] Make a function that loops trough all the connected players
2] In that function, check if they're in a vehicle, if they are, check if they are in the driver-seat
3] If they are in driver-seat, loop trough the array from step 0, check to make sure no other player is registered as driver
4] If no other player is registered as the driver of said vehicle, store the player-vehicle pair in the array
5] BUT, if there is another player registered as the driver of said vehicle, the new player is actually a cheating son of a beach
Do take into consideration things like quits, deaths etc, make sure you handle those events, so that your player-vehicle array pairs are always correct. (and you dont end up banning people who you think have cheated, while its actually down to old data in said array)
Re: Looking for anti Troll car -
Abagail - 30.06.2015
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.