generated from ClaudiuHKS/AdvancedQuakeSounds
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
sv_full_alltalk_force_value.sp
119 lines (88 loc) · 2.41 KB
/
sv_full_alltalk_force_value.sp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
* MAIN REQUIREMENTS
*/
#include <sourcemod>
#include <sdktools>
/**
* CUSTOM DEFINITIONS TO BE EDITED
*/
#define _SV_FULL_ALLTALK_ (1) // sv_full_alltalk
/**
* CUSTOM INFORMATION
*/
public Plugin myinfo =
{
name = "'sv_full_alltalk' Force Value",
author = "CARAMEL® HACK",
description = "Forces A 'sv_full_alltalk' Value",
version = __DATE__,
url = "https://hattrick.go.ro/",
};
/**
* GLOBAL VARIABLES
*/
static Handle g_hSvFullAllTalk = INVALID_HANDLE;
static bool g_bAllTalkConVarChangeHooked = false;
/**
* CUSTOM PUBLIC FORWARDS
*/
public void OnPluginStart()
{
OnMapStart();
}
public void OnMapStart()
{
static char szBuffer[PLATFORM_MAX_PATH] = { 0, ... };
if (g_hSvFullAllTalk == INVALID_HANDLE)
{
g_hSvFullAllTalk = FindConVar("sv_full_alltalk");
}
if (g_hSvFullAllTalk != INVALID_HANDLE)
{
if (GetConVarInt(g_hSvFullAllTalk) != _SV_FULL_ALLTALK_)
{
IntToString(_SV_FULL_ALLTALK_, szBuffer, sizeof (szBuffer));
SetConVarString(g_hSvFullAllTalk, szBuffer, true, true);
}
if (!g_bAllTalkConVarChangeHooked)
{
HookConVarChange(g_hSvFullAllTalk, _Con_Var_Change_);
g_bAllTalkConVarChangeHooked = true;
}
if (GetConVarInt(g_hSvFullAllTalk) != _SV_FULL_ALLTALK_)
{
IntToString(_SV_FULL_ALLTALK_, szBuffer, sizeof (szBuffer));
SetConVarString(g_hSvFullAllTalk, szBuffer, true, true);
}
}
}
public void OnMapEnd()
{
if (g_hSvFullAllTalk != INVALID_HANDLE)
{
if (g_bAllTalkConVarChangeHooked)
{
UnhookConVarChange(g_hSvFullAllTalk, _Con_Var_Change_);
g_bAllTalkConVarChangeHooked = false;
}
}
}
public void OnPluginEnd()
{
OnMapEnd();
}
/**
* CUSTOM PUBLIC HANDLERS
*/
public void _Con_Var_Change_(Handle hConVar, const char[] szOld, const char[] szNew)
{
static char szBuffer[PLATFORM_MAX_PATH] = { 0, ... };
if (hConVar == g_hSvFullAllTalk)
{
if (StringToInt(szNew) != _SV_FULL_ALLTALK_)
{
IntToString(_SV_FULL_ALLTALK_, szBuffer, sizeof (szBuffer));
SetConVarString(hConVar, szBuffer, true, true);
}
}
}