generated from ClaudiuHKS/AdvancedQuakeSounds
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvote_map_command.sp
109 lines (93 loc) · 2.55 KB
/
vote_map_command.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
/**
* MAIN REQUIREMENTS
*/
#include <sourcemod>
#include <sdktools>
/**
* CUSTOM INFORMATION
*/
public Plugin myinfo =
{
name = "Vote Map Command",
author = "CARAMEL® HACK",
description = "Provides Custom Command To Vote To Change The Map",
version = __DATE__,
url = "https://hattrick.go.ro/",
};
/**
* CUSTOM PUBLIC FORWARDS
*/
public void OnClientSayCommand_Post(int nEntity, const char[] szCmd, const char[] szArgs)
{
if (!IsClientConnected(nEntity) || !IsClientInGame(nEntity))
{
return;
}
if
(
strcmp(szArgs, "map", false) == 0
||
strcmp(szArgs, "votemap", false) == 0
||
strcmp(szArgs, "changemap", false) == 0
||
strcmp(szArgs, "level", false) == 0
||
strcmp(szArgs, "vote", false) == 0
||
strcmp(szArgs, "votelevel", false) == 0
||
strcmp(szArgs, "changelevel", false) == 0
||
strcmp(szArgs, "!map", false) == 0
||
strcmp(szArgs, "!votemap", false) == 0
||
strcmp(szArgs, "!changemap", false) == 0
||
strcmp(szArgs, "!level", false) == 0
||
strcmp(szArgs, "!vote", false) == 0
||
strcmp(szArgs, "!votelevel", false) == 0
||
strcmp(szArgs, "!changelevel", false) == 0
||
strcmp(szArgs, "/map", false) == 0
||
strcmp(szArgs, "/votemap", false) == 0
||
strcmp(szArgs, "/changemap", false) == 0
||
strcmp(szArgs, "/level", false) == 0
||
strcmp(szArgs, "/vote", false) == 0
||
strcmp(szArgs, "/votelevel", false) == 0
||
strcmp(szArgs, "/changelevel", false) == 0
)
{
CreateTimer(0.000001, _Timer_Vote_Change_Map_, GetClientUserId(nEntity), TIMER_FLAG_NO_MAPCHANGE);
}
}
/**
* CUSTOM PUBLIC HANDLERS
*/
public Action _Timer_Vote_Change_Map_(Handle hTimer, any nId)
{
static int nEntity = 0;
if ((nEntity = GetClientOfUserId(nId)) > 0 && IsClientConnected(nEntity) && IsClientInGame(nEntity))
{
if (GameRules_GetProp("m_bWarmupPeriod"))
{
PrintToChat(nEntity, " \x01Try again\x0B later\x01.");
}
else
{
FakeClientCommandEx(nEntity, "callvote");
PrintToChat(nEntity, " \x01Done.");
}
}
return Plugin_Continue;
}