what is faster? switch or an array?
PHP Code:
PHP Code:
|
Re: what is faster? switch or an array?
I guess the first.
|
Re: what is faster? switch or an array?
I always use an array for something like that.
|
Re: what is faster? switch or an array?
I don't really know, coz 1 method requieres more functions to be called in order to obtain the weapon id, etc... Actually I don't really know how to make it work the first method, since this needs something like weapon_deagle instead of CSW_DEAGLE...
Could anyone help me? |
Re: what is faster? switch or an array?
Use switch.
|
Re: what is faster? switch or an array?
Array good to use because:
-> fast access -> easy to write Bad: -> uses memory unfortunately Switch: Good: -> doesn't use memory Bad: -> hard to write (sometimes) In this case I would advise the first ... |
Re: what is faster? switch or an array?
Quote:
|
Re: what is faster? switch or an array?
Where do you get the weapon name ?
You should be able to retrieve directly weapon id. (if attacker = inflictor, use get_user_weapon ) |
| All times are GMT -4. The time now is 02:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.