diff options
| author | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
|---|---|---|
| committer | aura <nw@moneybot.cc> | 2026-02-17 23:42:09 +0100 |
| commit | 5e2eb7d67ae933b7566f1944d0bb7744da03d586 (patch) | |
| tree | 054acff1113270a9cd07933df760f3768c1b6853 /source/sourcemod/scripting/gokz-hud/hide_weapon.sp | |
| parent | 341db13a008dc12bb22ceb50452d93d01476308c (diff) | |
move source stuff to its own folder
Diffstat (limited to 'source/sourcemod/scripting/gokz-hud/hide_weapon.sp')
| -rw-r--r-- | source/sourcemod/scripting/gokz-hud/hide_weapon.sp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/sourcemod/scripting/gokz-hud/hide_weapon.sp b/source/sourcemod/scripting/gokz-hud/hide_weapon.sp new file mode 100644 index 0000000..b290d8f --- /dev/null +++ b/source/sourcemod/scripting/gokz-hud/hide_weapon.sp @@ -0,0 +1,30 @@ +/* + Hides weapon view model. +*/ + + + +// =====[ EVENTS ]===== + +void OnPlayerSpawn_HideWeapon(int client) +{ + UpdateHideWeapon(client); +} + +void OnOptionChanged_HideWeapon(int client, HUDOption option) +{ + if (option == HUDOption_ShowWeapon) + { + UpdateHideWeapon(client); + } +} + + + +// =====[ PRIVATE ]===== + +static void UpdateHideWeapon(int client) +{ + SetEntProp(client, Prop_Send, "m_bDrawViewmodel", + GOKZ_HUD_GetOption(client, HUDOption_ShowWeapon) == ShowWeapon_Enabled); +}
\ No newline at end of file |
