Raised This Month: $51 Target: $400
 12% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 05-18-2015 , 12:44   Re: CS:GO Fix for reserve ammo patch. (Set Clip Ammo & Clips Remaining) [4/28/2015 Pa
Reply With Quote #2

Thanks for this!

I'm a bit clueless when it comes to this department, but if I wish to implement this server-wide so it works just as it did before, how would I go about doing this?

A couple examples; I run a couple hungergames maps where you're supposed to get a gun out of a box that only gives you 1 reserve bullet and a full first magazine, but now it gives you full reserve ammo. Also, during gungame maps, when on nade level, the player is given a deagle with only 7 rounds and no reserve ammo, but now they have full reserve ammo.

Thank you!
__________________
sneaK is offline
Hallucinogenic Troll
Senior Member
Join Date: Apr 2015
Old 05-30-2015 , 10:16   Re: CS:GO Fix for reserve ammo patch. (Set Clip Ammo & Clips Remaining) [4/28/2015 Pa
Reply With Quote #3

I'm sorry, I'm kind of big noob with scripting.

Can you make a plugin with that snippet with 1000 reserve ammo on each weapon? its for a MG/SURF server.
If you don't want to post here, add me on steam (same name, with 20+ lvl profile, from Portugal).

Last edited by Hallucinogenic Troll; 05-30-2015 at 10:21.
Hallucinogenic Troll is offline
Reply



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 04:07.


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