generated from ClaudiuHKS/AdvancedQuakeSounds
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsm_exec_tick_cfg_command.sp
84 lines (60 loc) · 1.69 KB
/
sm_exec_tick_cfg_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
/**
* MAIN REQUIREMENTS
*/
#include <sourcemod>
/**
* CUSTOM DEFINITIONS TO BE EDITED
*/
#define _DESC_SM_EXEC_TICK_CFG_ "sm_exec_tick_cfg - Executes The Tick Based Config File"
#define _DESC_SM_EXEC_TICK_CFG_COL_ " \x01sm_exec_tick_cfg\x09 -\x05 Executes The Tick Based Config File"
/**
* CUSTOM INFORMATION
*/
public Plugin myinfo =
{
name = "SM Exec Tick CFG Command",
author = "CARAMEL® HACK",
description = "Provides The 'sm_exec_tick_cfg' Command",
version = __DATE__,
url = "https://hattrick.go.ro/",
};
/**
* CUSTOM PRIVATE FUNCTIONS
*/
static int _Get_Sv_Tick_Rate_()
{
return RoundToNearest(1.0 / GetTickInterval());
}
/**
* CUSTOM PUBLIC FORWARDS
*/
public void OnPluginStart()
{
RegAdminCmd("sm_exec_tick_cfg", _SM_Exec_Tick_Cfg_, ADMFLAG_CONFIG, _DESC_SM_EXEC_TICK_CFG_, "exec");
}
/**
* CUSTOM PUBLIC HANDLERS
*/
public Action _SM_Exec_Tick_Cfg_(int nClient, int nArgs)
{
static char szConfigFileName[PLATFORM_MAX_PATH] = { 0, ... };
if (nClient > 0 && (!IsClientConnected(nClient) || !IsClientInGame(nClient)))
{
return Plugin_Handled;
}
FormatEx(szConfigFileName, sizeof (szConfigFileName), "%d_tickrate.cfg", _Get_Sv_Tick_Rate_());
ServerCommand("exec %s", szConfigFileName);
switch (nClient)
{
case 0:
{
PrintToServer("Executed [ %s ]", szConfigFileName);
}
default:
{
PrintToConsole(nClient, "Executed [ %s ]", szConfigFileName);
PrintToChat(nClient, " \x09Executed\x0B [ %s ]", szConfigFileName);
}
}
return Plugin_Handled;
}