Raised This Month: $ Target: $400
 0% 

CS:GO Fix for reserve ammo patch. (Set Clip Ammo & Clips Remaining) [4/28/2015 Patch]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 05-13-2015 , 15:18   CS:GO Fix for reserve ammo patch. (Set Clip Ammo & Clips Remaining) [4/28/2015 Patch]
Reply With Quote #1

Sharing my snippet that allows me to use it just like before the 4/28/2015 Patch

There is no checking for valid entities since that has been done before I call these stocks
PHP Code:
/*
 * Gets the primary clip count of a weapon.
 * 
 * @param weapon        Weapon Entity.
 * @return                Primary Clip count.
 */
stock lib_GetPrimaryAmmo(weapon)
{
    return 
GetEntProp(weaponProp_Data"m_iClip1");
}
/*
 * Sets the primary ammo count of a weapon.
 * 
 * @param weapon        Weapon Entity.
 * @param value            Clip Count value.
 */
stock lib_SetPrimaryAmmo(weapon,ammo)
{
    
SetEntProp(weaponProp_Data"m_iClip1"ammo);
}
/*
 * Gets the secondary clip count of a weapon.
 * 
 * @param weapon        Weapon Entity.
 * @return                Primary Clip count.
 */
stock lib_GetSecondaryAmmo(weapon)
{
    return     
GetEntProp(weaponProp_Send"m_iPrimaryReserveAmmoCount");
}
/*
 * Sets the secondary ammo count of a weapon.
 * 
 * @param weapon        Weapon Entity.
 * @param value            Clip Count value.
 */
stock lib_SetSecondaryAmmo(weapon,ammo)
{
    
SetEntProp(weaponProp_Send"m_iPrimaryReserveAmmoCount"ammo);
}
/*
 * Sets the primarty and secondary ammo count of a weapon.
 * 
 * @param weapon        Weapon Entity.
 * @param value            Primary ammo Count value.
 * @param value            Primary ammo Count value.
 */
stock lib_SetWeaponAmmo(weapon,primaryammo,secondaryammo)
{
    
lib_SetPrimaryAmmo(weaponprimaryammo);
    
lib_SetSecondaryAmmo(weaponsecondaryammo);
}
/*
 * Gets the primary and secondary clip count of a weapon.
 * 
 * @param weapon                     Weapon Entity.
 * @param primaryammo                Primary Clip count.
 * @param secondaryammo                Secondary Clip count.
 */
stock lib_GetWeaponAmmo(weapon,&primaryammo,&secondaryammo)
{
    
primaryammo lib_GetPrimaryAmmo(weapon);
    
secondaryammo lib_GetSecondaryAmmo(weapon);

Doing lib_SetWeaponAmmo(weapon,0,0)
results into

Last edited by ImACow; 05-13-2015 at 15:24.
ImACow is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:28.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode