- Регистрация
- 6 Апр 2013
- Сообщения
- 270
- Лучшие ответы
- 0
- Репутация
- 73
Здравствуйте, решил выложить очень качественный анти-чит который работает без ложных срабатываний.
Update 4 [27.05.2014]
и так начнем
Шаг 1: ко всем new добавляем
Шаг 2: в любом свободном месте добавляем
Шаг 4:
в public OnGameModeInit()
в public OnGameModeExit()
Шаг 5:
в public OnPlayerWeaponShot, если нету то создаем
Шаг 6:
в public OnPlayerConnect(playerid) и public OnPlayerDisconnect(playerid, reason)
Шаг 7:
в public OnPlayerExitVehicle(playerid, vehicleid)
Все. античит готов, осталось все GivePlayerWeapon заменить на GiveWeapon и ResetPlayerWeapons на ResetWeapons
Автор: Ru[D]o
Update 4 [27.05.2014]
и так начнем
Шаг 1: ко всем new добавляем
PHP:
enum wInfo
{
pAmmo,
pWeapon
}
new GunInfo[MAX_PLAYERS][wInfo][13];
new OneSecondTimer;
#define publics%0(%1) forward %0(%1); public %0(%1)
PHP:
stock ResultCheat(p, r)
{
new string[76+1], result[20];
switch(r)
{
case 1: result = "Оружие";
case 2: result = "Патроны";
case 3: result = "Бесконечные патроны";
}
format(string, sizeof(string), "Вы были кикнуты по подозрению в читерстве! (%s)", result);
SendClientMessage(p, 0xFF6347AA, string);
Kick(p);
return true;
}
stock GiveWeapon(p, w, a)
{
SetPVarInt(p, "GunCheck", 5);
switch(w)
{
case 0..15,40,44..46: return GunInfo[p][pWeapon][Slot(w)] = w, GivePlayerWeapon(p, w, a);
case 39:
{
GunInfo[p][pAmmo][Slot(w)] += a;
GunInfo[p][pWeapon][Slot(40)] = 40;
}
default: GunInfo[p][pAmmo][Slot(w)] += a;
}
GunInfo[p][pWeapon][Slot(w)] = w;
GivePlayerWeapon(p, w, a);
return true;
}
stock ResetWeapons(p)
{
SetPVarInt(p, "GunCheck", 5);
for(new i = 0; i < 13; i++ ) GunInfo[p][pAmmo][i] = 0, GunInfo[p][pWeapon][i] = 0;
ResetPlayerWeapons(p);
}
stock Slot(w)
{
switch(w)
{
case 0,1: return 0;
case 2..9: return 1;
case 10..15: return 10;
case 16..18,39: return 8;
case 22..24: return 2;
case 25..27: return 3;
case 28,29,32: return 4;
case 30,31: return 5;
case 33,34: return 6;
case 35..38: return 7;
case 40: return 12;
case 41..43: return 9;
case 44..46: return 11;
}
return -1;
}
stock CheckWeapon(p)
{
new w, a;
if(GetPlayerWeapon(p) != GunInfo[p][pWeapon][Slot(GetPlayerWeapon(p))]) return ResultCheat(p, 1);
switch(GetPlayerWeapon(p))
{
case 0..15,40,44..46: return true;
}
GetPlayerWeaponData(p, Slot(GetPlayerWeapon(p)), w, a);
if(GunInfo[p][pAmmo][Slot(w)]+9 < a) return ResultCheat(p, 2);
return true;
}
publics OneSecond()
{
foreach(Player, i)
{
if(!GetPVarInt(i, "GunCheck")) CheckWeapon(i);
if(GetPVarInt(i, "GunCheck") > 0) SetPVarInt(i, "GunCheck", GetPVarInt(i, "GunCheck") - 1);
}
return true;
}
в public OnGameModeInit()
PHP:
OneSecondTimer = SetTimer("OneSecond", 1000, 1);
PHP:
KillTimer(OneSecondTimer);
в public OnPlayerWeaponShot, если нету то создаем
PHP:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(weaponid)
{
case 0..15,40,44..46: return true;
}
GunInfo[playerid][pAmmo][Slot(weaponid)] --;
if(GunInfo[playerid][pAmmo][Slot(weaponid)] > GetPlayerAmmo(playerid)) GunInfo[playerid][pAmmo][Slot(weaponid)] = GetPlayerAmmo(playerid);
else if(GunInfo[playerid][pAmmo][Slot(weaponid)]+9 < GetPlayerAmmo(playerid)) return ResultCheat(playerid, 3);
return true;
}
в public OnPlayerConnect(playerid) и public OnPlayerDisconnect(playerid, reason)
PHP:
ResetWeapons(playerid);
в public OnPlayerExitVehicle(playerid, vehicleid)
PHP:
if(GetPlayerWeapon(playerid) == 46) GiveWeapon(playerid, 46, 1);
Автор: Ru[D]o
Последнее редактирование: