Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 0e8613b

Browse files
authored
1.0.9
1 parent 5b09a65 commit 0e8613b

File tree

1 file changed

+140
-3
lines changed

1 file changed

+140
-3
lines changed

addons/sourcemod/scripting/Game_Manager.sp

Lines changed: 140 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
#define TEAM_SPEC 1
1414
#define TEAM_T 2
1515
#define TEAM_CT 3
16-
#define HIDEHUD_CHAT ( 1<<7 )
16+
#define HIDEHUD_CHAT ( 1<<7 )
1717

1818
ConVar g_enable;
1919
ConVar g_knifesound;
2020
ConVar g_hurtound;
2121
ConVar g_shieldsound;
22+
ConVar g_deathsound;
2223
ConVar g_balance;
2324
ConVar g_msgsshorthanded;
2425
ConVar g_radar;
@@ -60,6 +61,14 @@ ConVar g_ConVarEnable;
6061
ConVar g_ConVarMethod;
6162
ConVar g_ConVarDelay;
6263
ConVar g_ConVarHibernate;
64+
ConVar gcv_force = null;
65+
ConVar gcv_force2 = null;
66+
ConVar gcv_force3 = null;
67+
ConVar gcv_force4 = null;
68+
ConVar gcv_force5 = null;
69+
ConVar gcv_force6 = null;
70+
ConVar gcv_force7 = null;
71+
ConVar gcv_force8 = null;
6372

6473
int g_MapPos;
6574
int g_MapListSerial;
@@ -125,6 +134,7 @@ bool g_bblockroundendsound = false;
125134
bool g_bblockroundendpanel = false;
126135
bool g_bblockradiostartround = false;
127136
bool g_bblockfalldamage = false;
137+
bool g_bdeathsound = false;
128138

129139
float g_ListX;
130140
float g_ListY;
@@ -235,7 +245,7 @@ public Plugin myinfo =
235245
name = "[CS:GO] Game Manager",
236246
author = "Gold_KingZ",
237247
description = "Game Manager ( Hide radar, money, messages, ping, and more )",
238-
version = "1.0.8",
248+
version = "1.0.9",
239249
url = "https://steamcommunity.com/id/oQYh"
240250
}
241251

@@ -291,6 +301,7 @@ public void OnPluginStart()
291301
g_knifesound = CreateConVar("gm_block_knife_sound", "0", "Block Knife Damage Sounds (Need To Enable gm_enable_hide_and_block) || 1= Yes || 0= No", _, true, 0.0, true, 1.0);
292302
g_hurtound = CreateConVar("gm_block_hurthealth_sound", "0", "Block Hurt Health Damage Sound (Need To Enable gm_enable_hide_and_block) || 1= Yes || 0= No", _, true, 0.0, true, 1.0);
293303
g_shieldsound = CreateConVar("gm_block_hurtshield_sound", "0", "Block Hurt Shield Damage Sound (Need To Enable gm_enable_hide_and_block) || 1= Yes || 0= No", _, true, 0.0, true, 1.0);
304+
g_deathsound = CreateConVar("gm_block_death_sound", "0", "Block Death Sound (Need To Enable gm_enable_hide_and_block) || 1= Yes || 0= No", _, true, 0.0, true, 1.0);
294305
Cvar_ListX = CreateConVar("gm_hud_xaxis" , "0.00", "X-Axis Location From 0 To 1.0 Check https://github.com/oqyh/Game-Manager/blob/main/images/hud%20postions.png For Help");
295306
Cvar_ListY = CreateConVar("gm_hud_yaxis" , "0.35", "Y-Axis Location From 0 To 1.0 Check https://github.com/oqyh/Game-Manager/blob/main/images/hud%20postions.png For Help");
296307
Cvar_ListColor = CreateConVar("gm_hud_colors" , "255 0 189 0.8", "Hud color. [R G B A] Pick Colors https://rgbacolorpicker.com/");
@@ -345,6 +356,7 @@ public void OnPluginStart()
345356
HookConVarChange(g_knifesound, OnSettingsChanged);
346357
HookConVarChange(g_hurtound, OnSettingsChanged);
347358
HookConVarChange(g_shieldsound, OnSettingsChanged);
359+
HookConVarChange(g_deathsound, OnSettingsChanged);
348360
HookConVarChange(g_msgsshorthanded, OnSettingsChanged);
349361
HookConVarChange(g_radar, OnSettingsChanged);
350362
HookConVarChange(g_balance, OnSettingsChanged);
@@ -391,10 +403,30 @@ public void OnPluginStart()
391403
AddNormalSoundHook(Call_Back_Soundss);
392404
AddNormalSoundHook(Call_Back_Soundsss);
393405
AddNormalSoundHook(Call_Back_NadeSounds);
406+
AddNormalSoundHook(Call_Back_DeathSound);
394407

395408
g_eenable = GetConVarBool(g_enable);
396409
HookConVarChange(g_enable, CvarChanged);
397410

411+
gcv_force = FindConVar("sv_disable_radar");
412+
gcv_force.AddChangeHook(Onchanged);
413+
414+
gcv_force2 = FindConVar("mp_playercashawards");
415+
gcv_force2.AddChangeHook(Onchanged2);
416+
gcv_force3 = FindConVar("mp_teamcashawards");
417+
gcv_force3.AddChangeHook(Onchanged2);
418+
419+
gcv_force4 = FindConVar("cash_team_bonus_shorthanded");
420+
gcv_force4.AddChangeHook(Onchanged3);
421+
422+
gcv_force5 = FindConVar("sv_falldamage_scale");
423+
gcv_force5.AddChangeHook(Onchanged4);
424+
gcv_force6 = FindConVar("sv_min_jump_landing_sound");
425+
gcv_force6.AddChangeHook(Onchanged5);
426+
gcv_force7 = FindConVar("sv_footsteps");
427+
gcv_force7.AddChangeHook(Onchanged6);
428+
gcv_force8 = FindConVar("sv_mute_players_with_social_penalties");
429+
gcv_force8.AddChangeHook(Onchanged7);
398430

399431
g_botQuota = GetConVarInt(g_Cvar_BotQuota);
400432
HookConVarChange(g_Cvar_BotQuota, CvarChanged);
@@ -441,6 +473,95 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
441473
return APLRes_Success;
442474
}
443475

476+
public void Onchanged(ConVar convar, const char[] oldValue, const char[] newValue)
477+
{
478+
if( g_benable == true)
479+
{
480+
if(g_bradar == true)
481+
{
482+
if (StringToInt(newValue) != 1) {
483+
gcv_force.IntValue = 1;
484+
}
485+
}
486+
}
487+
}
488+
public void Onchanged2(ConVar convar, const char[] oldValue, const char[] newValue)
489+
{
490+
if( g_benable == true)
491+
{
492+
if(g_bmoneyhud == true)
493+
{
494+
if (StringToInt(newValue) != 0) {
495+
gcv_force2.IntValue = 0;
496+
}
497+
498+
if (StringToInt(newValue) != 0) {
499+
gcv_force3.IntValue = 0;
500+
}
501+
}
502+
}
503+
}
504+
505+
public void Onchanged3(ConVar convar, const char[] oldValue, const char[] newValue)
506+
{
507+
if( g_benable == true)
508+
{
509+
if (g_msgsshorthanded.IntValue == 1)
510+
{
511+
if (StringToInt(newValue) != 0) {
512+
gcv_force4.IntValue = 0;
513+
}
514+
}
515+
}
516+
}
517+
public void Onchanged4(ConVar convar, const char[] oldValue, const char[] newValue)
518+
{
519+
if( g_benable == true)
520+
{
521+
if( g_bblockfalldamage == true)
522+
{
523+
if (StringToInt(newValue) != 0) {
524+
gcv_force5.IntValue = 0;
525+
}
526+
}
527+
}
528+
}
529+
public void Onchanged5(ConVar convar, const char[] oldValue, const char[] newValue)
530+
{
531+
if( g_benable == true)
532+
{
533+
if( g_bblockjumpland == true)
534+
{
535+
if (StringToInt(newValue) != 999999) {
536+
gcv_force6.IntValue = 999999;
537+
}
538+
}
539+
}
540+
}
541+
public void Onchanged6(ConVar convar, const char[] oldValue, const char[] newValue)
542+
{
543+
if( g_benable == true)
544+
{
545+
if( g_bblockfootsteps == true)
546+
{
547+
if (StringToInt(newValue) != 0) {
548+
gcv_force7.IntValue = 0;
549+
}
550+
}
551+
}
552+
}
553+
public void Onchanged7(ConVar convar, const char[] oldValue, const char[] newValue)
554+
{
555+
if( g_benable == true)
556+
{
557+
if( g_bblockautomute == true)
558+
{
559+
if (StringToInt(newValue) != 0) {
560+
gcv_force8.IntValue = 0;
561+
}
562+
}
563+
}
564+
}
444565

445566
public int OnSettingsChanged(Handle convar, const char[] oldValue, const char[] newValue)
446567
{
@@ -489,6 +610,10 @@ public int OnSettingsChanged(Handle convar, const char[] oldValue, const char[]
489610
g_bshieldsound = g_shieldsound.BoolValue;
490611
}
491612

613+
if(convar == g_deathsound)
614+
{
615+
g_bdeathsound = g_deathsound.BoolValue;
616+
}
492617
if(convar == g_blockradioagent)
493618
{
494619
g_bblockradioagent = g_blockradioagent.BoolValue;
@@ -654,6 +779,7 @@ public void OnConfigsExecuted()
654779
g_bknifesound = GetConVarBool(g_knifesound);
655780
g_bhurtound = GetConVarBool(g_hurtound);
656781
g_bshieldsound = GetConVarBool(g_shieldsound);
782+
g_bdeathsound = GetConVarBool(g_deathsound);
657783
g_bradar = GetConVarBool(g_radar);
658784
g_bbalance = GetConVarBool(g_balance);
659785
g_bmoneyhud = GetConVarBool(g_moneyhud);
@@ -907,7 +1033,18 @@ public Action Call_Back_NadeSounds(int clients[64], int &numClients, char sample
9071033
{
9081034
if (!g_benable || !g_bblockradionade) return Plugin_Continue;
9091035

910-
if (StrContains(sample, "_decoy") != -1 || StrContains(sample, "_grenade") != -1 || StrContains(sample, "_flashbang") != -1 || StrContains(sample, "_molotov") != -1 || StrContains(sample, "_smoke") != -1)
1036+
if (StrContains(sample, "ct_decoy") != -1 || StrContains(sample, "ct_grenade") != -1 || StrContains(sample, "ct_flashbang") != -1 || StrContains(sample, "ct_molotov") != -1 || StrContains(sample, "ct_smoke") != -1 || StrContains(sample, "t_decoy") != -1 || StrContains(sample, "t_grenade") != -1 || StrContains(sample, "t_flashbang") != -1 || StrContains(sample, "t_molotov") != -1 || StrContains(sample, "t_smoke") != -1)
1037+
{
1038+
return Plugin_Handled;
1039+
}
1040+
return Plugin_Continue;
1041+
}
1042+
1043+
public Action Call_Back_DeathSound(int clients[64], int &numClients, char sample[PLATFORM_MAX_PATH], int &client, int &channel, float &volume, int &level, int &pitch, int &flags)
1044+
{
1045+
if (!g_benable || !g_bdeathsound) return Plugin_Continue;
1046+
1047+
if (StrContains(sample, "death1") != -1 || StrContains(sample, "death2") != -1 || StrContains(sample, "death3") != -1 || StrContains(sample, "death4") != -1 || StrContains(sample, "death5") != -1 || StrContains(sample, "death6") != -1)
9111048
{
9121049
return Plugin_Handled;
9131050
}

0 commit comments

Comments
 (0)