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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
/*
gokz-jumpbeam Plugin Include
Website: https://bitbucket.org/kztimerglobalteam/gokz
*/
#if defined _gokz_jumpbeam_included_
#endinput
#endif
#define _gokz_jumpbeam_included_
// =====[ ENUMS ]=====
enum JBOption:
{
JBOPTION_INVALID = -1,
JBOption_Type,
JBOPTION_COUNT
};
enum
{
JBType_Disabled = 0,
JBType_Feet,
JBType_Head,
JBType_FeetAndHead,
JBType_Ground,
JBTYPE_COUNT
};
// =====[ CONSTANTS ]=====
#define JB_BEAM_LIFETIME 4.0
stock char gC_JBOptionNames[JBOPTION_COUNT][] =
{
"GOKZ JB - Jump Beam Type"
};
stock char gC_JBOptionDescriptions[JBOPTION_COUNT][] =
{
"Jump Beam Type - 0 = Disabled, 1 = Feet, 2 = Head, 3 = Feet & Head, 4 = Ground"
};
stock int gI_JBOptionDefaultValues[JBOPTION_COUNT] =
{
JBType_Disabled
};
stock int gI_JBOptionCounts[JBOPTION_COUNT] =
{
JBTYPE_COUNT
};
stock char gC_JBOptionPhrases[JBOPTION_COUNT][] =
{
"Options Menu - Jump Beam"
};
stock char gC_JBTypePhrases[JBTYPE_COUNT][] =
{
"Options Menu - Disabled",
"Options Menu - Feet",
"Options Menu - Head",
"Options Menu - Feet and Head",
"Options Menu - Ground"
};
// =====[ STOCKS ]=====
/**
* Returns whether an option is a gokz-jumpbeam option.
*
* @param option Option name.
* @param optionEnum Variable to store enumerated gokz-jumpbeam option (if it is one).
* @return Whether option is a gokz-jumpbeam option.
*/
stock bool GOKZ_JB_IsJBOption(const char[] option, JBOption &optionEnum = JBOPTION_INVALID)
{
for (JBOption i; i < JBOPTION_COUNT; i++)
{
if (StrEqual(option, gC_JBOptionNames[i]))
{
optionEnum = i;
return true;
}
}
return false;
}
/**
* Gets the current value of a player's gokz-jumpbeam option.
*
* @param client Client index.
* @param option gokz-jumpbeam option.
* @return Current value of option.
*/
stock any GOKZ_JB_GetOption(int client, JBOption option)
{
return GOKZ_GetOption(client, gC_JBOptionNames[option]);
}
/**
* Sets a player's gokz-jumpbeam option's value.
*
* @param client Client index.
* @param option gokz-jumpbeam option.
* @param value New option value.
* @return Whether option was successfully set.
*/
stock bool GOKZ_JB_SetOption(int client, JBOption option, any value)
{
return GOKZ_SetOption(client, gC_JBOptionNames[option], value);
}
/**
* Increment an integer-type gokz-jumpbeam option's value.
* Loops back to '0' if max value is exceeded.
*
* @param client Client index.
* @param option gokz-jumpbeam option.
* @return Whether option was successfully set.
*/
stock bool GOKZ_JB_CycleOption(int client, JBOption option)
{
return GOKZ_CycleOption(client, gC_JBOptionNames[option]);
}
// =====[ DEPENDENCY ]=====
public SharedPlugin __pl_gokz_jumpbeam =
{
name = "gokz-jumpbeam",
file = "gokz-jumpbeam.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
|