Ham_item_deploy
In this script that I found Ham_item_deploy is used to change weapon models instead of using the curweapon. I want to change multiple weapons, and this code seems rather good, however I'm wondering if I need a loop like this to use multiple weapons? Or can I use something like:
Code:
RegisterHam( Ham_Item_Deploy, "fwReplaceModels", 1);Code:
public fwReplaceModel( entity )And then do something like this: Code:
public fwReplaceModel( entity ) {Source: https://forums.alliedmods.net/showpo...42&postcount=5 |
Re: Ham_item_deploy
You need to register for each weapon
PHP Code:
PHP Code:
|
Re: Ham_item_deploy
If I try something like this I get the wrong combination of model with the weapon.
Code:
public class_models(plr) { |
Re: Ham_item_deploy
I'll just suggest untested method, because I haven't got time to test it, but decided to share it. Any modifications will be done later, I just want to show the idea. You may use an enum and a const to loop and register the weapons by their "weapon_" name, then to set the model for each weapon by the const and a loop.
PHP Code:
|
Re: Ham_item_deploy
I see what you guys are doing, but wouldn't be easier to use curweapon event instead of registering too many stuff?
Edit* just a thought PHP Code:
|
Re: Ham_item_deploy
Edited and tested the code, no mistakes spoken. Take a look.
|
Re: Ham_item_deploy
@Flick3rR, maybe you can register post to avoid task
PHP Code:
PHP Code:
|
Re: Ham_item_deploy
Tried with post, you know... No difference suspected :D
|
Re: Ham_item_deploy
My current "Curweapon" function looks like the following. When I asked how I could optimize it I were told to use Ham_item_deploy. I've tried some methods but failed with it.
Code:
public CurWeapon(id) { |
Re: Ham_item_deploy
Have you tried the edited version?
And also, for last - you want CurWeapon or Ham_Item_Deply, or you are asking which way is better? |
| All times are GMT -4. The time now is 09:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.