/
KZTimer.inc
75 lines (69 loc) · 2.42 KB
/
KZTimer.inc
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
#if defined _KZTimer_included
#endinput
#endif
#define _KZTimer_included
/* Natives */
native bool:KZTimer_GetTimerStatus(client); // returns (bool) timer status
native KZTimer_StopTimer(client); // stops the timer
native KZTimer_StopUpdatingOfClimbersMenu(client); // stops refreshing of the timer panel/menu
native KZTimer_EmulateStartButtonPress(client); // start button alternative
native KZTimer_EmulateStopButtonPress(client); // stop button alternative
native Float:KZTimer_GetCurrentTime(client); //returns (float) current run time
native Float:KZTimer_GetAvgTimeTp(); //avg tp time - returns (float) 0.0 if less than 5 map times (kztimer calculates the avg time on mapstart and if someone set a new time)
native Float:KZTimer_GetAvgTimePro(); //avg pro time - returns (float) 0.0 if less than 5 map times (kztimer calculates the avg time on mapstart and if someone set a new time)
native KZTimer_GetSkillGroup(client); // skill group - returns (int) 0=NORANK, 1=NEWB,2=SCRUB,..,9=PRO
//KZTimer_GetSkillGroup can be helpful to set up a high ranked only server. This server has to share the database with your 'main' kztimer server
/**
* Called when the timer is started.
*
* @param client that starts the timer.
*
* @noreturn
*/
forward KZTimer_TimerStarted(client);
/**
* Called when the timer is stopped.
*
* @param client that stops the timer.
* @param teleports
* @param finish time
* @param server record(1 = true)
*
* @noreturn
*/
forward KZTimer_TimerStopped(client, teleports, Float:time, record);
/**
* Called when the timer is stopped.
*
* @note This is only called if the run is saved.
*
* @param client that stops the timer.
* @param teleports
* @param rank
* @param finish time
*
* @noreturn
*/
forward KZTimer_TimerStoppedValid(client, teleports, rank, Float:time);
public SharedPlugin:__pl_KZTimer =
{
name = "KZTimer",
file = "KZTimer.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
public __pl_KZTimer_SetNTVOptional()
{
MarkNativeAsOptional("KZTimer_GetTimerStatus");
MarkNativeAsOptional("KZTimer_StopTimer");
MarkNativeAsOptional("KZTimer_StopUpdatingOfClimbersMenu");
MarkNativeAsOptional("KZTimer_EmulateStartButtonPress");
MarkNativeAsOptional("KZTimer_EmulateStopButtonPress");
MarkNativeAsOptional("KZTimer_GetCurrentTime");
MarkNativeAsOptional("KZTimer_GetAvgTimeTp");
MarkNativeAsOptional("KZTimer_GetAvgTimePro");
MarkNativeAsOptional("KZTimer_GetSkillGroup");
}