diff options
Diffstat (limited to 'sourcemod/scripting/gokz-hud/hide_weapon.sp')
| -rw-r--r-- | sourcemod/scripting/gokz-hud/hide_weapon.sp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sourcemod/scripting/gokz-hud/hide_weapon.sp b/sourcemod/scripting/gokz-hud/hide_weapon.sp new file mode 100644 index 0000000..b290d8f --- /dev/null +++ b/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 |
