From 5e2eb7d67ae933b7566f1944d0bb7744da03d586 Mon Sep 17 00:00:00 2001 From: aura Date: Tue, 17 Feb 2026 23:42:09 +0100 Subject: move source stuff to its own folder --- .../sourcemod/scripting/gokz-quiet/soundscape.sp | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 source/sourcemod/scripting/gokz-quiet/soundscape.sp (limited to 'source/sourcemod/scripting/gokz-quiet/soundscape.sp') diff --git a/source/sourcemod/scripting/gokz-quiet/soundscape.sp b/source/sourcemod/scripting/gokz-quiet/soundscape.sp new file mode 100644 index 0000000..f320ad3 --- /dev/null +++ b/source/sourcemod/scripting/gokz-quiet/soundscape.sp @@ -0,0 +1,30 @@ +/* + Toggle soundscapes. +*/ + +static int currentSoundscapeIndex[MAXPLAYERS + 1] = {BLANK_SOUNDSCAPEINDEX, ...}; + +void EnableSoundscape(int client) +{ + if (currentSoundscapeIndex[client] != BLANK_SOUNDSCAPEINDEX) + { + SetEntProp(client, Prop_Data, "soundscapeIndex", currentSoundscapeIndex[client]); + } +} + +void OnPlayerRunCmdPost_Soundscape(int client) +{ + int soundscapeIndex = GetEntProp(client, Prop_Data, "soundscapeIndex"); + if (GOKZ_GetOption(client, gC_QTOptionNames[QTOption_Soundscapes]) == Soundscapes_Disabled) + { + if (soundscapeIndex != BLANK_SOUNDSCAPEINDEX) + { + currentSoundscapeIndex[client] = soundscapeIndex; + } + SetEntProp(client, Prop_Data, "soundscapeIndex", BLANK_SOUNDSCAPEINDEX); + } + else + { + currentSoundscapeIndex[client] = soundscapeIndex; + } +} \ No newline at end of file -- cgit v1.2.3