Anti ammo hack
#1

Howdy,

I have made an anti spawn ammo hack in my server, which basically kicks the player who spawn AMMO not weapon.
Like you already have the weapon but you spawn ammo for it.

So yeah, It's not working fine in the host at all, I'm using OnPlayerWeaponShot and it keeps kicking the players whenever they shot.

Here's my custom GivePlayerWeapon function:

PHP код:
new gPlayerAmmo[MAX_PLAYERS][12];
GivePlayerWeaponEx(playeridweaponidammo) {
    if(!
weaponid) return 0;
    
gPlayerAmmo[playerid][GetWeaponSlot(weaponid)] = ammo;
    return 
GivePlayerWeapon(playeridweaponidammo);

Here's my OnPlayerWeaponShot:

PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
weaponid != && weaponid != 46)
    {
        if(
GetPlayerAmmo(playerid) < gPlayerAmmo[playerid][GetWeaponSlot(weaponid)]) {
            
gPlayerAmmo[playerid][GetWeaponSlot(weaponid)] = GetPlayerAmmo(playerid);
        }
        if(!
InEvent[playerid] && !InDerby[playerid] && !InTDM[playerid] && !InParkour[playerid] && !InSkydive[playerid] && !InDuel[playerid] && !Info[playerid][InDM] && !InShooter[playerid]) {
            if(
GetPlayerAmmo(playerid) > && GetPlayerAmmo(playerid) > gPlayerAmmo[playerid][GetWeaponSlot(weaponid)] && GetPlayerVirtualWorld(playerid) == 0) {
                
RemovePlayerWeapon(playeridweaponid);
                
gPlayerWeapon[playerid][GetWeaponSlot(weaponid)] = false;
                
gPlayerAmmo[playerid][GetWeaponSlot(weaponid)] = 0;
                
format(stringsizeof string"{FF0000}<!> {CC6699}%s has been kicked for ammo hack"GetName(playerid));
                
SendClientMessageToAll(redstring);
                return 
DelayKick(playerid);
            }
        }
    }
    return 
1;

Any help would be appreciated.
Thanks in advance.
Reply


Messages In This Thread
Anti ammo hack - by oMa37 - 23.09.2017, 16:43
Re: Anti ammo hack - by Logic_ - 23.09.2017, 17:03
Re: Anti ammo hack - by oMa37 - 23.09.2017, 17:05
Re: Anti ammo hack - by GoldenLion - 23.09.2017, 19:55
Re: Anti ammo hack - by NaS - 24.09.2017, 08:55
Re: Anti ammo hack - by oMa37 - 24.09.2017, 12:19
Re: Anti ammo hack - by Kane - 24.09.2017, 12:51
Re: Anti ammo hack - by oMa37 - 24.09.2017, 13:05
Re: Anti ammo hack - by Paulice - 24.09.2017, 14:28
Re: Anti ammo hack - by AbyssMorgan - 27.09.2017, 17:16
Re: Anti ammo hack - by oMa37 - 27.09.2017, 17:45
Re: Anti ammo hack - by AbyssMorgan - 27.09.2017, 17:48
Re: Anti ammo hack - by oMa37 - 27.09.2017, 17:54
Re: Anti ammo hack - by AbyssMorgan - 27.09.2017, 17:56
Re: Anti ammo hack - by AbyssMorgan - 27.09.2017, 18:21
Re: Anti ammo hack - by oMa37 - 27.09.2017, 18:21
Re: Anti ammo hack - by jlalt - 27.09.2017, 18:26
Re: Anti ammo hack - by oMa37 - 27.09.2017, 18:42
Re: Anti ammo hack - by GaByM - 27.09.2017, 19:09
Re: Anti ammo hack - by oMa37 - 01.10.2017, 16:11
Re: Anti ammo hack - by AbyssMorgan - 01.10.2017, 16:15
Re: Anti ammo hack - by oMa37 - 01.10.2017, 16:21
Re: Anti ammo hack - by oMa37 - 02.10.2017, 11:51
Re: Anti ammo hack - by jlalt - 02.10.2017, 17:32
Re: Anti ammo hack - by xo - 02.10.2017, 19:15
Re: Anti ammo hack - by m4karow - 02.10.2017, 19:16
Re: Anti ammo hack - by xo - 02.10.2017, 19:19
Re: Anti ammo hack - by Evocator - 02.10.2017, 19:33
Re: Anti ammo hack - by m4karow - 02.10.2017, 20:04
Re: Anti ammo hack - by oMa37 - 03.10.2017, 04:39
Re: Anti ammo hack - by ToiletDuck - 03.10.2017, 06:24
Re: Anti ammo hack - by oMa37 - 03.10.2017, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)