Anti Ammo Hack doesn't work
#1

Hey guys, I have tested my AC earlier and I found out something
When I tried to grab a gun which I don't have, I got kicked just like I should have
But, when I still could add more AMMO to my gun, when I added a function to block this aswell, I got kicked even if I got the guns legally, anyone ?

PHP код:
stock GiveNexWeapon(playeridweaponidammo)
{
    
PlayerPlaySound(playerid10520.00.00.0);
    
PlayerInfo[playerid][pWeapon][GetWeaponSlot(weaponid)] = weaponid;
    
PlayerInfo[playerid][pWeaponAmmo][GetWeaponSlot(weaponid)] = ammo;
    
GivePlayerWeapon(playeridweaponidammo);
    return 
1;

PHP код:
forward WeaponHack();
public 
WeaponHack()
{
    new 
weaponidammo;
    foreach(new 
playerid Player)
    {
        
weaponid GetPlayerWeapon(playerid), ammo GetPlayerAmmo(playerid);
        if(
weaponid != PlayerInfo[playerid][pWeapon][GetWeaponSlot(weaponid)] || ammo != PlayerInfo[playerid][pWeaponAmmo][GetWeaponSlot(playerid)]) Kick(playerid);
    }

This code was working (I didn't get kicked when I got guns from GiveNexWeapons)

PHP код:
forward WeaponHack();
public 
WeaponHack()
{
    new 
weaponidammo;
    foreach(new 
playerid Player)
    {
        
weaponid GetPlayerWeapon(playerid), ammo GetPlayerAmmo(playerid);
        if(
weaponid != PlayerInfo[playerid][pWeapon][GetWeaponSlot(weaponid)]) Kick(playerid);
    }

Reply
#2

I will suggest u to use server sided anti ammo hack system it will be helpful. no one can even hack ammo in game if u add it
Reply
#3

Quote:
Originally Posted by Owen007
Посмотреть сообщение
I will suggest u to use server sided anti ammo hack system it will be helpful. no one can even hack ammo in game if u add it
It wasn't my question, but thanks anyways, I'll refuse.
Reply
#4

Hello.

So that I understood this right:
You give your weapon (which you already have) more ammo (maybe you have 25 ammo and give plus 25, so that you have 50) and you will kick from the server, won't you?
If that's right can you show us how you try to give the weapon more ammo?
Reply
#5

Edit: Didn't read the topic properly. Will come with a reply.
Reply
#6

PHP код:
//Top of your script
new bool:Weapon[MAX_PLAYERS][47];
//OnPlayerDisconnect/Connect
for(new i46i++) Weapon[playerid][i] = false;
//Somewhere in your script
GivePlayerWeaponEx(playeridweaponidammo)
{
    
Weapon[playerid][weaponid] = true;
    return 
GivePlayerWeapon(playerid,weaponid,ammo);
}
ResetPlayerWeaponsEx(playerid)
{
    for(new 
i46i++) Weapon[playerid][i] = false;
    return 
ResetPlayerWeapons(playerid);
}
//Make timer to check whether the player is hacking or not
            
new weaponidammo;
            for (new 
0<= 12x++)
            {
                
GetPlayerWeaponData(playeridxweaponidammo);
                if(
weaponid && weaponid != 46 && Weapon[playerid][weaponid] == false)
                {
                    
ResetPlayerWeapons(playerid)
                    return 
Kick(playerid);
                }
            } 
This might work, Not tested tho.
Don't forgot to change all the GivePlayerWeapon/ResetPlayerWeapons to GivePlayerWeaponEx/ResetPlayerWeaponsEx.
Reply
#7

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello.

So that I understood this right:
You give your weapon (which you already have) more ammo (maybe you have 25 ammo and give plus 25, so that you have 50) and you will kick from the server, won't you?
If that's right can you show us how you try to give the weapon more ammo?
You are right, I get kicked.
But the problem is that even if I DO NOT use hacks, I get kicked for ammo.
Got a clue ?
Reply
#8

Can you show me how you give you more ammo or do you do this with GiveNexWeapon?
Reply
#9

Well, to explain your problem:

Quote:

ammo != PlayerInfo[playerid][pWeaponAmmo][GetWeaponSlot(playerid)]

When INGAME ammo is NOT equal with the SAVED ammo, then Kick(playerid).

When you got this line out, you told your gamemode not to check for ammo. Try to find out how the ammo is saved and in what file/path.
Reply
#10

Quote:
Originally Posted by TheDrx
Посмотреть сообщение
Well, to explain your problem:



When INGAME ammo is NOT equal with the SAVED ammo, then Kick(playerid).

When you got this line out, you told your gamemode not to check for ammo. Try to find out how the ammo is saved and in what file/path.
I am not saving ammo for a player, I simply give him the guns required for his class, when he chooses a class
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)