PHP код:
new carhack[MAX_PLAYERS][3];
onplayerconnect carhack[playerid][0]=0; carhack[playerid][1]=0; carhack[playerid][2]=0;
onplayerupdate ScanPlayerDosRaket(playerid);
stock ScanPlayerDosRaket(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(carhack[playerid][1] == 1)
{
carhack[playerid][1] = 0;
new Float:Velocity231[3];
GetVehicleVelocity(carhack[playerid][0], Velocity231[0], Velocity231[1], Velocity231[2]);
if(Velocity231[0]>2 || Velocity231[1]>2 || Velocity231[2]>2 || Velocity231[0]<-2 || Velocity231[1]<-2 || Velocity231[2]<-2)
{
SetVehicleHealth(carhack[playerid][0], 0);
if(carhack[playerid][2]<8) carhack[playerid][2]++; else
{
carhack[playerid][2] = 0;
new nameqepinru3[MAX_PLAYER_NAME],string[180];
GetPlayerName(playerid, nameqepinru3, sizeof(nameqepinru3));
format(string,sizeof(string),"Admin Message >> [Warning] Игрок %s[%d]: был заподозрен в car-hack",nameqepinru3,playerid);
MessageToAdmins(red,string);
}
}
}
new Float:Velocity23[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity23[0], Velocity23[1], Velocity23[2]);
if(Velocity23[0] == 0 && Velocity23[1] == 0 && Velocity23[2] == 0)
{
carhack[playerid][0] = GetPlayerVehicleID(playerid);
if(carhack[playerid][1] == 1) carhack[playerid][1] = 2;
if(carhack[playerid][1] == 0) carhack[playerid][1] = 1;
}
else carhack[playerid][0]=0, carhack[playerid][1]=0;
}
return true;
}