View Single Post
Old 19/04/2019, 10:57 AM   #5
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,800
Reputation: 1160
Default Re: Irresistible Anticheat & Weapon Shot Sync System (Lightweight)

Quote:
Originally Posted by Kasichok View Post
For ammo you can hook GivePlayerWeapon

PHP Code:
//hook GivePlayerWeapon
server_ammo[playerid][weaponslot] += ammo
PHP Code:
//OnPlayerWeaponShoot
if(server_ammo[playerid][GetWeaponSlot(weaponid)] < 1)
{
    
server_ammo[playerid][GetWeaponSlot(weaponid)] = 0;
    
server_weapon[playerid][GetWeaponSlot(weaponid)] = 0;
    if(
GetPlayerAmmo(playerid) != server_ammo[playerid][GetWeaponSlot(weaponid)])
    {
         
//ResetAllPlayerWeapons
         //loop 12 slots and give them the server weapons like GivePlayerWeapon(playerid, server_weapon[playerid][i], server_ammo[playerid][i]);
    
}

So when the player is using ammo hack the weapon will still remove.
"If it ain't broke, don't fix it"

Ammo tracking is pretty hard regardless, but I do definitely see the idea of having a "max ammo", and triggering if it goes above
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote