[HELP] Explaining Strip Stock
So i found this weapon strip stock, and i was looking over to learn couple things from it when i got the the lines i marked with red
What i don't understand is why get the weapon's name using it's index, in order to pass it to the next stock to retrieve it's index using it's name when you could simply pass directly the index ? o.O Code:
|
Re: [HELP] Explaining Strip Stock
I'm not sure why in the ham_strip_weapon stock get_weaponid is used.. You can simply use the weapon name (weapon_).
In strip_weapons get_weaponname is used to get the weapon name in weapon_ method (weapon_ak47) because get_user_weapons returns weapon name in CSW_ form (CSW_AK47). |
Re: [HELP] Explaining Strip Stock
Theres two id for the weapon
First id is the weapon entity in the world that player holds or dropped on the ground which its not constant entity id... Second id is the weapon id which its constant & defined ex : CSW_GLOCK18 |
Re: [HELP] Explaining Strip Stock
I was thinking about that, but i don't get this
In the first stock the index we retrieve is is the index of the weapon ( CSW_* ) since we compare it with the CSW_* bitsum ( iType ) Then we retrieve it's name ( weapon_* ) Then in the second stock, iWeaponID cannot be the entity index, because we retrieve just one by the name of the weapon, and there are multiple weapons with the same name also the entity index is actually retrieved after with get_entity_by_owner ( ks_get_entity_owner ) In conclusion we retrieve the weapon index in the second stock while we already retrieved it in the first... |
Re: [HELP] Explaining Strip Stock
NVM, get_weaponid is used to check for pev_valid.
@Depresie what iType are you talking about? Can you mark the line you don't understand? |
Re: [HELP] Explaining Strip Stock
Quote:
|
| All times are GMT -4. The time now is 21:00. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.