efficient remove of weaponbox (SOLVED)
I've searched about this and I got the 43 offset, but when I tested it, it always prints 0... and I also tried cs_get_weapon_id(), it also returns 0.
Basically I'm trying to detect weapon_* entities for weaponbox entities and remove them (because I just found out they're not removed when weapon is dropped X_X) so instead of searching through all entities or parsing model, it'll be more efficient to have the CSW_* id and use the already defined weapon_* array... So is there a CSW_* id offset for weaponbox class, which is it ? |
Re: getting a weaponbox's CSW_* id
If the purpose is to remove the weaponbox entity, just let think the entity when it touches on the ground and weaponbox + weapon_* will be removed.
|
Re: getting a weaponbox's CSW_* id
Slots offsets are 34-39 (linux +4)
Basically, 1 weaponbox could contain few weapons in each slots (same slots weapon linked with m_pNext weapon pdata), and that in all slots. In "reality" a weaponbox contain only 1 weapon). See this plugin for more details : http://forums.alliedmods.net/showthread.php?p=761924 See also HLSDK : Code:
//========================================================= |
Re: getting a weaponbox's CSW_* id
Quote:
Btw, I checked for weapon_* entities using a task, because it's logic that it will detect the entities in the same function call. So this is a verry efficient method... unless it fails =) EDIT: I also printed entitiy count, it drops by 2 every time :} |
Re: efficient remove of weaponbox (SOLVED)
If you want to remove them faster you can hook Ham_Touch, "weaponbox".
Spawn is too early but Touch is ok. |
Re: efficient remove of weaponbox (SOLVED)
What I've said...
|
Re: efficient remove of weaponbox (SOLVED)
Not really, you said when it touches the ground, when you hook weaponbox Touch, it is triggered right after spawn because it touches player who is dropping the weapon, maybe when it is on player death the first Touch is ground touch though.
|
Re: efficient remove of weaponbox (SOLVED)
Well, I'm removing the weaponbox from the ground after it's stayed there for a cvar controlled number of seconds, then it floats into the air and vanishes :} so no, no touch hook for me.
|
Re: efficient remove of weaponbox (SOLVED)
Quote:
I was talking about touch because previous help was always in this situation, but it's fine as long as entity is fully spawned and think initialized. |
| All times are GMT -4. The time now is 19:54. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.