generated from ClaudiuHKS/AdvancedQuakeSounds
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvote_restart_command.sp
103 lines (87 loc) · 2.41 KB
/
vote_restart_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
/**
* MAIN REQUIREMENTS
*/
#include <sourcemod>
#include <sdktools>
/**
* CUSTOM INFORMATION
*/
public Plugin myinfo =
{
name = "Vote Restart Command",
author = "CARAMEL® HACK",
description = "Provides Custom Command To Vote To Restart The Game In Progress",
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, "rr", false) == 0
||
strcmp(szArgs, "voterr", false) == 0
||
strcmp(szArgs, "voterestart", false) == 0
||
strcmp(szArgs, "votereset", false) == 0
||
strcmp(szArgs, "rgame", false) == 0
||
strcmp(szArgs, "restartgame", false) == 0
||
strcmp(szArgs, "!rr", false) == 0
||
strcmp(szArgs, "!voterr", false) == 0
||
strcmp(szArgs, "!voterestart", false) == 0
||
strcmp(szArgs, "!votereset", false) == 0
||
strcmp(szArgs, "!rgame", false) == 0
||
strcmp(szArgs, "!restartgame", false) == 0
||
strcmp(szArgs, "/rr", false) == 0
||
strcmp(szArgs, "/voterr", false) == 0
||
strcmp(szArgs, "/voterestart", false) == 0
||
strcmp(szArgs, "/votereset", false) == 0
||
strcmp(szArgs, "/rgame", false) == 0
||
strcmp(szArgs, "/restartgame", false) == 0
)
{
CreateTimer(0.000001, _Timer_Vote_Restart_Game_, GetClientUserId(nEntity), TIMER_FLAG_NO_MAPCHANGE);
}
}
/**
* CUSTOM PUBLIC HANDLERS
*/
public Action _Timer_Vote_Restart_Game_(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 RestartGame");
PrintToChat(nEntity, " \x01Done.");
}
}
return Plugin_Continue;
}