Quote:
Originally Posted by DarkGod
Shield?
|
It does not say so in amxconst.inc, but thank you.
Quote:
Originally Posted by wrecked_
cs_get_weapon_id() is used with the weapon entity as the first and only parameter. In your case, you were passing the player's id. Just an explanation so you'd learn from this.
|
I see now. Thank you.
Quote:
Originally Posted by Bugsy
Instead of using a switch you could create an array, having an element for each weapon index.
Just be sure to add a blank/zero value as a place holder if there is no weapon for a given index.
PHP Code:
new const GunMax[ 31 ] = { 0, 13, 0, 10, 0 // etc for all weapons }
Then access value
GunMax[ get_user_weapon( id ) ]
If you choose to do this, it is a good idea to check the value returned by get_user_weapon prior to passing it into the array.
|
I believe get_user_weapon() returns the CSW_* value of the gun the index is holding, so I do not quite understand what you are trying to explain me here.
I think it was cs_get_user_weapon() which gave a number.
But why add a 0 after each weapon? And I do not quite follow you on how to store max clips and such. I rarely use arrays. Is it any faster to do it that way, and not with a switch?
__________________