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

Solved [L4D2]set the weapon entity reserve annmo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kazya3
Member
Join Date: Aug 2019
Location: CN
Old 12-21-2022 , 22:39   [L4D2]set the weapon entity reserve annmo
Reply With Quote #1

i created a weapon on the ground like that:
PHP Code:
int weaponIndex CreateEntityByName("weapon_rifle");//m16 
But in game when i picked up i found the weapon dont have reserve ammo.
I tried the code:
PHP Code:
SetEntProp(weaponIndexProp_Send"m_iExtraPrimaryAmmo"600); 
or
PHP Code:
SetEntProp(weaponIndexProp_Send"m_iClip1"600); 
or
PHP Code:
SetEntProp(weaponIndexProp_Send"m_iClip2"600); 
Nothing happened. Is there a way that i can set the weapon entity's reserve ammo / primary ammo before player pick it up?

Last edited by kazya3; 12-22-2022 at 05:43.
kazya3 is offline
kazya3
Member
Join Date: Aug 2019
Location: CN
Old 12-21-2022 , 23:18   Re: [L4D2]set the weapon entity reserve annmo
Reply With Quote #2

Okay. I found i write the code "SetEntProp" before the "DispatchSpawn(weaponIndex)", i change SetEntProp code line after the DispatchSpawn, it works, its wierd.

Last edited by kazya3; 12-21-2022 at 23:21.
kazya3 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 06:31.


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