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

Solved weaponbox/armoury_entity Touch


Post New Thread Reply   
 
Thread Tools Display Modes
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-09-2018 , 10:39   Re: weaponbox/armoury_entity Touch
Reply With Quote #21

Quote:
Originally Posted by HamletEagle View Post
Code:
I: g_szValues = "ARM_MP5"
	iValue = ARM_MP5
	.
	.
	.
	iValue = ARM_SMOKEGRENADE // 18
	
II: g_szValues = "ARM_TMP"
	iValue = ARM_MP5
	.
	.
	.
	iValue = ARM_SMOKEGRENADE // 18
You are setting for the same key all possible indexes, one after another. That's why you get only the last one. Get rid of the second for.

And do something like this:
PHP Code:
new const Values[][] =
{
    
ARM_MP5,
    
ARM_TMP,
    
ARM_P90,
    
ARM_MAC10,
    
ARM_AK47,
    
ARM_SG552,
    
ARM_M4A1,
    
ARM_AUG,
    
ARM_SCOUT,
    
ARM_G3SG1,
    
ARM_AWP,
    
ARM_M3,
    
ARM_XM1014,
    
ARM_M249,
    
ARM_FLASHBANG,
    
ARM_HEGRENADE,
    
ARM_KEVLAR,
    
ARM_ASSAULT,
    
ARM_SMOKEGRENADE
}

TrieSetCellg_tWeaponTrieg_szValues], Values[i]); 
Thanks so much, by the way you have to change
Code:
new const Values[][]
to
Code:
new const Values[] =

Any idea why armoury_entity entities have less BackPack Ammo as usual? AK47 and M4A1 have 60. It's okay as I'm gonna modify it

Thanks again!
__________________

Last edited by edon1337; 01-09-2018 at 10:44.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-09-2018 , 10:46   Re: weaponbox/armoury_entity Touch
Reply With Quote #22

https://github.com/s1lentq/ReGameDLL...pons.cpp#L2238

It takes values from here: https://github.com/s1lentq/ReGameDLL...pons.cpp#L2171 (3rd column).
__________________

Last edited by HamletEagle; 01-09-2018 at 10:47.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-09-2018 , 10:58   Re: weaponbox/armoury_entity Touch
Reply With Quote #23

Quote:
Originally Posted by HamletEagle View Post
Thank you for the links. Weaponbox entities have different array with different values, right?
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-09-2018 , 11:12   Re: weaponbox/armoury_entity Touch
Reply With Quote #24

Quote:
Originally Posted by edon1337 View Post
Thank you for the links. Weaponbox entities have different array with different values, right?
weaponbox are different. Look in weapons.cpp for CWeaponBox:: functions to see how they are implemented.
To see how a weapon is added into a weaponbox look in player.cpp for DropPlayerItem.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-09-2018 , 13:37   Re: weaponbox/armoury_entity Touch
Reply With Quote #25

Quote:
Originally Posted by HamletEagle View Post
weaponbox are different. Look in weapons.cpp for CWeaponBox:: functions to see how they are implemented.
To see how a weapon is added into a weaponbox look in player.cpp for DropPlayerItem.
Apparently weaponbox entities have a model lol, https://github.com/alliedmodders/hls...pons.cpp#L1243
__________________
edon1337 is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-09-2018 , 14:30   Re: weaponbox/armoury_entity Touch
Reply With Quote #26

In the first round, everything works properly, but in the next rounds, I'm not able to pick-up any weapons, they are on the ground but I'm unable to pick them up.. I'm using New Round event to create the entities, why is this happening?

EDIT: I can pick them up only when I force set sv_restartround to 1, maybe that's when the new round starts, as I'm testing alone.
__________________

Last edited by edon1337; 01-09-2018 at 14:36.
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-09-2018 , 14:38   Re: weaponbox/armoury_entity Touch
Reply With Quote #27

Quote:
Originally Posted by edon1337 View Post
Apparently weaponbox entities have a model lol, https://github.com/alliedmodders/hls...pons.cpp#L1243
When it's created it does not contain any weapons, it has the weaponbox.mdl model. Right after that CWeaponBox:ackWeapon is called and the model is changed to the w_ model of the weapon.
__________________

Last edited by HamletEagle; 01-09-2018 at 15:08.
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-15-2018 , 18:07   Re: weaponbox/armoury_entity Touch
Reply With Quote #28

Quote:
Originally Posted by edon1337 View Post
In the first round, everything works properly, but in the next rounds, I'm not able to pick-up any weapons, they are on the ground but I'm unable to pick them up.. I'm using New Round event to create the entities, why is this happening?

EDIT: I can pick them up only when I force set sv_restartround to 1, maybe that's when the new round starts, as I'm testing alone.
Bump.

Also sometimes, after I pick up something, there's still many left in there, but when I create the entities I set m_iCount to 1.
__________________
edon1337 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-15-2018 , 18:33   Re: weaponbox/armoury_entity Touch
Reply With Quote #29

You need to create them only once, in a place like plugin_init. Game will take care of respawning the armoury_entity on new round/hide it when item count is 0.
__________________
HamletEagle is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 01-15-2018 , 18:37   Re: weaponbox/armoury_entity Touch
Reply With Quote #30

Quote:
Originally Posted by HamletEagle View Post
You need to create them only once, in a place like plugin_init. Game will take care of respawning the armoury_entity on new round/hide it when item count is 0.
Thanks, Hamlet, I'll test it tomorrow and tell you the results! I have a question:

So if item count is 0, the item will be removed, if 1 then only 1 entity will be created?
__________________
edon1337 is offline
Reply


Thread Tools
Display Modes

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 05:19.


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