Raised This Month: $ Target: $400
 0% 

Solved [HELP] Setting Ammo Clip to 150


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-01-2017 , 04:53   [HELP] Setting Ammo Clip to 150
Reply With Quote #1

Hi guys. I'm using cs_set_weapon_ammo to set a weapon's clip to 150. But the HUD only shows 106. Then when I fire it keeps increasing to about 120+ before it begins to go down. I haven't checked if there were actually 150 bullets fired and it's just a problem with the HUD.

Is there a limitation on the HL engine I'm not familiar with?...
__________________

Last edited by hellmonja; 03-01-2017 at 09:28.
hellmonja is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-01-2017 , 07:20   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #2

Yes, there is. I know it's 255 for the health, armor and backpack ammo, but not sure for the clip ammo. The ammo is still there, it's just not displayed properly.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-01-2017 , 07:20   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #3

Show the code, probably doing something wrong.

EDIT : Oh hey OciXCrom
__________________

Last edited by edon1337; 03-01-2017 at 07:20.
edon1337 is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-01-2017 , 08:00   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #4

Here's the snippet starting at line 284:
PHP Code:
       #define CLIP 150
       
...

        new 
ent fm_give_item(idweapon_negev);
        ...

        
// Set Ammo
        
cs_set_weapon_ammo(entCLIP); 
I've also attached the source code. It's rather long...
Attached Files
File Type: sma Get Plugin or Get Source (csgo_negev.sma - 394 views - 24.5 KB)
__________________

Last edited by hellmonja; 03-01-2017 at 08:01.
hellmonja is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-01-2017 , 08:04   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #5

I might've forgotten to define CLIP back to 150. I think the one I uploaded is set to 100 only. But that's all I changed. Sorry...
__________________
hellmonja is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-01-2017 , 08:10   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #6

Try doing this, also NEVER use Fakemeta util.
Code:
new ent = give_item(id, weapon_negev); if( ent > 0 ) cs_set_weapon_ammo(ent, CLIP)
__________________

Last edited by edon1337; 03-01-2017 at 08:32.
edon1337 is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-01-2017 , 08:24   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #7

My game hung up on me so I removed this line:
Code:
while( ent > 0 )
Still only 106 is showing.

I know I'm not supposed to use fakemeta_util. But this is old code I got a while back that I'm trying to update. Would you help me convert some codes from fakemeta_util to their appropriate counterparts?...
__________________

Last edited by hellmonja; 03-01-2017 at 08:28.
hellmonja is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-01-2017 , 08:33   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #8

Sorry, I meant to use 'if' not 'while'. Try again.

Why are you using this
Code:
        engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, g_Msg_CurWeapon, {0, 0, 0}, id)         write_byte(1)         write_byte(CSW_NEGEV)         write_byte(CLIP)         message_end()
__________________

Last edited by edon1337; 03-01-2017 at 08:38.
edon1337 is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 03-01-2017 , 08:42   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #9

Sorry. Still 106. It goes up until 128 then it becomes 127. From 106 to 128 there are 23 bullets. 23 + 127 = 150. I think its a HUD thing. >_<

I'm gonna try setting it to 110 and see what happens the edit the results in...
__________________
hellmonja is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-01-2017 , 08:43   Re: [HELP] Setting Ammo Clip to 150
Reply With Quote #10

Delete this and try again
Code:
        engfunc(EngFunc_MessageBegin, MSG_ONE_UNRELIABLE, g_Msg_CurWeapon, {0, 0, 0}, id)         write_byte(1)         write_byte(CSW_NEGEV)         write_byte(CLIP)         message_end()

Are you using any plugin that changes weapon ammo?
__________________
edon1337 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 20:59.


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