Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new strings[256],Float:KOR[3];
if(newstate == PLAYER_STATE_PASSENGER || oldstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_DRIVER)
{
new cars = GetPlayerVehicleID(playerid);
GetVehiclePos(cars,KOR[0],KOR[1],KOR[2]);
if(GetTickCount()- GetPVarInt(playerid, "anticarshoot") < 500)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
SetVehiclePos(cars,KOR[0],KOR[1],KOR[2]);
format(strings,sizeof(strings),"(( * %s Player is kicked from server by anti cheating system. Reason: Anti Car Shoot. ))",name);
SendClientMessageToAll(-1,strings);
Kick(playerid);
}
SetPVarInt(playerid,"anticarshoot",GetTickCount());
}
return true;
}