This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[DOD] Weaponmod ini


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 05-13-2024 , 14:56   [DOD] Weaponmod ini
Reply With Quote #1

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_ownerm_pActiveItemlinux_diff_player);
entity_set_int(idx_wpnEV_INT_iuser4custom_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
Attached Files
File Type: sma Get Plugin or Get Source (dod_weaponmod_ini.sma - 16 views - 37.0 KB)
File Type: ini w_weapons.ini (1.0 KB, 16 views)
__________________

Last edited by TheVaskov; 05-14-2024 at 04:00.
TheVaskov is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode