I have a problem I pulled out this script to combat Teleport vehicles from ELC anticheat all associated with what you need but do not function properly, ports constantly vehicles via cheat and only sometimes out to use cheat to vehicle teleport
Код:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
{
if (CheatPlayerInfo[playerid][elc_AntiVehicleTelportHack]==2 && ELC_AC_IsCreatedVehicle(vehicleid))
{
new Float:elc_tempposx, Float:elc_tempposy, Float:elc_tempposz;
GetVehiclePos(vehicleid, elc_tempposx, elc_tempposy, elc_tempposz);
elc_tempposx = (new_x -elc_tempposx);
elc_tempposy = (new_y -elc_tempposy);
elc_tempposz = (new_z -elc_tempposz);
new Float:XMVDUCM = elc_GetVehicleSpeedXY(vehicleid)+MAX_VEHICLE_DISTANCE_UCM;
if(CheatVehicleInfo[vehicleid][elc_vStatut]==0&&!((elc_tempposx < XMVDUCM) && (elc_tempposx > -XMVDUCM)) && ((elc_tempposy < XMVDUCM) && (elc_tempposy > -XMVDUCM)) && ((elc_tempposz < XMVDUCM) && (elc_tempposz > -XMVDUCM)))
{
ELC_AC_SetVehiclePos(vehicleid, elc_tempposx, elc_tempposy, elc_tempposz);
SetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][elc_vAngle]);
if(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]==0)
{
CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]=playerid+1;
SaveTime(CheatVehicleInfo[vehicleid][elc_vPossibleHackTime],GetTickCount());
CheatPlayerInfo[playerid][elc_PossibleVehicleHack]=vehicleid;
}
else
{
CheatVehicleInfo[vehicleid][elc_vPossibleHackTime]=0;
if(IsPlayerConnected(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1))CheatPlayerInfo[CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1][elc_PossibleVehicleHack]=0;
CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]=0;
}
return 0;
}
else
{
if(CheatVehicleInfo[vehicleid][elc_vStatut]==1)CheatVehicleInfo[vehicleid][elc_vStatut]=0;
CheatVehicleInfo[vehicleid][elc_vX]=new_x;
CheatVehicleInfo[vehicleid][elc_vY]=new_y;
CheatVehicleInfo[vehicleid][elc_vZ]=new_z;
GetVehicleZAngle(vehicleid,CheatVehicleInfo[vehicleid][elc_vAngle]);
}
if(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]!=0 && playerid!=INVALID_PLAYER_ID && CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]!=playerid+1)
{
CheatVehicleInfo[vehicleid][elc_vPossibleHackTime]=0;
if(IsPlayerConnected(CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1))CheatPlayerInfo[CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]-1][elc_PossibleVehicleHack]=0;
CheatVehicleInfo[vehicleid][elc_vPossiblePlayerHack]=0;
}
}
return 1;
}