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

Solved [CS:GO] Set/Limit clip size and change reserve ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
The Team Ghost
Senior Member
Join Date: Jun 2016
Location: OnClientConnect(int ME)
Old 05-19-2020 , 17:37   [CS:GO] Set/Limit clip size and change reserve ammo
Reply With Quote #1

As the title says I would like to modify the reserve ammo and if possible limit the clip size, otherwise I'm fine with updating the clip size on reload to a set value.

I've looked through the following subject without any success (some don't do what I want specifically):
https://forums.alliedmods.net/showthread.php?p=2530287
https://forums.alliedmods.net/showthread.php?p=2385635
https://forums.alliedmods.net/showthread.php?p=2084134
__________________
- Steam

Last edited by The Team Ghost; 05-20-2020 at 12:19. Reason: Solved it myself
The Team Ghost is offline
The Team Ghost
Senior Member
Join Date: Jun 2016
Location: OnClientConnect(int ME)
Old 05-20-2020 , 12:18   Re: [CS:GO] Set/Limit clip size and change reserve ammo
Reply With Quote #2

I managed to get my answer from a good friend of mine.

I've used the following to set my clip
PHP Code:
SetEntProp(weaponProp_Data"m_iClip1"clip); 
And the following to set reserve ammo
PHP Code:
SetEntProp(weaponProp_Send"m_iPrimaryReserveAmmoCount"ammo);
SetEntProp(weaponProp_Send"m_iSecondaryReserveAmmoCount"ammo); 
Or the full function for those that want it
PHP Code:
void SetAmmo(int clientint wepslotint clipint ammo)
{
    
int weapon GetPlayerWeaponSlot(clientwepslot);
    if (
IsValidEntity(weapon))
    {
        
SetEntProp(weaponProp_Data"m_iClip1"clip);
        
SetEntProp(weaponProp_Send"m_iPrimaryReserveAmmoCount"ammo);
        
SetEntProp(weaponProp_Send"m_iSecondaryReserveAmmoCount"ammo);
    }

You need to add a lot more to limit clip and enforce reserve ammo but this is the gist of it.
__________________
- Steam

Last edited by The Team Ghost; 05-20-2020 at 12:20.
The Team Ghost 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 15:38.


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