В начало мода к forward's добавляем forward ServerGivePlayerArmour(playerid, Float:armour);
forward anticheats();
В начало мода к new's добавляем
new ArmourTime[MAX_PLAYERS];
new Float:PlayerArmour[MAX_PLAYERS];
в public OnPlayerConnect
PlayerArmour[playerid] = 0;
ArmourTime[playerid] = 0;
в public SetPlayerUnjail
if(ArmourTime[i] > 0)
{
ArmourTime[i] -=1;
}
в public OnPlayerUpdate
new i = playerid;
if(ArmourTime[i] == 0)
{
new Float:b;
GetPlayerArmour(i,b);
if(b != PlayerArmour[i])
{
if(b < PlayerArmour[i])
{
PlayerArmour[i] = b;
}
else
{
ServerGivePlayerArmour(i,0);
}
}
}
Создаём свой паблик
public ServerGivePlayerArmour(playerid,Float:armour)
{
ArmourTime[playerid] = 10;
PlayerArmour[playerid] = armour;
SetPlayerArmour(playerid,armour);
return 1;
}
И создаём ещё 1 паблик
public anticheats()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(ArmourTime[i] == 0)
{
new Float:b;
GetPlayerArmour(i,b);
if(b != PlayerArmour[i])
{
if(b < PlayerArmour[i])
{
PlayerArmour[i] = b;
}
else
{
ServerGivePlayerArmour(i,0);
}
}
}
}
}
return 1;
}