Ammo cap
#1

How do I make it so that when a player has over 200 ammo in his guns he gets banned for ammo hacking?
and how do I cap the ammo to stay at 200 and below
Reply
#2

Set up a timer like this:
pawn Код:
forward MyTimer();
public MyTimer()
{
    new ammo[13]; // Create an array called "ammo" with the size of 13
    foreach(new i : Player) // Loops through all online players (requires the foreach include)
    {
        for(new o = 0; o <= 12; o++) // Loops 12 times
        {
            GetPlayerWeaponData(playerid, o, ammo[o], ammo[o]);
            // Each time it loops, store the weapon in the array "ammo", then store the ammo in the array "ammo" instead
            // Because we don't need the weapon, so we just replace with the ammo
            if(ammo[o] > 200) Ban(i); // If "ammo" is higher than 200, ban the player
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)