forked from atrX/CoD4-Surf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSCRIPTDOC.txt
271 lines (237 loc) · 5.89 KB
/
SCRIPTDOC.txt
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
/**
* CoD4 Surf Mod
* Script Documentation
*
* This file includes:
* - functions
* - descriptions
* - module info
* - usage examples
* - parameters
* - return values
*
* If a version number is specified this means the functionality was added in
* said version of the Surf Mod, any previous versions will crash if you
* attempt to make use of this functionality
*/
// Mod functions
/**
* Description: checks if a player is on a surf ramp
* Module: _surf
* Usage: self isOnRamp()
* @return {Boolean}
*/
isOnRamp()
/**
* Description: checks if a player is on a surf located to his left
* Module: _surf
* Usage: self isOnRampLeft()
* @return {Boolean}
*/
isOnRampLeft()
/**
* Description: checks if a player is on a surf located to his right
* Module: _surf
* Usage: self isOnRampRight()
* @return {Boolean}
*/
isOnRampRight()
/**
* Description: checks if a player is in a zone with a maximum bhop speed of 300
* Module: _bunnyhop
* Usage: self inNoHopZone()
* @return {Boolean}
*/
inNoHopZone()
/**
* Description: spawn a credits hud element
* Module: _util
* Usage: credits( myArray )
* @param {Array} lines Array of strings containing individual credit lines
*/
credits( lines )
/**
* Description: add a new value to an array
* Module: _util
* Usage: array = addToArray( array, "world" )
* @param {Array} arr Any array
* @param {Array} value New value to insert
* @return {Array} New array
*/
addToArray( arr, value )
/**
* Description: checks if a variable is an array
* Module: _util
* Usage: isArray( var )
* @param {Any} var Any variable
* @return {Boolean}
*/
isArray( var )
/**
* Description: strips all color from a string
* Module: _util
* Usage: name = stripColor( name )
* @param {String} str Any string
* @return {String} Input string stripped from color
*/
stripColor( str )
/**
* Description: converts a timestamp in milliseconds to a formatted string
* Module: _util
* Usage: timeString = toTime( timestamp )
* @param {Int} msTime Timestamp in milliseconds
* @return {String} Formatted time string
*/
toTime( msTime )
/**
* Description: gets a player's current speed
* Version: 1.0.1
* Module: _util
* Usage: speed = self getPlayerSpeed()
* @return {Int} Player's speed
*/
getPlayerSpeed()
/**
* Description: set a player's speed
* Version: 1.0.2
* Module: _util
* Usage: self setPlayerSpeed( speed )
* @param {Int} speed New speed
*/
setPlayerSpeed( speed )
/**
* Description: set a player's speed by a multiplier
* Version: 1.0.2
* Module: _util
* Usage: self scalePlayerSpeed( speedScale )
* @param {Float} speedScale Multiplier for scaling of speed
*/
scalePlayerSpeed( speedScale )
/**
* Description: respawns a player
* Module: _mod
* Usage: self respawn()
*/
respawn()
/**
* Description: creates a teleporter out of a trigger
* Module: _mod
* Usage: trigger thread teleporter()
*/
teleporter()
/**
* Description: creates a booster out of a trigger
* Module: _mod
* Usage: trigger thread booster()
*/
booster()
// Server functions
/**
* Description: checks if a player is pressing the forward key
* Usage: self forwardButtonPressed()
* @return {Boolean}
*/
forwardButtonPressed()
/**
* Description: checks if a player is pressing the backward key
* Usage: self backButtonPressed()
* @return {Boolean}
*/
backButtonPressed()
/**
* Description: checks if a player is pressing the left key
* Usage: self leftButtonPressed()
* @return {Boolean}
*/
leftButtonPressed()
/**
* Description: checks if a player is pressing the right key
* Usage: self rightButtonPressed()
* @return {Boolean}
*/
rightButtonPressed()
/**
* Description: checks if a player is pressing the jump key
* Usage: self jumpButtonPressed()
* @return {Boolean}
*/
jumpButtonPressed()
/**
* Description: checks if a player is pressing the reload key
* Usage: self reloadButtonPressed()
* @return {Boolean}
*/
reloadButtonPressed()
/**
* Description: checks if a player is pressing the lean left key
* Usage: self leanLeftButtonPressed()
* @return {Boolean}
*/
leanLeftButtonPressed()
/**
* Description: checks if a player is pressing the lean right key
* Usage: self leanRightButtonPressed()
* @return {Boolean}
*/
leanRightButtonPressed()
/**
* Description: checks if a player is pressing the sprint key
* Usage: self sprintButtonPressed()
* @return {Boolean}
*/
sprintButtonPressed()
/**
* Description: checks if a player is pressing the key with the specified ID
* Usage: self isButtonPressed( 1024 )
* @param {Vec3} id Button ID
* @return {Boolean}
*
* List of known IDs:
* 2: sprint
* 32: reload
* 64: lean left
* 128: lean right
* 1024: jump
*/
isButtonPressed( id )
/**
* Description: sets a player's velocity
* Usage: self setVelocity( ( 0, 0, 0 ) )
* @param {Vec3} vec Vector 3D
*/
setVelocity( vec )
/**
* Description: scales a vector with a specified multiplier
* Usage: vec = vectorScale( ( 1, 1, 0 ), speed )
* @param {Vec3} vec Vector 3D
* @param {Float} scale Scale multiplier
* @return {Vec3} Scaled Vector 3D
*/
vectorScale( vec, scale )
/**
* Description: gets the entity number of the client who is being spectated
* Usage: self getSpectatedClient()
* @return {Int} Entity number
*/
getSpectatedClient()
/**
* Description: converts a string to a floating point number
* Usage: val = toFloat( "123" );
* @param {String} Input string
* @return {Float} Input converted to float
*/
toFloat( str )
/**
* Description: converts a string to upper case
* Usage: str = toUpper( str )
* @param {String} str Input string
* @return {String} Input string converted to upper case
*/
toUpper( str )
/**
* Description: converts a string to title case
* Usage: str = toTitle( str )
* @param {String} str Input string
* @return {String} Input string converted to title case
*/
toTitle( str )