SA-MP Forums Archive
Anti ammo hack [REP++++] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti ammo hack [REP++++] (/showthread.php?tid=562371)



Anti ammo hack [REP++++] - nezo2001 - 08.02.2015

I made this anti ammo hack
PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
HOLDING(KEY_FIRE))
    {
        
bAmmo[playerid] = GetPlayerAmmo(playerid);
        
bWeapon[playerid] = GetPlayerWeapon(playerid);
        if(
GetPlayerWeapon(playerid) < 16 || GetPlayerWeapon(playerid) == 19 || GetPlayerWeapon(playerid) == 20 || GetPlayerWeapon(playerid) == 21 || GetPlayerWeapon(playerid) > 38) return 0;
        for(new 
07;i++)
        {
            
nAmmo[playerid] = GetPlayerAmmo(playerid);
            
nWeapon[playerid] = GetPlayerWeapon(playerid);
        }
        if(
bAmmo[playerid] == nAmmo[playerid] && bWeapon[playerid] == nWeapon[playerid])
        {
            new 
string[128];
            new 
name[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
            
format(string,sizeof(string),"%s has banned for ammo hack",name);
            
SendClientMessageToAll(0xAA3333AA,string);
            
SetTimerEx("ban",500,false,"i",playerid);
            
SendClientMessage(playerid0xAA3333AA,"You have banned from the server ");
            
printf("Cheat Detect");
            
#pragma unused string1
        
}
    }
    return 
1;
}
forward ban(playerid);
public 
ban(playerid)
{
    
BanEx(playerid"Ammo Hack");
    return 
1;

It didn't work and didn't print the word.
Please Help
REP+++++


Re: Anti ammo hack [REP++++] - Vince - 08.02.2015

I'm placing my bets on your very first if-statement. Do you know what "holding" means? It means holding one key and then pressing another key so the callback gets called again. Try changing that into PRESSED or RELEASED.

Also: debug, debug, debug.


Re: Anti ammo hack [REP++++] - nezo2001 - 08.02.2015

Nothing i tried the realse and the pressed nothing happend..
Please this is very important because this isn't for me