YellowFace1
Компетентный
Приветствую, уважаемые пользователи P-I.
Вот решил выложить свою версию анти-чита.
Вот решил выложить свою версию анти-чита.
Сразу к делу, добавляем в начало мода:
PHP:
new Float:TelePos[MAX_PLAYERS][6];
new WaitAirCheat[MAX_PLAYERS];
PHP:
WaitAirCheat[playerid]=0;
PHP:
WaitAirCheat[playerid]=2;
PHP:
new Float: velocity; GetPlayerVelocity(playerid, velocity, velocity, velocity);
if(velocity < 0.0 && WaitAirCheat[playerid] == 0) { WaitAirCheat[playerid]=2; }
PHP:
AntiAirBreak(playerid);
PHP:
stock AntiAirBreak(playerid)
{
if(GetPlayerDistanceFromPoint(playerid,TelePos[playerid][3],TelePos[playerid][4],TelePos[playerid][5]) < 5) { WaitAirCheat[playerid]=2; }
if(GetPlayerDistanceFromPoint(playerid,TelePos[playerid][0],TelePos[playerid][1],TelePos[playerid][2]) >= 15 && GetPlayerState(playerid)==1 && WaitAirCheat[playerid]==0)return Kick(playerid);
if(GetPlayerDistanceFromPoint(playerid,TelePos[playerid][0],TelePos[playerid][1],TelePos[playerid][2]) >= 20 && VehicleSpeed(GetPlayerVehicleID(playerid)) < 3 && GetPlayerState(playerid)==2 && WaitAirCheat[playerid]==0)return Kick(playerid);
GetPlayerPos(playerid, TelePos[playerid][0], TelePos[playerid][1], TelePos[playerid][2]);
if(WaitAirCheat[playerid]>0) WaitAirCheat[playerid]--;
return 1;
}
stock SetPPos(playerid,Float:x,Float:y,Float:z) return WaitAirCheat[playerid]=3,TelePos[playerid][3]=x, TelePos[playerid][4]=y,TelePos[playerid][5]=z,SetPlayerPos(playerid,x,y,z), true;
stock PutPlayerInVeh(playerid, vehicleid, seatid) return WaitAirCheat[playerid]=3,PutPlayerInVehicle(playerid, vehicleid, seatid), true;
stock SetVehicleEE(vehicleid, Float:x, Float:y, Float:z)
{
foreach(Player,i) { if(GetPlayerVehicleID(i) == vehicleid) { WaitAirCheat[i]=3; } }
SetVehiclePos(vehicleid,x,y,z);
return 1;
}
stock VehicleSpeed(carid)
{
new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(carid,X,Y,Z);
return floatround( floatsqroot( X * X + Y * Y ) * 100.0 );
}
PHP:
SetPlayerPos на SetPPos
PutPlayerInVehicle на PutPlayerInVeh
SetVehiclePos на SetVehicleEE
Последнее редактирование:
