Description
The plugin changes the behavior of standard weapons. Not significantly, but based on catching standard functions, you can try and write unique behavior.
Functional
say mm to open custom weaponmenu list
Technical part
I’ll tell you a special case of conversion for only one weapon, expanding this to several weapons is a matter of processing an array, which is solved in this plugin.
We take the weapon entity index from the player's inventory.
And we’ll assign this specific index to private so that this particular class object differs from others according to our rules
PHP Code:
idx_wpn = get_pdata_cbase(id_owner, m_pActiveItem, linux_diff_player);
entity_set_int(idx_wpn, EV_INT_iuser4, custom_idx )
Now, when we catch the primary fire event, we will check for the presence of a special index on the class object, and if it is there, then this is a special weapon, to which we assign special behavior, assign a v_model and p_model, sounds and HUD.
If you throw a weapon out of your hands, then a special w_model will be assigned to it, and if someone picks up this weapon, then it is he who picks up the special weapon.
ini-file
PHP Code:
; CODE weapon_reference weapon_newname f_damagemultipier f_fire1rate f_fire2rate f_reloadtime maxcxlip maxammo hud_clip hud_ammo soundfire1 soundfire2 v_model p_model w_model v_subnum p_submodelnum w_submodel num
1 weapon_colt 273 weapon_tt33 0.1 0.15 2.0 5.0 3 11 28 4 "" "" "models/v_colt.mdl" "models/p_colt.mdl" "models/w_colt.mdl" 0 0 0 0
Youtube demo video
Issue
1. At the moment a weapon is fired, a special sound is heard on the surface of a standard weapon, and sometimes with a delay.
2. To imitate a shotgun, we need to parse the decal index from one bullet, and after multiple tracing, assign them, this function has not yet been fully implemented