View Single Post
TheVaskov
Member
Join Date: Sep 2021
Location: Russia
Old 10-15-2021 , 05:05   Re: WeaponMod 1.0 Omega
Reply With Quote #139

Weaponmod 1.2a by Devcones try to set on
Day of Defeat (steam)


Slot fix
Now your weapon is on Primary slot (not knife, not pistol but you can made it)
Problmes:
  • You must have donor weapon in your inventory
  • Clip and ammo affect on Ammo hud Fix
  • p_model can't be from base ID , it crushes server
  • another p_model players will see in your arms when you drop Custom weapon
  • If WEAPON_INDEX == WEAPON COMMAND you can use 2 primary weapons and choose in game
  • I don't know how it works in CStrike , but there is no player animation.
  • Players run wit rifles but not using reload sequence or shoot , and there is not shooting lights
Instruction:
Open
"wpn_gameinfo_dod.sma"
Read comments from my code
Find and replace part of code
Code:
// GameInfos
#define MAX_WEAPONS		2	// Amount of weapons that should be replaced
new const WEAPON_INDEX[MAX_WEAPONS] = {10, 5}			// Weapon Index of the weapon that should be replaced = BASE for Cutom weapon
new const Float:WEAPON_RUN_SPEED[MAX_WEAPONS] = {600.0, 600.0}		// Run speed of the replaced weapon
new const WEAPON_COMMAND[MAX_WEAPONS][] = {"weapon_luger", "weapon_amerknife"}	// Command to take the weapon IF YOU DONT HAVE BASE ID WPN
new const WEAPON_V_MODEL[MAX_WEAPONS][] = {"models/v_98k.mdl", "models/v_garand.mdl"}		// v_model after you drop Custom weapon
new const WEAPON_P_MODEL[MAX_WEAPONS][] = {"models/p_luger.mdl", "models/p_colt.mdl"}		// p_model after dropped Custom weapon
Decals need to customize for using DODdecals shots and etc...


Ammo hud fix
This is not true fix:
  • It makes clip ammo digits near the clip hud sprite (left down corner or custom place) like 13/90 or 5/40 ... etc...
  • You can choose standart sprite icon of clip (ammo)
  • Sprite images shows count clip of weapon which you choose in WEAPON_INDEX[MAX_WEAPONS] = {10, 5}

    Instruction:
Open "wpn_gameinfo_dod.sma"
Find "// User Messages" make new stroke "new g_msgCurWeapon"
Find "public plugin_init()" in // User Messages , make new stroke "g_msgCurWeapon = get_user_msgid("CurWeapon")
Find function "public wpn_gi_update_ammo(id, wpnid, pAmmo, sAmmo)"
Remake to
Code:
public wpn_gi_update_ammo(id, wpnid, clip, ammo)
{	
	message_begin(MSG_ONE, g_msgCurWeapon, {0, 0, 0}, id)
	write_byte(1)
	write_byte(20)                                       // ID SPRITE GUN + CROSSHAIR   20 = m1carbine
        write_byte(clip)                                      // this must change spprites but it now works in DOD , that's why I use next 
	message_end()
	
	set_hudmessage(190, 255, 190, 0.9, 0.89, .effects= 1 , .holdtime= 3.0)                            // color,position, time
	show_hudmessage(0, "%d / %d ", clip, ammo)                                    // contained info  %d digits clip , digits ammo 
}
It works for all weapons, If you want custom hud sprite for every weapon, in
"wpn_yourweapon.sma" make this function and customize it.

Draft Test Weapon USSR SVT40 with Half Life scope FOV 65 in attachments
based on abakan\m4a1 weapon which I found in weaponmod topic
You must create some models and sounds , which I type in .sma

________
So If you know
how activate hud update for CurWeapon
how send player animation or player event in plugin for activate animation and shoot lights
how or something usefull please wellcome.
Attached Thumbnails
Click image for larger version

Name:	2021-10-15_11-59-00.png
Views:	80
Size:	38.8 KB
ID:	191859  
Attached Files
File Type: sma Get Plugin or Get Source (wpn_gameinfo_dod.sma - 118 views - 9.7 KB)
File Type: sma Get Plugin or Get Source (wpn_dod_svt38.sma - 113 views - 22.9 KB)
TheVaskov is offline