SHOW:
|
|
- or go back to the newest paste.
1 | rtv_required = 0.5 | |
2 | rtv_timeout = -1 | |
3 | votekick_required = 0.7 | |
4 | spam_max = 5 | |
5 | spam_timeout = 60 | |
6 | ||
7 | script_check = 0 | |
8 | cur_players = 0 | |
9 | rtv_initiated = 0 | |
10 | votekick_allowed = true | |
11 | admin_table = {} | |
12 | users_table = {} | |
13 | mute_table = {} | |
14 | suspend_table = {} | |
15 | players = {} | |
16 | players2 = {} | |
17 | bos_table = {} | |
18 | boslog_table = {} | |
19 | access_table = {} | |
20 | rtv_table = {} | |
21 | votekick_table = {} | |
22 | votekicktimeout_table = {} | |
23 | spam_table = {} | |
24 | spamtimeout_table = {} | |
25 | ghost_table = {} | |
26 | time_passed = 0 -- Initialize time_passed to 0 seconds | |
27 | mode = {} | |
28 | objspawntype = {} | |
29 | objspawntag = {} | |
30 | ||
31 | vehicle_drone_table = {} | |
32 | -- create subtables | |
33 | for i=0,15 do | |
34 | vehicle_drone_table[i] = {} | |
35 | end | |
36 | ||
37 | Object_table = {} | |
38 | id = 0 | |
39 | message_table = {} | |
40 | Chat = 0 | |
41 | timer_started = 0 | |
42 | message_delay = 3 | |
43 | objects = {} | |
44 | ||
45 | -- Bipeds | |
46 | objects[1] = {"cyborg", "bipd", "characters\\cyborg_mp\\cyborg_mp"} | |
47 | ||
48 | -- Equipment | |
49 | objects[2] = {"camo", "eqip", "powerups\\active camouflage"} | |
50 | objects[3] = {"health", "eqip", "powerups\\health pack"} | |
51 | objects[4] = {"overshield", "eqip", "powerups\\over shield"} | |
52 | objects[5] = {"fnade", "eqip", "weapons\\frag grenade\\frag grenade"} | |
53 | objects[6] = {"pnade", "eqip", "weapons\\plasma grenade\\plasma grenade"} | |
54 | ||
55 | -- Vehicles | |
56 | objects[7] = {"shee", "vehi", "vehicles\\banshee\\banshee_mp"} | |
57 | objects[8] = {"turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp"} | |
58 | objects[9] = {"ghost", "vehi", "vehicles\\ghost\\ghost_mp"} | |
59 | objects[10] = {"rhog", "vehi", "vehicles\\rwarthog\\rwarthog"} | |
60 | objects[11] = {"tank", "vehi", "vehicles\\scorpion\\scorpion_mp"} | |
61 | objects[12] = {"hog", "vehi", "vehicles\\warthog\\mp_warthog"} | |
62 | ||
63 | -- Weapons | |
64 | objects[13] = {"rifle", "weap", "weapons\\assault rifle\\assault rifle"} | |
65 | objects[14] = {"ball", "weap", "weapons\\ball\\ball"} | |
66 | objects[15] = {"flag", "weap", "weapons\\flag\\flag"} | |
67 | objects[16] = {"flamethrower", "weap", "weapons\\flamethrower\\flamethrower"} | |
68 | objects[17] = {"needler", "weap", "weapons\\needler\\mp_needler"} | |
69 | objects[18] = {"pistol", "weap", "weapons\\pistol\\pistol"} | |
70 | objects[19] = {"ppistol", "weap", "weapons\\plasma pistol\\plasma pistol"} | |
71 | objects[20] = {"prifle", "weap", "weapons\\plasma rifle\\plasma rifle"} | |
72 | objects[21] = {"frg", "weap", "weapons\\plasma_cannon\\plasma_cannon"} | |
73 | objects[22] = {"rocket", "weap", "weapons\\rocket launcher\\rocket launcher"} | |
74 | objects[23] = {"shotgun", "weap", "weapons\\shotgun\\shotgun"} | |
75 | objects[24] = {"sniper", "weap", "weapons\\sniper rifle\\sniper rifle"} | |
76 | ||
77 | -- Projectiles | |
78 | objects[25] = {"sheebolt", "proj", "vehicles\\banshee\\banshee bolt"} | |
79 | objects[26] = {"sheerod", "proj", "vehicles\\banshee\\mp_banshee fuel rod"} | |
80 | objects[27] = {"turretbolt", "proj", "vehicles\\c gun turret\\mp gun turret"} | |
81 | objects[28] = {"ghostbolt", "proj", "vehicles\\ghost\\ghost bolt"} | |
82 | objects[29] = {"tankshot", "proj", "vehicles\\scorpion\\bullet"} | |
83 | objects[30] = {"tankshell", "proj", "vehicles\\scorpion\\tank shell"} | |
84 | objects[31] = {"hogshot", "proj", "vehicles\\warthog\\bullet"} | |
85 | objects[32] = {"rifleshot", "proj", "weapons\\assault rifle\\bullet"} | |
86 | objects[33] = {"flame", "proj", "weapons\\flamethrower\\flame"} | |
87 | objects[34] = {"fnadeproj", "proj", "weapons\\frag grenade\\frag grenade"} | |
88 | objects[35] = {"needlershot", "proj", "weapons\\needler\\mp_needle"} | |
89 | objects[36] = {"pistolshot", "proj", "weapons\\pistol\\bullet"} | |
90 | objects[37] = {"pnadeproj", "proj", "weapons\\plasma grenade\\plasma grenade"} | |
91 | objects[38] = {"ppistolbolt", "proj", "weapons\\plasma pistol\\bolt"} | |
92 | objects[39] = {"priflebolt", "proj", "weapons\\plasma rifle\\bolt"} | |
93 | objects[40] = {"priflecbolt", "proj", "weapons\\plasma rifle\\charged bolt"} | |
94 | objects[41] = {"rocketproj", "proj", "weapons\\rocket launcher\\rocket"} | |
95 | objects[42] = {"shottyshot", "proj", "weapons\\shotgun\\pellet"} | |
96 | objects[43] = {"snipershot", "proj", "weapons\\sniper rifle\\sniper bullet"} | |
97 | ||
98 | commands_table = { | |
99 | "/a", | |
100 | "/afk", | |
101 | "/ammo", | |
102 | "/b", | |
103 | "/deathless", | |
104 | "/e", | |
105 | "/eject", | |
106 | "/enter", | |
107 | "/getloc", | |
108 | "/godmode", | |
109 | "/hax", | |
110 | "/heal", | |
111 | "/help", | |
112 | "/hitler", | |
113 | "/infammo", | |
114 | "/give", | |
115 | "/gethash", | |
116 | "/ghost", | |
117 | "/invis", | |
118 | "/info", | |
119 | "/j", | |
120 | "/k", | |
121 | "/kill", | |
122 | "/lo3", | |
123 | "/m", | |
124 | "/mc", | |
125 | "/mnext", | |
126 | "/mute", | |
127 | "/noweapons", | |
128 | "/pass", | |
129 | "/pl", | |
130 | "/reset", | |
131 | "/resp", | |
132 | "/revoke", | |
133 | "/say", | |
134 | "/setassists", | |
135 | "/setdeaths", | |
136 | "/setfrags", | |
137 | "/setkills", | |
138 | "/setmode", | |
139 | "/setname", | |
140 | "/setresp", | |
141 | "/setplasmas", | |
142 | "/spd", | |
143 | "/spawn", | |
144 | "/st", | |
145 | "/suspend", | |
146 | "/td", | |
147 | "/test", | |
148 | "/timelimit", | |
149 | "/tp", | |
150 | "/ts", | |
151 | "/unghost", | |
152 | "/ungod", | |
153 | "/unhax", | |
154 | "/uninvis", | |
155 | "/unmute", | |
156 | "/unsuspend", | |
157 | } | |
158 | ||
159 | function GetRequiredVersion() | |
160 | return 10057 | |
161 | end | |
162 | ||
163 | function OnScriptLoad(process) | |
164 | ||
165 | if script_check == 0 then | |
166 | ||
167 | spamtimer = registertimer(970, "SpamTimer") | |
168 | maintimer = registertimer(10, "MainTimer") | |
169 | ||
170 | for i = 0,15 do | |
171 | cleanupdrones(i) | |
172 | end | |
173 | ||
174 | profilepath = getprofilepath() | |
175 | ||
176 | for i=0,15 do | |
177 | if gethash(i) ~= nil then | |
178 | cur_players = cur_players + 1 | |
179 | end | |
180 | end | |
181 | ||
182 | local file = io.open(string.format("%s\\admin.txt", profilepath), "r") | |
183 | if (file ~= nil) then | |
184 | for line in file:lines() do | |
185 | local words = {} | |
186 | for word in line:gmatch("[^%,]+") do | |
187 | table.insert(words, word) | |
188 | end | |
189 | admin_table[words[2]] = words[3] | |
190 | end | |
191 | file:close() | |
192 | end | |
193 | ||
194 | local file = io.open(string.format("%s\\access.ini", profilepath), "r") | |
195 | ||
196 | if (file ~= nil) then | |
197 | ||
198 | local i = 0 | |
199 | ||
200 | for line in file:lines() do | |
201 | for word in line:gmatch("[^%[%-%d%]]+") do | |
202 | ||
203 | word = word:gsub("data=", "") | |
204 | ||
205 | if word == "" then | |
206 | access_table[i] = -1 | |
207 | else | |
208 | access_table[i] = word | |
209 | end | |
210 | ||
211 | i = i + 1 | |
212 | ||
213 | end | |
214 | end | |
215 | ||
216 | file:close() | |
217 | ||
218 | end | |
219 | ||
220 | local file = io.open(string.format("%s\\files\\rtv.txt", profilepath), "r") | |
221 | ||
222 | if (file ~= nil) then | |
223 | rtv_initiated = tonumber(file:read("*line")) | |
224 | file:close() | |
225 | end | |
226 | if rtv_initiated < 0 then | |
227 | ||
228 | local file = io.open(string.format("%s\\files\\rtv.txt", profilepath), "w+") | |
229 | ||
230 | if (file ~= nil) then | |
231 | file:write(rtv_initiated + 1) | |
232 | file:close() | |
233 | end | |
234 | ||
235 | end | |
236 | ||
237 | local file = io.open("defaults.txt") | |
238 | if (file ~= nil) then | |
239 | dofile("defaults.txt") | |
240 | else | |
241 | hprintf("Defaults.txt not found.") | |
242 | end | |
243 | ||
244 | local file = io.open(string.format("%s\\bos.txt", profilepath), "r") | |
245 | ||
246 | if (file ~= nil) then | |
247 | ||
248 | for line in file:lines() do | |
249 | ||
250 | local words = {} | |
251 | ||
252 | for word in line:gmatch("[^%,]+") do | |
253 | table.insert(words, word) | |
254 | end | |
255 | ||
256 | local size = table.getn(words) | |
257 | local name = "" | |
258 | local hash = words[size] | |
259 | ||
260 | for i=1,(size - 1) do | |
261 | name = name .. " " .. words[i] | |
262 | end | |
263 | ||
264 | name = name:gsub(" ", "", 1) | |
265 | ||
266 | table.insert(boslog_table, name .. "," .. hash) | |
267 | ||
268 | end | |
269 | ||
270 | file:close() | |
271 | ||
272 | end | |
273 | ||
274 | table.sort(boslog_table) | |
275 | ||
276 | end | |
277 | ||
278 | script_check = 1 | |
279 | ||
280 | end | |
281 | ||
282 | function OnScriptUnload() | |
283 | ||
284 | local file = io.open(profilepath .. "//files//bos.txt", "w+") | |
285 | ||
286 | if (file ~= nil) then | |
287 | ||
288 | for k,v in pairs(boslog_table) do | |
289 | if v ~= nil then | |
290 | file:write(v .. "\n") | |
291 | end | |
292 | end | |
293 | ||
294 | file:close() | |
295 | ||
296 | end | |
297 | for i = 0,15 do | |
298 | cleanupdrones(i) | |
299 | end | |
300 | ||
301 | end | |
302 | ||
303 | function OnNewGame(map) | |
304 | registertimer(1000, "TimelimitTimer") | |
305 | end | |
306 | ||
307 | function OnGameEnd(mode) | |
308 | ||
309 | if mode == 1 then | |
310 | if maintimer ~= nil then | |
311 | removetimer(maintimer) | |
312 | end | |
313 | if spamtimer ~= nil then | |
314 | removetimer(spamtimer) | |
315 | end | |
316 | if rtvtimer ~= nil then | |
317 | removetimer(rtvtimer) | |
318 | end | |
319 | if votekicktimer ~= nil then | |
320 | removetimer(votekicktimer) | |
321 | end | |
322 | rtv_initiated = -1 | |
323 | votekick_allowed = false | |
324 | elseif mode == 3 then | |
325 | ||
326 | local file = io.open(profilepath .. "//files//bos.txt", "w+") | |
327 | ||
328 | if (file ~= nil) then | |
329 | ||
330 | for k,v in pairs(boslog_table) do | |
331 | if v ~= nil then | |
332 | file:write(v .. "\n") | |
333 | end | |
334 | end | |
335 | ||
336 | file:close() | |
337 | ||
338 | end | |
339 | ||
340 | end | |
341 | ||
342 | end | |
343 | ||
344 | function OnServerChat(player, chattype, message) | |
345 | local AllowChat = 1 | |
346 | local count = gettokencount(message, " ") | |
347 | --local word = string.lower(gettoken(message, " ", 0)) | |
348 | --local word2 = string.lower(gettoken(message, " ", 1)) | |
349 | local t = {} | |
350 | local name = getname(player) | |
351 | local hash = gethash(player) | |
352 | local access = nil | |
353 | ||
354 | if string.lower(string.sub(message, 1, 3)) == "bot" and count == 1 then | |
355 | registertimer(0, "delayMsg", "PROOF OR GTFO") | |
356 | end | |
357 | if string.lower(string.sub(message, 1, 3)) == "rtv" then | |
358 | if count == 1 then | |
359 | if rtv_initiated >= 0 then | |
360 | ||
361 | local rtv_count = 0 | |
362 | local rtv_number = round(cur_players * rtv_required) | |
363 | for i=0,15 do | |
364 | ||
365 | local hash2 = gethash(i) | |
366 | ||
367 | if hash2 ~= nil then | |
368 | if rtv_table[hash2] == 1 then | |
369 | rtv_count = rtv_count + 1 | |
370 | end | |
371 | end | |
372 | ||
373 | end | |
374 | if rtv_count == 0 then | |
375 | rtv_initiated = 1 | |
376 | rtv_table[hash] = 1 | |
377 | rtv_count = rtv_count + 1 | |
378 | say(name .. " has initiated rtv!") | |
379 | say("Type \"rtv\" to join the vote!") | |
380 | rtvtimer = registertimer(60000, "rtvTimer") | |
381 | else | |
382 | if rtv_table[hash] == 1 then | |
383 | privatesay(player, "You have already voted for rtv!") | |
384 | elseif rtv_table[hash] == nil then | |
385 | rtv_table[hash] = 1 | |
386 | rtv_count = rtv_count + 1 | |
387 | say(name .. " has voted for rtv!") | |
388 | say(rtv_count .. " of " .. rtv_number .. " votes required for rtv!") | |
389 | end | |
390 | end | |
391 | local file = io.open(profilepath .. "//files//rtv.txt", "w+") | |
392 | ||
393 | if (file ~= nil) then | |
394 | file:write(rtv_timeout) | |
395 | file:close() | |
396 | end | |
397 | if rtv_count >= rtv_number then | |
398 | removetimer(rtvtimer) | |
399 | rtv_initiated = rtv_timeout | |
400 | say("Initiating mapvote!") | |
401 | svcmd("sv_map_next") | |
402 | end | |
403 | ||
404 | else | |
405 | privatesay(player, "You cannot initiate rtv at this time!") | |
406 | end | |
407 | ||
408 | AllowChat = 0 | |
409 | ||
410 | end | |
411 | elseif string.lower(string.sub(message, 1, 8)) == "votekick" then | |
412 | if count == 2 then | |
413 | ||
414 | if votekick_allowed == true and votekicktimeout_table[hash] == nil then | |
415 | if word2 == "1" or word2 == "2" or word2 == "3" or word2 == "4" or word2 == "5" or word2 == "6" or word2 == "7" or word2 == "8" or word2 == "9" or word2 == "10" or word2 == "11" or word2 == "12" or word2 == "13" or word2 == "14" or word2 == "15" or word2 == "16" then | |
416 | ||
417 | local votekick_count = 0 | |
418 | local votekick_number = round(cur_players * votekick_required) | |
419 | local player2 = rresolveplayer(word2) | |
420 | local name2 = getname(player2) | |
421 | local hash2 = gethash(player2) | |
422 | local admin = nil | |
423 | ||
424 | for i=0,15 do | |
425 | ||
426 | local hash2 = gethash(i) | |
427 | ||
428 | if hash2 ~= nil then | |
429 | if votekick_table[hash2] == 1 then | |
430 | votekick_count = votekick_count + 1 | |
431 | end | |
432 | end | |
433 | ||
434 | end | |
435 | ||
436 | if hash2 ~= nil then | |
437 | ||
438 | for k,v in pairs(admin_table) do | |
439 | if k == hash2 then | |
440 | admin = 1 | |
441 | break | |
442 | end | |
443 | end | |
444 | ||
445 | if admin == nil then | |
446 | if player ~= player2 then | |
447 | votekick_allowed = player2 | |
448 | votekick_table[hash] = 1 | |
449 | votekick_count = votekick_count + 1 | |
450 | say(name .. " has initiated a votekick on " .. name2 .. "!") | |
451 | say("Type \"kick\" to join the vote!") | |
452 | votekicktimer = registertimer(60000, 0, "votekickTimer") | |
453 | votekicktimeout_table[hash] = 1 | |
454 | else | |
455 | privatesay(player, "Invalid player!") | |
456 | end | |
457 | else | |
458 | privatesay(player, "Admins cannot be votekicked!") | |
459 | end | |
460 | ||
461 | else | |
462 | privatesay(player, "Invalid player!") | |
463 | end | |
464 | ||
465 | if votekick_count >= votekick_number then | |
466 | ||
467 | for k,v in pairs(votekick_table) do | |
468 | votekick_table[k] = nil | |
469 | end | |
470 | ||
471 | removetimer(votekicktimer) | |
472 | votekick_allowed = true | |
473 | say("Kicking " .. name2 .. "!") | |
474 | svcmd("sv_ban " .. word2 .. " 5m") | |
475 | ||
476 | end | |
477 | ||
478 | else | |
479 | privatesay(player, "Invalid player!") | |
480 | end | |
481 | else | |
482 | privatesay(player, "You cannot initiate a votekick at this time!") | |
483 | end | |
484 | ||
485 | AllowChat = 0 | |
486 | ||
487 | end | |
488 | elseif string.sub(message, 1, 4) == "kick" then | |
489 | if count == 1 then | |
490 | ||
491 | if votekick_allowed ~= true and votekick_allowed ~= false then | |
492 | ||
493 | local votekick_count = 0 | |
494 | local votekick_number = round(cur_players * votekick_required) | |
495 | local name2 = getname(votekick_allowed) | |
496 | local sv_player = resolveplayer(votekick_allowed) | |
497 | ||
498 | for i=0,15 do | |
499 | ||
500 | local hash2 = gethash(i) | |
501 | ||
502 | if hash2 ~= nil then | |
503 | if votekick_table[hash2] == 1 then | |
504 | votekick_count = votekick_count + 1 | |
505 | end | |
506 | end | |
507 | ||
508 | end | |
509 | ||
510 | if player ~= votekick_allowed then | |
511 | if votekick_table[hash] == 1 then | |
512 | privatesay(player, "You have already voted!") | |
513 | elseif votekick_table[hash] == nil then | |
514 | votekick_table[hash] = 1 | |
515 | votekick_count = votekick_count + 1 | |
516 | say(name .. " has voted to kick " .. name2 .. "!") | |
517 | say(votekick_count .. " of " .. votekick_number .. " votes required to kick!") | |
518 | end | |
519 | else | |
520 | privatesay(player, "You are not allowed to vote!") | |
521 | end | |
522 | ||
523 | if votekick_count >= votekick_number then | |
524 | ||
525 | for k,v in pairs(votekick_table) do | |
526 | votekick_table[k] = nil | |
527 | end | |
528 | ||
529 | removetimer(votekicktimer) | |
530 | votekick_allowed = true | |
531 | say("Kicking " .. name2 .. "!") | |
532 | svcmd("sv_ban " .. sv_player .. " 5m") | |
533 | ||
534 | end | |
535 | ||
536 | else | |
537 | privatesay(player, "A votekick has not been initiated!") | |
538 | end | |
539 | ||
540 | AllowChat = 0 | |
541 | ||
542 | end | |
543 | end | |
544 | ||
545 | for k,v in pairs(admin_table) do | |
546 | if k == hash then | |
547 | access = tonumber(v) | |
548 | break | |
549 | end | |
550 | end | |
551 | ||
552 | for i=1,count do | |
553 | local word = gettoken(message, " ", i - 1) | |
554 | word = string.lower(word) | |
555 | table.insert(t, word) | |
556 | end | |
557 | ||
558 | --[[local backslash = false | |
559 | local forwardslash = false | |
560 | if string.find(t[1], "\\") ~= nil then | |
561 | backslash = true | |
562 | t[1] = t[1]:gsub("\\", "", 1) | |
563 | elseif string.find(t[1], "/") ~= nil then | |
564 | forwardslash = true | |
565 | t[1] = t[1]:gsub("/", "", 1) | |
566 | end | |
567 | ||
568 | local cmd_found = false | |
569 | local cmd_type = false | |
570 | for i = 1,#access_table[access] do | |
571 | local access_cmd = access_table[access][i] | |
572 | if string.find(access_cmd, "sv_") ~= nil then | |
573 | access_cmd = access_cmd:gsub("sv_", "", 1) | |
574 | end | |
575 | if t[1] == access_cmd then | |
576 | cmd_found = true | |
577 | end | |
578 | if backslash == true then | |
579 | if access_table[access][i] == "bkslash" then | |
580 | cmd_type = true | |
581 | end | |
582 | elseif forwardslash == true then | |
583 | if access_table[access][i] == "fwslash" then | |
584 | cmd_type = true | |
585 | end | |
586 | end | |
587 | if cmd_found == true and cmd_type == true then | |
588 | break | |
589 | end | |
590 | end | |
591 | ||
592 | if cmd_found == false then | |
593 | privatesay(player, "You are not authorized to use this command.") | |
594 | elseif cmd_type == false then | |
595 | if backslash == true then | |
596 | privatesay(player, "You are not authorized to use \\ commands.") | |
597 | return 0 | |
598 | elseif forwardslash == true then | |
599 | privatesay(player, "You are not authorized to use / commands.") | |
600 | return 1 | |
601 | end | |
602 | end--]] | |
603 | ||
604 | if access ~= nil then | |
605 | ||
606 | if string.sub(t[1], 1, 1) == "/" then | |
607 | AllowChat = 1 | |
608 | elseif string.sub(t[1], 1, 1) == "\\" then | |
609 | AllowChat = 0 | |
610 | end | |
611 | ||
612 | t[1] = t[1]:gsub("\\", "/") | |
613 | ||
614 | local found1 = string.find(t[1], "/") | |
615 | local found2 = string.find(t[1], "/", 2) | |
616 | local found3 = string.find(t[1], "/info", -5) | |
617 | local valid_command = nil | |
618 | local permission = nil | |
619 | ||
620 | if found1 ~= nil and found2 == nil and found3 == nil then | |
621 | ||
622 | for k,v in pairs(commands_table) do | |
623 | if t[1] == v then | |
624 | valid_command = 1 | |
625 | break | |
626 | end | |
627 | end | |
628 | ||
629 | if valid_command == nil then | |
630 | registertimer(0, "delayMsg", "Invalid Command", message, player) | |
631 | else | |
632 | ||
633 | local command_list = access_table[access] | |
634 | local command = t[1]:gsub("/", "sv_") | |
635 | ||
636 | if command_list == -1 then | |
637 | permission = 1 | |
638 | else | |
639 | ||
640 | local found = string.find(command_list, command) | |
641 | ||
642 | if found ~= nil then | |
643 | permission = 1 | |
644 | end | |
645 | ||
646 | end | |
647 | ||
648 | if t[1] == "/a" then | |
649 | if permission == 1 then | |
650 | if count == 4 then | |
651 | if validplayer(t[2]) ~= false then | |
652 | for i = 1,#players do | |
653 | svcmd("sv_admin_add " .. resolveplayer(players[i]) .. " " .. t[3] .. " " .. t[4]) | |
654 | registertimer(0, "delayMsg", getname(players[i]) .. " is now an admin at level " .. t[4], "/", player) | |
655 | registertimer(0, "delayMsg", "You are now an admin!", "\\", players[i]) | |
656 | end | |
657 | ||
658 | else | |
659 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
660 | end | |
661 | else | |
662 | registertimer(0, "delayMsg", "Invalid Syntax: /a [player] [nickname] [level]") | |
663 | end | |
664 | else | |
665 | if string.sub(t[1], 1, 1) == "/" then | |
666 | registertimer(0, "delayMsg", "Only admins can execute this command.", message, player) | |
667 | end | |
668 | end | |
669 | elseif t[1] == "/afk" then | |
670 | if count == 1 then | |
671 | registertimer(0, "delayMsg", svcmd("sv_afk " .. resolveplayer(player)), message, player) | |
672 | elseif count == 2 then | |
673 | registertimer(0, "delayMsg", svcmd("sv_afk " .. t[2]), message, player) | |
674 | else | |
675 | registertimer(0, "delayMsg", "Invalid Syntax: /afk {person}", message, player) | |
676 | end | |
677 | elseif t[1] == "/gethash" then | |
678 | if count == 2 then | |
679 | registertimer(0, "delayMsg", svcmd("sv_gethash " .. t[2]), message, player) | |
680 | else | |
681 | registertimer(0, "delayMsg", "Invalid Syntax: /gethash [player]", message, player) | |
682 | end | |
683 | elseif t[1] == "/help" then | |
684 | if t[2] == "a" then | |
685 | registertimer(0, "delayMsg", "Syntax: /a [player] [nickname] [level]", message, player) | |
686 | registertimer(0, "delayMsg", "Adds a player to the admin list.", message, player) | |
687 | elseif t[2] == "ammo" then | |
688 | registertimer(0, "delayMsg", "Syntax: /ammo [player] [ammo]", message, player) | |
689 | registertimer(0, "delayMsg", "Sets the player's primary weapon's ammo. Use * for all players.", message, player) | |
690 | elseif t[2] == "b" then | |
691 | registertimer(0, "delayMsg", "Syntax: /b [player] {time}", message, player) | |
692 | registertimer(0, "delayMsg", "Bans a player indefinitely, or for the time specified.", message, player) | |
693 | elseif t[2] == "c" then | |
694 | registertimer(0, "delayMsg", "Syntax: /c [victim] [controller]", message, player) | |
695 | registertimer(0, "delayMsg", "Forces the victim to move in any direction the controller is moving.", message, player) | |
696 | elseif t[2] == "deathless" then | |
697 | registertimer(0, "delayMsg", "Syntax: /deathless [boolean]", message, player) | |
698 | registertimer(0, "delayMsg", "Will set the game so no one can die. 0 for off, 1 for on.", message, player) | |
699 | registertimer(0, "delayMsg", "Using 'heal' will override this, however", message, player) | |
700 | elseif t[2] == "e" then | |
701 | registertimer(0, "delayMsg", "Syntax: /e [Command]", message, player) | |
702 | registertimer(0, "delayMsg", "This will execute any command that you would normally put in the console.", message, player) | |
703 | registertimer(0, "delayMsg", "This is also used more commonly to tell if the script is working.", message, player) | |
704 | registertimer(0, "delayMsg", "Or if a player has admin.", message, player) | |
705 | elseif t[2] == "eject" then | |
706 | registertimer(0, "delayMsg", "Syntax: /eject [player]", message, player) | |
707 | registertimer(0, "delayMsg", "Ejects a player. Use * for all players.", message, player) | |
708 | elseif t[2] == "enter" then | |
709 | registertimer(0, "delayMsg", "Syntax: /enter [player] [seat]", message, player) | |
710 | registertimer(0, "delayMsg", "Will cause you to enter the player's vehicle, and the seat specified.", message, player) | |
711 | elseif t[2] == "getloc" then | |
712 | registertimer(0, "delayMsg", "Syntax: /getloc [player]", message, player) | |
713 | registertimer(0, "delayMsg", "Will display the location of the player specified.", message, player) | |
714 | elseif t[2] == "godmode" then | |
715 | registertimer(0, "delayMsg", "Syntax: /godmode [player]") | |
716 | registertimer(0, "delayMsg", "Will make this person unkillable. Backtaps, however, will still kill them.", message, player) | |
717 | elseif t[2] == "hax" then | |
718 | registertimer(0, "delayMsg", "Syntax: /hax", message, player) | |
719 | registertimer(0, "delayMsg", "I made this command because I was bored.", message, player) | |
720 | elseif t[2] == "heal" then | |
721 | registertimer(0, "delayMsg", "Syntax: /heal [player]", message, player) | |
722 | registertimer(0, "delayMsg", "Will heal the specified player.", message, player) | |
723 | elseif t[2] == "help" then | |
724 | registertimer(0, "delayMsg", "Syntax: /help [Command]", message, player) | |
725 | registertimer(0, "delayMsg", "Will provide details on any specified command.", message, player) | |
726 | registertimer(0, "delayMsg", "Do not include / or \ for the [Command]", message, player) | |
727 | elseif t[2] == "hitler" then | |
728 | registertimer(0, "delayMsg", "Syntax: /hitler", message, player) | |
729 | registertimer(0, "delayMsg", "Will lethaly inject everyone.", message, player) | |
730 | elseif t[2] == "infammo" then | |
731 | registertimer(0, "delayMsg", "Syntax: /infammo [boolean]", message, player) | |
732 | registertimer(0, "delayMsg", "Will set the game so everyone has infinite ammo. 0 for off, 1 for on", message, player) | |
733 | elseif t[2] == "give" then | |
734 | registertimer(0, "delayMsg", "Syntax: /give [weapon] {player}", message, player) | |
735 | registertimer(0, "delayMsg", "Will give yourself, or the person specified, a weapon.", message, player) | |
736 | registertimer(0, "delayMsg", "You can hold up to 4 weapons. If you are holding 4 weapons,", message, player) | |
737 | registertimer(0, "delayMsg", "you cannot pickup the flag, or the oddball.", message, player) | |
738 | elseif t[2] == "gethash" then | |
739 | registertimer(0, "delayMsg", "Syntax: /gethash [player]", message, player) | |
740 | registertimer(0, "delayMsg", "This will get the hash of the player specified.", message, player) | |
741 | elseif t[2] == "invis" then | |
742 | registertimer(0, "delayMsg", "Syntax: /invis [player] {time}", message, player) | |
743 | registertimer(0, "delayMsg", "This will camouflage the person specified for the amount of time specified.", message, player) | |
744 | elseif t[2] == "j" then | |
745 | registertimer(0, "delayMsg", "Syntax: /j [player] [x] [y] [z]", message, player) | |
746 | registertimer(0, "delayMsg", "Moves the specified player by coords specified.", message, player) | |
747 | elseif t[2] == "k" then | |
748 | registertimer(0, "delayMsg", "Syntax: /k [player]", message, player) | |
749 | registertimer(0, "delayMsg", "Will kick the player specified.", message, player) | |
750 | elseif t[2] == "kill" then | |
751 | registertimer(0, "delayMsg", "Syntax: /kill [player]", message, player) | |
752 | registertimer(0, "delayMsg", "Will kill the player specified.", message, player) | |
753 | elseif t[2] == "lo3" then | |
754 | registertimer(0, "delayMsg", "Syntax: /lo3", message, player) | |
755 | registertimer(0, "delayMsg", "Will lo3 the game.", message, player) | |
756 | elseif t[2] == "m" then | |
757 | registertimer(0, "delayMsg", "Syntax: /m [map] [gametype] {script} {script2} . . .", message, player) | |
758 | registertimer(0, "delayMsg", "Will load the map specified. No need to specify chatcommands script.", message, player) | |
759 | elseif t[2] == "mc" then | |
760 | registertimer(0, "delayMsg", "Syntax: /mc", message, player) | |
761 | registertimer(0, "delayMsg", "Starts the mapcycle.", message, player) | |
762 | elseif t[2] == "mnext" then | |
763 | registertimer(0, "delayMsg", "Syntax: /mnext", message, player) | |
764 | registertimer(0, "delayMsg", "Loads the next map in the mapcycle.", message, player) | |
765 | elseif t[2] == "mute" then | |
766 | registertimer(0, "delayMsg", "Syntax: /mute [player] {time}", message, player) | |
767 | registertimer(0, "delayMsg", "Mutes the player. Admins cannot be muted.", message, player) | |
768 | elseif t[2] == "pass" then | |
769 | registertimer(0, "delayMsg", "Syntax: /pass [password]", message, player) | |
770 | registertimer(0, "delayMsg", "Sets the server password.", message, player) | |
771 | elseif t[2] == "reset" then | |
772 | registertimer(0, "delayMsg", "Syntax: /reset", message, player) | |
773 | registertimer(0, "delayMsg", "Resets the map.", message, player) | |
774 | elseif t[2] == "resp" then | |
775 | registertimer(0, "delayMsg", "Syntax: /resp [player] [time]", message, player) | |
776 | registertimer(0, "delayMsg", "Sets respawn time of player. Only works if player is dead.", message, player) | |
777 | elseif t[2] == "say" then | |
778 | registertimer(0, "delayMsg", "Syntax: /say [message]", message, player) | |
779 | registertimer(0, "delayMsg", "Will say something as the server. No quotes needed.", message, player) | |
780 | elseif t[2] == "sc" then | |
781 | registertimer(0, "delayMsg", "Syntax: /sc [player] [nickname]", message, player) | |
782 | registertimer(0, "delayMsg", "Will set the player's nickname. Used instead of player IDs", message, player) | |
783 | elseif t[2] == "setassists" then | |
784 | registertimer(0, "delayMsg", "Syntax: /setassists [player] [# of assists]", message, player) | |
785 | registertimer(0, "delayMsg", "Will set the assists of the player specified.", message, player) | |
786 | elseif t[2] == "setdeaths" then | |
787 | registertimer(0, "delayMsg", "Syntax: /setdeaths [player] [# of deaths]", message, player) | |
788 | registertimer(0, "delayMsg", "Will set the deaths of the player specified.", message, player) | |
789 | elseif t[2] == "setfrags" then | |
790 | registertimer(0, "delayMsg", "Syntax: /setfrags [player] [# of frags]", message, player) | |
791 | registertimer(0, "delayMsg", "Will set the # of frag grenades of the player specified.", message, player) | |
792 | elseif t[2] == "setkills" then | |
793 | registertimer(0, "delayMsg", "Syntax: /setkills [player] [# of kills]", message, player) | |
794 | registertimer(0, "delayMsg", "Will set the kills of the player specified.", message, player) | |
795 | elseif t[2] == "setname" then | |
796 | registertimer(0, "delayMsg", "Syntax: /setname [player] [name]", message, player) | |
797 | registertimer(0, "delayMsg", "Sets the name of the player specified.", message, player) | |
798 | registertimer(0, "delayMsg", "You will only notice a difference on rejoin.", message, player) | |
799 | elseif t[2] == "setresp" then | |
800 | registertimer(0, "delayMsg", "Syntax: /setresp [time]", message, player) | |
801 | registertimer(0, "delayMsg", "Sets the universal respawn time of all maps/gametypes.", message, player) | |
802 | elseif t[2] == "setplasmas" then | |
803 | registertimer(0, "delayMsg", "Syntax: /setplasmas [player] [# of plasma grenades]", message, player) | |
804 | registertimer(0, "delayMsg", "Will set the plasma grenades of the player specified.", message, player) | |
805 | elseif t[2] == "spd" then | |
806 | registertimer(0, "delayMsg", "Syntax: /spd [player] [speed]", message, player) | |
807 | registertimer(0, "delayMsg", "Will set the speed of the player specified.", message, player) | |
808 | elseif t[2] == "spawn" then | |
809 | registertimer(0, "delayMsg", "Syntax: /spawn [object] {player} {ammount} {resptime} {recycle}", message, player) | |
810 | registertimer(0, "delayMsg", "Will spawn a object over a player if specified.", message, player) | |
811 | elseif t[2] == "st" then | |
812 | registertimer(0, "delayMsg", "Syntax: /st [location]", message, player) | |
813 | registertimer(0, "delayMsg", "Will set a teleport location to wherever you're standing.", message, player) | |
814 | elseif t[2] == "suspend" then | |
815 | registertimer(0, "delayMsg", "Syntax: /suspend [player] {time}", message, player) | |
816 | registertimer(0, "delayMsg", "Will suspend the player for the time specified.", message, player) | |
817 | elseif t[2] == "t" then | |
818 | registertimer(0, "delayMsg", "Syntax: /t [player] [location]", message, player) | |
819 | registertimer(0, "delayMsg", "Will teleport the player specified to the location specified.", message, player) | |
820 | elseif t[2] == "td" then | |
821 | registertimer(0, "delayMsg", "Syntax: /td [location]", message, player) | |
822 | registertimer(0, "delayMsg", "Will delete the teleport location specified.", message, player) | |
823 | elseif t[2] == "test" then | |
824 | registertimer(0, "delayMsg", "Syntax: /test [player]", message, player) | |
825 | registertimer(0, "delayMsg", "I used this to randomly see the returns of some addresses and offsets.", message, player) | |
826 | elseif t[2] == "tp" then | |
827 | registertimer(0, "delayMsg", "Syntax: /tp [player] [t_player]", message, player) | |
828 | registertimer(0, "delayMsg", "Will teleport player to t_player", message, player) | |
829 | elseif t[2] == "ts" then | |
830 | registertimer(0, "delayMsg", "Syntax: /ts [player] {team}", message, player) | |
831 | registertimer(0, "delayMsg", "Will switch the players team. Teams are 0 and 1", message, player) | |
832 | elseif t[2] == "unhax" then | |
833 | registertimer(0, "delayMsg", "Syntax: /unhax", message, player) | |
834 | registertimer(0, "delayMsg", "Unhax's you. I was bored, what can i say?", message, player) | |
835 | elseif t[2] == "unmute" then | |
836 | registertimer(0, "delayMsg", "Syntax: /unmute [player]", message, player) | |
837 | registertimer(0, "delayMsg", "Unmutes the player specified.", message, player) | |
838 | elseif t[2] == "unsuspend" then | |
839 | registertimer(0, "delayMsg", "Syntax: /unsuspend [player]", message, player) | |
840 | registertimer(0, "delayMsg", "Unsuspends the player specified.", message, player) | |
841 | elseif t[2] == "credits" then | |
842 | registertimer(0, "delayMsg", "Created by [DWM]Wizard or =RDA=Wizard", message, player) | |
843 | registertimer(0, "delayMsg", "Base script created by Smiley", message, player) | |
844 | else | |
845 | registertimer(0, "delayMsg", "Invalid Command! Use /list for list of commands!", message, player) | |
846 | end | |
847 | elseif t[1] == "/ammo" then | |
848 | if permission == 1 then | |
849 | if count == 3 then | |
850 | if validplayer(t[2]) ~= false then | |
851 | for i = 1,#players do | |
852 | local m_player = getplayer(players[i]) | |
853 | local m_ObjId = readdword(m_player, 0x34) | |
854 | local m_Object = getobject(m_ObjId) | |
855 | if m_player ~= nil and m_Object ~= nil then | |
856 | for i = 0, 3 do | |
857 | local m_weaponId = readdword(m_Object, 0x2F8 + (i*4)) | |
858 | if m_weaponId ~= -1 then | |
859 | local m_weapon = getobject(m_weaponId) | |
860 | writeword(m_weapon, 0x2B8, t[3]) -- loaded clip to specified ammount | |
861 | updateammo(m_weaponId) -- force it to sync | |
862 | registertimer(0, "delayMsg", getname(players[i]) "'s ammo was set to " .. t[3], message, player) | |
863 | end | |
864 | end | |
865 | end | |
866 | end | |
867 | ||
868 | else | |
869 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
870 | end | |
871 | else | |
872 | registertimer(0, "delayMsg", "Invalid Syntax: /ammo [player] [ammo]", message, player) | |
873 | end | |
874 | else | |
875 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
876 | end | |
877 | elseif t[1] == "/b" then | |
878 | if permission == 1 then | |
879 | if count == 2 then | |
880 | if validplayer(t[2]) ~= false then | |
881 | for i = 1,#players do | |
882 | svcmd("sv_ban " .. resolveplayer(players[i])) | |
883 | registertimer(0, "delayMsg", getname(players[i]) .. " has been banned from the server!", message, player) | |
884 | end | |
885 | else | |
886 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
887 | end | |
888 | elseif count == 3 then | |
889 | if validplayer(t[2]) ~= false then | |
890 | for i = 1,#players do | |
891 | svcmd("sv_ban " .. resolveplayer(players[i]) .. " " .. t[3]) | |
892 | registertimer(0, "delayMsg", getname(players[i]) .. " has been banned for " .. t[3] .. " time!", message, player) | |
893 | end | |
894 | else | |
895 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
896 | end | |
897 | else | |
898 | registertimer(0, "delayMsg", "Invalid Syntax: /b [player] {time}", message, player) | |
899 | end | |
900 | else | |
901 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
902 | end | |
903 | elseif t[1] == "/deathless" then | |
904 | if permission == 1 then | |
905 | if count == 1 then | |
906 | registertimer(0, "delayMsg", svcmd("sv_deathless"), message, player) | |
907 | elseif count == 2 then | |
908 | registertimer(0, "delayMsg", svcmd("sv_deathless " .. t[2]), message, player) | |
909 | else | |
910 | registertimer(0, "delayMsg", "Invalid Syntax: /deathless {boolean}", message, player) | |
911 | end | |
912 | else | |
913 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
914 | end | |
915 | elseif t[1] == "/setmode" then | |
916 | if permission == 1 then | |
917 | if count == 3 then | |
918 | registertimer(0, "delayMsg", svcmd("sv_setmode " .. t[2] .. " " .. t[3]), message, player) | |
919 | elseif count == 4 then | |
920 | registertimer(0, "delayMsg", svcmd("sv_setmode " .. t[2] .. " " .. t[3] .. " " .. t[4]), message, player) | |
921 | else | |
922 | registertimer(0, "delayMsg", "Invalid Syntax: /setmode [player] [mode] {object}", message, player) | |
923 | end | |
924 | else | |
925 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
926 | end | |
927 | elseif t[1] == "/e" then | |
928 | if permission == 1 then | |
929 | registertimer(0, "delayMsg", "Executed " .. string.sub(message, 4), message, player) | |
930 | svcmd(string.sub(message, 4)) | |
931 | else | |
932 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
933 | end | |
934 | elseif t[1] == "/eject" then | |
935 | if permission == 1 then | |
936 | if count == 2 then | |
937 | registertimer(0, "delayMsg", svcmd("sv_eject " .. t[2]), message, player) | |
938 | else | |
939 | registertimer(0, "delayMsg", "Invalid Syntax: /eject [player]", message, player) | |
940 | end | |
941 | else | |
942 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
943 | end | |
944 | elseif t[1] == "/getloc" then | |
945 | if permission == 1 then | |
946 | if count == 2 then | |
947 | registertimer(0, "delayMsg", svcmd("sv_getloc " .. t[2]), message, player) | |
948 | else | |
949 | registertimer(0, "delayMsg", "Invalid Syntax: /getloc [player]", message, player) | |
950 | end | |
951 | else | |
952 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
953 | end | |
954 | elseif t[1] == "/ghost" then | |
955 | if permission == 1 then | |
956 | if count == 1 then | |
957 | registertimer(0, "delayMsg", svcmd("sv_ghost " .. resolveplayer(player)), message, player) | |
958 | elseif count == 2 then | |
959 | registertimer(0, "delayMsg", svcmd("sv_ghost " .. t[2]), message, player) | |
960 | else | |
961 | registertimer(0, "delayMsg", "Invalid Syntax: /ghost {player}", message, player) | |
962 | end | |
963 | else | |
964 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
965 | end | |
966 | elseif t[1] == "/unghost" then | |
967 | if permission == 1 then | |
968 | if count == 1 then | |
969 | registertimer(0, "delayMsg", svcmd("sv_unghost " .. resolveplayer(player)), message, player) | |
970 | elseif count == 2 then | |
971 | registertimer(0, "delayMsg", svcmd("sv_unghost " .. t[2]), message, player) | |
972 | else | |
973 | registertimer(0, "delayMsg", "Invalid Syntax: /unghost {player}", message, player) | |
974 | end | |
975 | else | |
976 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
977 | end | |
978 | elseif t[1] == "/godmode" then | |
979 | if permission == 1 then | |
980 | if count == 2 then | |
981 | registertimer(0, "delayMsg", svcmd("sv_setgod " .. t[2]), message, player) | |
982 | else | |
983 | registertimer(0, "delayMsg", "Invalid Syntax: /godmode [player]", message, player) | |
984 | end | |
985 | else | |
986 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
987 | end | |
988 | elseif t[1] == "/hax" then | |
989 | if permission == 1 then | |
990 | if count == 1 then | |
991 | registertimer(0, "delayMsg", svcmd("cheat_hax " .. resolveplayer(player)), message, player) | |
992 | else | |
993 | registertimer(0, "delayMsg", "Invalid Syntax: /hax", message, player) | |
994 | end | |
995 | else | |
996 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
997 | end | |
998 | elseif t[1] == "/heal" then | |
999 | if permission == 1 then | |
1000 | if count == 2 then | |
1001 | registertimer(0, "delayMsg", svcmd("sv_heal " .. t[2]), message, player) | |
1002 | else | |
1003 | registertimer(0, "delayMsg", "Invalid Syntax: /heal [player]", message, player) | |
1004 | end | |
1005 | else | |
1006 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1007 | end | |
1008 | elseif t[1] == "/ungod" then | |
1009 | if permission == 1 then | |
1010 | if count == 2 then | |
1011 | registertimer(0, "delayMsg", svcmd("sv_ungod " .. t[2]), message, player) | |
1012 | else | |
1013 | registertimer(0, "delayMsg", "Invalid Syntax: /ungod [player]", message, player) | |
1014 | end | |
1015 | else | |
1016 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1017 | end | |
1018 | elseif t[1] == "/hitler" then | |
1019 | if permission == 1 then | |
1020 | if count == 1 then | |
1021 | registertimer(0, "delayMsg", svcmd("sv_hitler"), message, player) | |
1022 | else | |
1023 | registertimer(0, "delayMsg", "Invalid Syntax: /hitler", message, player) | |
1024 | end | |
1025 | else | |
1026 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1027 | end | |
1028 | elseif t[1] == "/infammo" then | |
1029 | if permission == 1 then | |
1030 | if count == 1 then | |
1031 | registertimer(0, "delayMsg", svcmd("sv_infinite_ammo"), message, player) | |
1032 | elseif count == 2 then | |
1033 | registertimer(0, "delayMsg", svcmd("sv_infinite_ammo " .. t[2]), message, player) | |
1034 | else | |
1035 | registertimer(0, "delayMsg", "Invalid Syntax: /infammo {boolean}", message, player) | |
1036 | end | |
1037 | else | |
1038 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1039 | end | |
1040 | elseif t[1] == "/invis" then | |
1041 | if permission == 1 then | |
1042 | if count == 2 then | |
1043 | registertimer(0, "delayMsg", svcmd("sv_invis " .. t[2]), message, player) | |
1044 | elseif count == 3 then | |
1045 | registertimer(0, "delayMsg", svcmd("sv_invis " .. t[2] .. " " .. t[3]), message, player) | |
1046 | else | |
1047 | registertimer(0, "delayMsg", "Invalid Syntax: /invis [player] {time}", message, player) | |
1048 | end | |
1049 | else | |
1050 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1051 | end | |
1052 | elseif t[1] == "/j" then | |
1053 | if permission == 1 then | |
1054 | if count == 5 then | |
1055 | registertimer(0, "delayMsg", svcmd("sv_move " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5]), message, player) | |
1056 | else | |
1057 | registertimer(0, "delayMsg", "Invalid Syntax: /j [player] [x] [y] [z]", message, player) | |
1058 | end | |
1059 | else | |
1060 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1061 | end | |
1062 | elseif t[1] == "/k" then | |
1063 | if permission == 1 then | |
1064 | if count == 2 then | |
1065 | if validplayer(t[2]) ~= false then | |
1066 | for i = 1, #players do | |
1067 | svcmd("sv_kick " .. resolveplayer(players[i])) | |
1068 | registertimer(0, "delayMsg", getname(players[i]) .. " has been kicked from the server!", message, player) | |
1069 | end | |
1070 | ||
1071 | else | |
1072 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
1073 | end | |
1074 | else | |
1075 | registertimer(0, "delayMsg", "Invalid Syntax: /k [player] {time}", message, player) | |
1076 | end | |
1077 | else | |
1078 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1079 | end | |
1080 | elseif t[1] == "/kill" then | |
1081 | if permission == 1 then | |
1082 | if count == 2 then | |
1083 | if validplayer(t[2]) ~= false then | |
1084 | for i = 1, #players do | |
1085 | if getobject(getplayerobjectid(players[i])) ~= nil then | |
1086 | kill(players[i]) | |
1087 | registertimer(0, "delayMsg", getname(players[i]) .. " has been killed!", message, player) | |
1088 | else | |
1089 | registertimer(0, "delayMsg", "Error! " .. getname(players[i]) .. " is dead!", message, player) | |
1090 | end | |
1091 | end | |
1092 | ||
1093 | else | |
1094 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
1095 | end | |
1096 | else | |
1097 | registertimer(0, "delayMsg", "Invalid Syntax: /kill [player]", message, player) | |
1098 | end | |
1099 | else | |
1100 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1101 | end | |
1102 | elseif t[1] == "/lo3" then | |
1103 | if permission == 1 then | |
1104 | if count == 1 then | |
1105 | registertimer(0, "delayMsg", svcmd("sv_scrim"), message, player) | |
1106 | else | |
1107 | registertimer(0, "delayMsg", "Invalid Syntax: /lo3", message, player) | |
1108 | end | |
1109 | else | |
1110 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1111 | end | |
1112 | elseif t[1] == "/m" then | |
1113 | if permission == 1 then | |
1114 | if string.find(string.lower(message), "chatcommands") == nil then | |
1115 | registertimer(0, "delayMsg", svcmd("sv_map " .. string.sub(message, 4) .. " ChatCommands"), message, player) | |
1116 | else | |
1117 | registertimer(0, "delayMsg", svcmd("sv_map " .. string.sub(message, 4)), message, player) | |
1118 | end | |
1119 | else | |
1120 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1121 | end | |
1122 | elseif t[1] == "/mc" then | |
1123 | if permission == 1 then | |
1124 | if count == 1 then | |
1125 | registertimer(0, "delayMsg", svcmd("sv_mapcycle_begin"), message, player) | |
1126 | else | |
1127 | registertimer(0, "delayMsg", "Invalid Syntax: /mc", message, player) | |
1128 | end | |
1129 | else | |
1130 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1131 | end | |
1132 | elseif t[1] == "/mnext" then | |
1133 | if permission == 1 then | |
1134 | if count == 1 then | |
1135 | registertimer(0, "delayMsg", svcmd("sv_map_next"), message, player) | |
1136 | else | |
1137 | registertimer(0, "delayMsg", "Invalid Syntax: /mnext", message, player) | |
1138 | end | |
1139 | else | |
1140 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1141 | end | |
1142 | elseif t[1] == "/mute" then | |
1143 | if permission == 1 then | |
1144 | if count == 2 then | |
1145 | registertimer(0, "delayMsg", svcmd("sv_mute " .. t[2]), message, player) | |
1146 | else | |
1147 | registertimer(0, "delayMsg", "Invalid Syntax: /mute [player]", message, player) | |
1148 | end | |
1149 | else | |
1150 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1151 | end | |
1152 | elseif t[1] == "/noweapons" then | |
1153 | if permission == 1 then | |
1154 | if count == 2 then | |
1155 | registertimer(0, "delayMsg", svcmd("sv_noweapons " .. t[2]), message, player) | |
1156 | else | |
1157 | registertimer(0, "delayMsg", "Invalid Syntax: /noweapons [boolean]", message, player) | |
1158 | end | |
1159 | else | |
1160 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1161 | end | |
1162 | elseif t[1] == "/pass" then | |
1163 | if permission == 1 then | |
1164 | if count == 2 then | |
1165 | if t[2] == "off" or t[2] == '""' then | |
1166 | registertimer(0, "delayMsg", "Password has been taken off.", message, player) | |
1167 | svcmd('sv_password ""') | |
1168 | else | |
1169 | svcmd("sv_password " .. t[2]) | |
1170 | registertimer(0, "delayMsg", "Password set to '" .. t[2] .. "'", message, player) | |
1171 | end | |
1172 | else | |
1173 | registertimer(0, "delayMsg", "Invalid Syntax: /pass [password]", message, player) | |
1174 | end | |
1175 | else | |
1176 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1177 | end | |
1178 | elseif t[1] == "/pl" then | |
1179 | if permission == 1 then | |
1180 | if count == 1 then | |
1181 | for c = 0,15 do | |
1182 | if getplayer(c) ~= nil then | |
1183 | privatesay(player, "(" .. c + 1 .. ") " .. getname(c)) | |
1184 | end | |
1185 | end | |
1186 | else | |
1187 | privatesay(player, "Invalid Syntax: \pl", message, player) | |
1188 | end | |
1189 | else | |
1190 | privatesay(player, "You cannot execute this command.") | |
1191 | end | |
1192 | elseif t[1] == "/reset" then | |
1193 | if permission == 1 then | |
1194 | if count == 1 then | |
1195 | registertimer(0, "delayMsg", svcmd("sv_map_reset"), message, player) | |
1196 | else | |
1197 | registertimer(0, "delayMsg", "Invalid Syntax: /reset", message, player) | |
1198 | end | |
1199 | else | |
1200 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1201 | end | |
1202 | elseif t[1] == "/revoke" then | |
1203 | if permission == 1 then | |
1204 | if count == 2 then | |
1205 | registertimer(0, "delayMsg", svcmd("sv_admin_del " .. t[2]), message, player) | |
1206 | else | |
1207 | registertimer(0, "delayMsg", "Invalid Syntax: /revoke [player]", message, player) | |
1208 | end | |
1209 | else | |
1210 | registertimer(0, "delayMsg", "Only swath can revoke admins.", message, player) | |
1211 | end | |
1212 | elseif t[1] == "/banlist" then | |
1213 | if permission == 1 then | |
1214 | if count == 1 then | |
1215 | registertimer(0, "delayMsg", svcmd("sv_banlist"), message, player) | |
1216 | else | |
1217 | registertimer(0, "delayMsg", "Invalid Syntax: /banlist", message, player) | |
1218 | end | |
1219 | else | |
1220 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1221 | end | |
1222 | elseif t[1] == "/resp" then | |
1223 | if permission == 1 then | |
1224 | if count == 3 then | |
1225 | registertimer(0, "delayMsg", svcmd("sv_resp " .. t[2] .. " " .. t[3]), message, player) | |
1226 | else | |
1227 | registertimer(0, "delayMsg", "Invalid Syntax /resp [player] [respawn time]", message, player) | |
1228 | end | |
1229 | else | |
1230 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1231 | end | |
1232 | elseif t[1] == "/say" then | |
1233 | if permission == 1 then | |
1234 | if count == 1 then | |
1235 | else | |
1236 | registertimer(0, "delayMsg", string.sub(message, 6), message, player) | |
1237 | end | |
1238 | else | |
1239 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1240 | end | |
1241 | elseif t[1] == "/enter" then | |
1242 | if permission == 1 then | |
1243 | if count == 2 then | |
1244 | local vehid = nil | |
1245 | if t[2] == "wraith" then | |
1246 | vehid = Spawn(message, "Wraith", "vehi", "vehicles\\wraith\\wraith", player) | |
1247 | elseif t[2] == "lifepod" then | |
1248 | vehid = Spawn(message, "Lifepod", "vehi", "vehicles\\lifepod\\lifepod", player) | |
1249 | elseif t[2] == "longsword" then | |
1250 | vehid = Spawn(message, "Longsword", "vehi", "vehicles\\fighterbomber\\fighterbomber", player) | |
1251 | elseif t[2] == "dropship" then | |
1252 | vehid = Spawn(message, "Covenant Dropship", "vehi", "vehicles\\c_dropship\\c_dropship", player) | |
1253 | elseif t[2] == "cryotube" then | |
1254 | vehid = Spawn(message, "Cryotube", "vehi", "levels\\a10\\devices\\cryotube\\cryotube", player) | |
1255 | elseif t[2] == "peli" or t[2] == "pelican" then | |
1256 | vehid = Spawn(message, "Pelican", "vehi", "vehicles\\pelican\\pelican", player) | |
1257 | elseif t[2] == "ghost" then | |
1258 | vehid = Spawn(message, "Ghost", "vehi", "vehicles\\ghost\\ghost_mp", player) | |
1259 | elseif t[2] == "hog" then | |
1260 | vehid = Spawn(message, "Warthog", "vehi", "vehicles\\warthog\\mp_warthog", player) | |
1261 | elseif t[2] == "rhog" then | |
1262 | vehid = Spawn(message, "Rocket Warthog", "vehi", "vehicles\\rwarthog\\rwarthog", player) | |
1263 | elseif t[2] == "shee" or t[2] == "banshee" then | |
1264 | vehid = Spawn(message, "Banshee", "vehi", "vehicles\\banshee\\banshee_mp", player) | |
1265 | elseif t[2] == "tank" or t[2] == "scorpion" then | |
1266 | vehid = Spawn(message, "Tank", "vehi", "vehicles\\scorpion\\scorpion_mp", player) | |
1267 | elseif t[2] == "turret" or t[2] == "shade" then | |
1268 | vehid = Spawn(message, "Gun Turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp", player) | |
1269 | else | |
1270 | registertimer(0, "delayMsg", "Invalid Vehicle!", message, player) | |
1271 | end | |
1272 | if vehid ~= nil then | |
1273 | local m_player = getplayer(player) | |
1274 | local m_playerObjId = getplayerobjectid(player) | |
1275 | if m_playerObjId ~= 0xffffffff then | |
1276 | entervehicle(player, vehid, 0) | |
1277 | table.insert(vehicle_drone_table[player], vehid) | |
1278 | else | |
1279 | registertimer(0, "delayMsg", "You cannot enter a vehicle while dead!", message, player) | |
1280 | end | |
1281 | end | |
1282 | else | |
1283 | registertimer(0, "delayMsg", "Invalid Syntax: /enter [vehicle]", message, player) | |
1284 | end | |
1285 | else | |
1286 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1287 | end | |
1288 | elseif t[1] == "/setassists" then | |
1289 | if permission == 1 then | |
1290 | if count == 3 then | |
1291 | registertimer(0, "delayMsg", svcmd("sv_setassists " .. t[2] .. " " .. t[3]), message, player) | |
1292 | else | |
1293 | registertimer(0, "delayMsg", "Invalid Syntax: /setassists [player] [assists]", message, player) | |
1294 | end | |
1295 | else | |
1296 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1297 | end | |
1298 | elseif t[1] == "/setdeaths" then | |
1299 | if permission == 1 then | |
1300 | if count == 3 then | |
1301 | registertimer(0, "delayMsg", svcmd("sv_setdeaths " .. t[2] .. " " .. t[3]), message, player) | |
1302 | else | |
1303 | registertimer(0, "delayMsg", "Invalid Syntax: /setdeaths [player] [deaths]", message, player) | |
1304 | end | |
1305 | else | |
1306 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1307 | end | |
1308 | elseif t[1] == "/setfrags" then | |
1309 | if permission == 1 then | |
1310 | if count == 3 then | |
1311 | registertimer(0, "delayMsg", svcmd("sv_setfrags " .. t[2] .. " " .. t[3]), message, player) | |
1312 | else | |
1313 | registertimer(0, "delayMsg", "Invalid Syntax: /setfrags [player] [amount]", message, player) | |
1314 | end | |
1315 | else | |
1316 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1317 | end | |
1318 | elseif t[1] == "/setkills" then | |
1319 | if permission == 1 then | |
1320 | if count == 3 then | |
1321 | registertimer(0, "delayMsg", svcmd("sv_setkills " .. t[2] .. " " .. t[3]), message, player) | |
1322 | else | |
1323 | registertimer(0, "delayMsg", "Invalid Syntax: /setkills [player] [kills]", message, player) | |
1324 | end | |
1325 | else | |
1326 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1327 | end | |
1328 | elseif t[1] == "/setresp" then | |
1329 | if permission == 1 then | |
1330 | if count == 2 then | |
1331 | registertimer(0, "delayMsg", svcmd("sv_respawn_time " .. t[2]), message, player) | |
1332 | else | |
1333 | registertimer(0, "delayMsg", "Invalid Syntax: /setresp [seconds]", message, player) | |
1334 | end | |
1335 | else | |
1336 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1337 | end | |
1338 | elseif t[1] == "/setplasmas" then | |
1339 | if permission == 1 then | |
1340 | if count == 3 then | |
1341 | registertimer(0, "delayMsg", svcmd("sv_setplasmas " .. t[2]), message, player) | |
1342 | else | |
1343 | registertimer(0, "delayMsg", "Invalid Syntax: /setplasmas [player] [amount]", message, player) | |
1344 | end | |
1345 | else | |
1346 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1347 | end | |
1348 | elseif t[1] == "/spd" then | |
1349 | if permission == 1 then | |
1350 | if count == 3 then | |
1351 | if validplayer(t[2]) ~= false then | |
1352 | if tonumber(t[3]) ~= nil then | |
1353 | for i = 1,#players do | |
1354 | if getobject(getplayerobjectid(players[i])) ~= nil then | |
1355 | setspeed(players[i], t[3]) | |
1356 | registertimer(0, "delayMsg", getname(players[i]) .. "'s speed was set to " .. t[3], message, player) | |
1357 | else | |
1358 | registertimer(0, "delayMsg", "Error! " .. getname(players[i]) .. " is dead!", message, player) | |
1359 | end | |
1360 | end | |
1361 | else | |
1362 | registertimer(0, "delayMsg", t[3] .. " is not a valid number.", message, player) | |
1363 | end | |
1364 | else | |
1365 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
1366 | end | |
1367 | else | |
1368 | registertimer(0, "delayMsg", "Invalid Syntax: /spd [player] [speed]", message, player) | |
1369 | end | |
1370 | else | |
1371 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1372 | end | |
1373 | elseif t[1] == "/spawn" then | |
1374 | if permission == 1 then | |
1375 | --Objects with 'bipd' tag | |
1376 | if t[2] == "cyborg" or t[2] == "bot" or t[2] == "mastercheif" or t[2] == "biped" or t[2] == "bipd" then | |
1377 | Spawn(message, "Cyborg", "bipd", "characters\\cyborg_mp\\cyborg_mp", player, false) | |
1378 | elseif t[2] == "captain" or t[2] == "keyes" then | |
1379 | Spawn(message, "Captain Keyes", "bipd", "characters\\captain\\captain", false) | |
1380 | elseif t[2] == "cortana" then | |
1381 | Spawn(message, "Cortana", "bipd", "characters\\cortana\\cortana", false) | |
1382 | elseif t[2] == "cortana2" then | |
1383 | Spawn(message, "Cortana2", "bipd", "characters\\cortana\\halo_enhanced\\halo_enhanced", false) | |
1384 | elseif t[2] == "crewman" then | |
1385 | Spawn(message, "Crewman", "bipd", "characters\\crewman\\crewman", false) | |
1386 | elseif t[2] == "elite" then | |
1387 | Spawn(message, "elite", "bipd", "characters\\elite\\elite", false) | |
1388 | elseif t[2] == "elite2" then | |
1389 | Spawn(message, "Elite Special", "bipd", "characters\\elite\\elite special", false) | |
1390 | elseif t[2] == "engineer" then | |
1391 | Spawn(message, "Engineer", "bipd", "characters\\engineer\\engineer", false) | |
1392 | elseif t[2] == "flood" then | |
1393 | Spawn(message, "Flood Captain", "bipd", "characters\\flood_captain\\flood_captain", false) | |
1394 | elseif t[2] == "flood2" then | |
1395 | Spawn(message, "Flood Infection", "bipd", "characters\\flood_infection\\flood_infection", false) | |
1396 | elseif t[2] == "flood3" then | |
1397 | Spawn(message, "Flood Carrier", "bipd", "characters\\floodcarrier\\floodcarrier", false) | |
1398 | elseif t[2] == "floodelite" then | |
1399 | Spawn(message, "FloodCombat Elite", "bipd", "characters\\floodcombat elite\\floodcombat elite", false) | |
1400 | elseif t[2] == "floodhuman" then | |
1401 | Spawn(message, "FloodCombat Human", "bipd", "characters\\floodcombat_human\\floodcombat_human", false) | |
1402 | elseif t[2] == "pedobear" or t[2] == "grunt" then | |
1403 | Spawn(message, "Pedobear", "bipd", "characters\\grunt\\grunt", false) | |
1404 | elseif t[2] == "hunter" then | |
1405 | Spawn(message, "Hunter", "bipd", "characters\\hunter\\hunter", false) | |
1406 | elseif t[2] == "marine" then | |
1407 | Spawn(message, "Marine", "bipd", "characters\\marine\\marine", false) | |
1408 | elseif t[2] == "marinesuicide" or t[2] == "marine2" then | |
1409 | Spawn(message, "Marine Suicidal", "bipd", "characters\\marine_suicidal\\marine_suicidal", false) | |
1410 | elseif t[2] == "monitor" then | |
1411 | Spawn(message, "Monitor", "bipd", "characters\\monitor\\monitor", false) | |
1412 | elseif t[2] == "sentinel" then | |
1413 | Spawn(message, "Sentinel", "bipd", "characters\\sentinel\\sentinel", false) | |
1414 | elseif t[2] == "johnson" then | |
1415 | Spawn(message, "Sgt. Johnson", "bipd", "characters\\johnson\\johnson", false) | |
1416 | --Objects with 'eqip' tags | |
1417 | elseif t[2] == "camo" or t[2] == "camouflage" then | |
1418 | Spawn(message, "Camouflage", "eqip", "powerups\\active camouflage", player, false) | |
1419 | elseif t[2] == "dblspd" then | |
1420 | Spawn(message, "Double Speed", "eqip", "powerups\\double speed", player, false) | |
1421 | elseif t[2] == "fullspec" then | |
1422 | Spawn(message, "Full-Spectrum Vision", "eqip", "powerups\\full-spectrum vision", player, false) | |
1423 | elseif t[2] == "fnade" or t[2] == "nades" then | |
1424 | Spawn(message, "Frag Grenade", "eqip", "weapons\\frag grenade\\frag grenade", player, false) | |
1425 | elseif t[2] == "pnade" then | |
1426 | Spawn(message, "Plasma Grenade", "eqip", "weapons\\plasma grenade\\plasma grenade", player, false) | |
1427 | elseif t[2] == "overshield" or t[2] == "os" then | |
1428 | Spawn(message, "Overshield", "eqip", "powerups\\over shield", player, false) | |
1429 | elseif t[2] == "rifleammo" then | |
1430 | Spawn(message, "Assault Rifle Ammo", "eqip", "powerups\\assault rifle ammo\\assault rifle ammo", player, false) | |
1431 | elseif t[2] == "healthpack" then | |
1432 | Spawn(message, "Health Pack", "eqip", "powerups\\health pack", player, false) | |
1433 | elseif t[2] == "needlerammo" then | |
1434 | Spawn(message, "Needler Ammo", "eqip", "powerups\\needler ammo\\needler ammo", player, false) | |
1435 | elseif t[2] == "pistolammo" then | |
1436 | Spawn(message, "Pistol Ammo", "eqip", "powerups\\pistol ammo\\pistol ammo", player, false) | |
1437 | elseif t[2] == "rocketammo" then | |
1438 | Spawn(message, "Rocket Ammo", "eqip", "powerups\\rocket launcher ammo\\rocket launcher ammo", player, false) | |
1439 | elseif t[2] == "shottyammo" then | |
1440 | Spawn(message, "Shotgun Ammo", "eqip", "powerups\\shotgun ammo\\shotgun ammo", player, false) | |
1441 | elseif t[2] == "sniperammo" then | |
1442 | Spawn(message, "Sniper Ammo", "eqip", "powerups\\sniper rifle ammo\\sniper rifle ammo", player, false) | |
1443 | elseif t[2] == "flameammo" then | |
1444 | Spawn(message, "Flamethrower Ammo", "eqip", "powerups\\flamethrower ammo\\flamethrower ammo", player, false) | |
1445 | --Objects with 'weap' tag | |
1446 | elseif t[2] == "energysword" or t[2] == "esword" then | |
1447 | Spawn(message, "Energy Sword", "weap", "weapons\\energy sword\\energy sword", false) | |
1448 | elseif t[2] == "ball" or t[2] == "oddball" then | |
1449 | Spawn(message, "Oddball", "weap", "weapons\\ball\\ball", player, false) | |
1450 | elseif t[2] == "flag" then | |
1451 | Spawn(message, "Flag", "weap", "weapons\\flag\\flag", player, false) | |
1452 | elseif t[2] == "frg" or t[2] == "fuelrod" or t[2] == "rod" or t[2] == "plasmacannon" then | |
1453 | Spawn(message, "Fuel Rod", "weap", "weapons\\plasma_cannon\\plasma_cannon", player, false) | |
1454 | elseif t[2] == "ggun" or t[2] == "gravitygun" then | |
1455 | Spawn(message, "Gravity Gun", "weap", "weapons\\gravity rifle\\gravity rifle", player, false) | |
1456 | elseif t[2] == "needler" then | |
1457 | Spawn(message, "Needler", "weap", "weapons\\needler\\mp_needler", player, false) | |
1458 | elseif t[2] == "pistol" then | |
1459 | Spawn(message, "Pistol", "weap", "weapons\\pistol\\pistol", player, false) | |
1460 | elseif t[2] == "ppistol" or t[2] == "plasmapistol" then | |
1461 | Spawn(message, "Plasma Pistol", "weap", "weapons\\plasma pistol\\plasma pistol", player, false) | |
1462 | elseif t[2] == "prifle" or t[2] == "plasmarifle" then | |
1463 | Spawn(message, "Plasma Rifle", "weap", "weapons\\plasma rifle\\plasma rifle", player, false) | |
1464 | elseif t[2] == "rifle" or t[2] == "arifle" or t[2] == "assaultrifle" then | |
1465 | Spawn(message, "Assault Rifle", "weap", "weapons\\assault rifle\\assault rifle", player, false) | |
1466 | elseif t[2] == "rocket" or t[2] == "rocketlauncher" or t[2] == "rox" then | |
1467 | Spawn(message, "Rocket Launcher", "weap", "weapons\\rocket launcher\\rocket launcher", player, false) | |
1468 | elseif t[2] == "shotty" or t[2] == "shotgun" then | |
1469 | Spawn(message, "Shotgun", "weap", "weapons\\shotgun\\shotgun", player, false) | |
1470 | elseif t[2] == "sniper" then | |
1471 | Spawn(message, "Sniper Rifle", "weap", "weapons\\sniper rifle\\sniper rifle", player, false) | |
1472 | --Objects with 'vehi' tag | |
1473 | elseif t[2] == "wraith" then | |
1474 | Spawn(message, "Wraith", "vehi", "vehicles\\wraith\\wraith", player, false) | |
1475 | elseif t[2] == "peli" or t[2] == "pelican" then | |
1476 | Spawn(message, "Pelican", "vehi", "vehicles\\pelican\\pelican", player, false) | |
1477 | elseif t[2] == "ghost" then | |
1478 | Spawn(message, "Ghost", "vehi", "vehicles\\ghost\\ghost_mp", player, false) | |
1479 | elseif t[2] == "hog" or t[2] == "warthog" then | |
1480 | Spawn(message, "Warthog", "vehi", "vehicles\\warthog\\mp_warthog", player, false) | |
1481 | elseif t[2] == "rhog" or t[2] == "rocketwarthog" then | |
1482 | Spawn(message, "Rocket Warthog", "vehi", "vehicles\\rwarthog\\rwarthog", player, false) | |
1483 | elseif t[2] == "shee" or t[2] == "banshee" then | |
1484 | Spawn(message, "Banshee", "vehi", "vehicles\\banshee\\banshee_mp", player, false) | |
1485 | elseif t[2] == "tank" or t[2] == "scorpion" then | |
1486 | Spawn(message, "Tank", "vehi", "vehicles\\scorpion\\scorpion_mp", player, false) | |
1487 | elseif t[2] == "turret" or t[2] == "shade" then | |
1488 | Spawn(message, "Gun Turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp", player, false) | |
1489 | else | |
1490 | registertimer(0, "delayMsg", "Invalid Object!", message, player) | |
1491 | end | |
1492 | else | |
1493 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1494 | end | |
1495 | elseif t[1] == "/give" then | |
1496 | if permission == 1 then | |
1497 | if t[2] == "energysword" or t[2] == "esword" or t[2] == "sword" then | |
1498 | Spawn(message, "Energy Sword", "weap", "weapons\\energy sword\\energy sword", player, true) | |
1499 | elseif t[2] == "ball" or t[2] == "oddball" then | |
1500 | Spawn(message, "Oddball", "weap", "weapons\\ball\\ball", player, true) | |
1501 | elseif t[2] == "flag" then | |
1502 | Spawn(message, "Flag", "weap", "weapons\\flag\\flag", player, true) | |
1503 | elseif t[2] == "frg" or t[2] == "fuelrod" or t[2] == "rod" or t[2] == "plasmacannon" then | |
1504 | Spawn(message, "Fuel Rod", "weap", "weapons\\plasma_cannon\\plasma_cannon", player, true) | |
1505 | elseif t[2] == "ggun" or t[2] == "gravitygun" then | |
1506 | Spawn(message, "Gravity Gun", "weap", "weapons\\gravity rifle\\gravity rifle", player, true) | |
1507 | elseif t[2] == "needler" then | |
1508 | Spawn(message, "Needler", "weap", "weapons\\needler\\mp_needler", player, true) | |
1509 | elseif t[2] == "pistol" then | |
1510 | Spawn(message, "Pistol", "weap", "weapons\\pistol\\pistol", player, true) | |
1511 | elseif t[2] == "ppistol" or t[2] == "plasmapistol" then | |
1512 | Spawn(message, "Plasma Pistol", "weap", "weapons\\plasma pistol\\plasma pistol", player, true) | |
1513 | elseif t[2] == "flamethrower" or t[2] == "flame" then | |
1514 | Spawn(message, "Flamethrower", "weap", "weapons\\flamethrower\\flamethrower", player, true) | |
1515 | elseif t[2] == "prifle" or t[2] == "plasmarifle" then | |
1516 | Spawn(message, "Plasma Rifle", "weap", "weapons\\plasma rifle\\plasma rifle", player, true) | |
1517 | elseif t[2] == "rifle" or t[2] == "arifle" or t[2] == "assaultrifle" then | |
1518 | Spawn(message, "Assault Rifle", "weap", "weapons\\assault rifle\\assault rifle", player, true) | |
1519 | elseif t[2] == "rocket" or t[2] == "rocketlauncher" or t[2] == "rox" then | |
1520 | Spawn(message, "Rocket Launcher", "weap", "weapons\\rocket launcher\\rocket launcher", player, true) | |
1521 | elseif t[2] == "shotty" or t[2] == "shotgun" then | |
1522 | Spawn(message, "Shotgun", "weap", "weapons\\shotgun\\shotgun", player, true) | |
1523 | elseif t[2] == "sniper" then | |
1524 | Spawn(message, "Sniper Rifle", "weap", "weapons\\sniper rifle\\sniper rifle", player, true) | |
1525 | else | |
1526 | registertimer(0, "delayMsg", "Invalid Object!", message, player) | |
1527 | end | |
1528 | else | |
1529 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1530 | end | |
1531 | elseif t[1] == "/st" then | |
1532 | if permission == 1 then | |
1533 | if count == 2 then | |
1534 | registertimer(0, "delayMsg", svcmd("sv_teleport_add " .. resolveplayer(player) .. " " .. t[2]), message, player) | |
1535 | elseif count == 3 then | |
1536 | registertimer(0, "delayMsg", svcmd("sv_teleport_add " .. t[2] .. " " .. t[3]), message, player) | |
1537 | else | |
1538 | registertimer(0, "delayMsg", "Invalid Syntax: /st [place]", message, player) | |
1539 | end | |
1540 | else | |
1541 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1542 | end | |
1543 | elseif t[1] == "/suspend" then | |
1544 | if permission == 1 then | |
1545 | if count == 2 then | |
1546 | registertimer(0, "delayMsg", svcmd("sv_suspend " .. t[2]), message, player) | |
1547 | elseif count == 3 then | |
1548 | registertimer(0, "delayMsg", svcmd("sv_suspend " .. t[2] .. " " .. t[3]), message, player) | |
1549 | else | |
1550 | registertimer(0, "delayMsg", "Invalid Syntax: /suspend [player] {time}", message, player) | |
1551 | end | |
1552 | else | |
1553 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1554 | end | |
1555 | elseif t[1] == "/t" then | |
1556 | if permission == 1 then | |
1557 | if count == 3 then | |
1558 | registertimer(0, "delayMsg", svcmd("sv_teleport " .. t[2] .. " " .. t[3]), message, player) | |
1559 | elseif count == 5 then | |
1560 | registertimer(0, "delayMsg", svcmd("sv_teleport " .. t[2] .. " " .. t[3] .. " " .. t[4] .. " " .. t[5]), message, player) | |
1561 | else | |
1562 | registertimer(0, "delayMsg", "Invalid Syntax: /t [player] [place]", message, player) | |
1563 | end | |
1564 | else | |
1565 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1566 | end | |
1567 | elseif t[1] == "/td" then | |
1568 | if permission == 1 then | |
1569 | if count == 2 then | |
1570 | registertimer(0, "delayMsg", svcmd("sv_teleport_del " .. t[2]), message, player) | |
1571 | else | |
1572 | registertimer(0, "delayMsg", "Invalid Syntax: /td [location]", message, player) | |
1573 | end | |
1574 | else | |
1575 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1576 | end | |
1577 | elseif t[1] == "/tp" then | |
1578 | if permission == 1 then | |
1579 | if count == 3 then | |
1580 | registertimer(0, "delayMsg", svcmd("sv_teleport_pl " .. t[2] .. " " .. t[3]), message, player) | |
1581 | else | |
1582 | registertimer(0, "delayMsg", "Invalid Syntax: /tp [player] [player]", message, player) | |
1583 | registertimer(0, "delayMsg", "If you are unsure of a command, do /help on it", message, player) | |
1584 | end | |
1585 | else | |
1586 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1587 | end | |
1588 | elseif t[1] == "/ts" then | |
1589 | if permission == 1 then | |
1590 | if count == 2 then | |
1591 | registertimer(0, "delayMsg", svcmd("sv_changeteam " .. t[2]), message, player) | |
1592 | else | |
1593 | registertimer(0, "delayMsg", "Invalid Syntax: /ts [player]", message, player) | |
1594 | end | |
1595 | else | |
1596 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1597 | end | |
1598 | elseif t[1] == "/test" then | |
1599 | if permission == 1 then | |
1600 | if count == 2 then | |
1601 | registertimer(0, "delayMsg", svcmd("sv_test " .. t[2]), message, player) | |
1602 | end | |
1603 | end | |
1604 | elseif t[1] == "/timelimit" then | |
1605 | if permission == 1 then | |
1606 | if count == 2 then | |
1607 | settimelimit(t[2]) | |
1608 | registertimer(0, "delayMsg", "Timelimit set to " .. t[2] .. " minutes!", message, player) | |
1609 | else | |
1610 | registertimer(0, "delayMsg", "Invalid Syntax: /timelimit [time]", message, player) | |
1611 | end | |
1612 | else | |
1613 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1614 | end | |
1615 | elseif t[1] == "/unhax" then | |
1616 | if permission == 1 then | |
1617 | if count == 1 then | |
1618 | registertimer(0, "delayMsg", svcmd("cheat_unhax " .. resolveplayer(player)), message, player) | |
1619 | elseif count == 2 then | |
1620 | registertimer(0, "delayMsg", svcmd("cheat_unhax " .. t[2]), message, player) | |
1621 | else | |
1622 | registertimer(0, "delayMsg", "Invalid Syntax: /unhax {player}", message, player) | |
1623 | end | |
1624 | else | |
1625 | registertimer(0, "delayMsg", "You cannot execute this command", message, player) | |
1626 | end | |
1627 | elseif t[1] == "/unmute" then | |
1628 | if permission == 1 then | |
1629 | if count == 2 then | |
1630 | registertimer(0, "delayMsg", svcmd("sv_unmute " .. t[2]), message, player) | |
1631 | else | |
1632 | registertimer(0, "delayMsg", "Invalid Syntax: /unmute [player]", message, player) | |
1633 | end | |
1634 | else | |
1635 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1636 | end | |
1637 | elseif t[1] == "/uninvis" then | |
1638 | if permission == 1 then | |
1639 | if count == 2 then | |
1640 | registertimer(0, "delayMsg", svcmd("sv_uninvis " .. t[2]), message, player) | |
1641 | else | |
1642 | registertimer(0, "delayMsg", "Invalid Syntax: /uninvis [player]", message, player) | |
1643 | end | |
1644 | else | |
1645 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1646 | end | |
1647 | elseif t[1] == "/unsuspend" then | |
1648 | if permission == 1 then | |
1649 | if count == 2 then | |
1650 | registertimer(0, "delayMsg", svcmd("sv_unsuspend " .. t[2]), message, player) | |
1651 | else | |
1652 | registertimer(0, "delayMsg", "Invalid Syntax: /unsuspend [player]", message, player) | |
1653 | end | |
1654 | else | |
1655 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1656 | end | |
1657 | elseif t[1] == "/banlist" then | |
1658 | if permission == 1 then | |
1659 | if count == 1 then | |
1660 | registertimer(0, "delayMsg", svcmd("sv_banlist"), message, player) | |
1661 | else | |
1662 | registertimer(0, "delayMsg", "Invalid Syntax: /banlist", message, player) | |
1663 | end | |
1664 | else | |
1665 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1666 | end | |
1667 | end | |
1668 | ||
1669 | end | |
1670 | ||
1671 | end | |
1672 | elseif string.sub(message, 1, 1) == "/" or string.sub(message, 1, 1) == "\\" then | |
1673 | registertimer(0, "delayMsg", "You cannot execute this command.", message, player) | |
1674 | end | |
1675 | ||
1676 | if t[1] == "/info" or t[1] == "\\info" then | |
1677 | ||
1678 | local player_number = resolveplayer(player) | |
1679 | local m_player = getplayer(player) | |
1680 | local hash = gethash(player) | |
1681 | local display = 1 | |
1682 | ||
1683 | if access ~= nil then | |
1684 | if count == 2 then | |
1685 | ||
1686 | player_number = t[2] | |
1687 | m_player = getplayer(rresolveplayer(player_number)) | |
1688 | hash = gethash(rresolveplayer(player_number)) | |
1689 | ||
1690 | if hash == 0 then | |
1691 | registertimer(0, "delayMsg", "Invalid Player", message, player) | |
1692 | display = 0 | |
1693 | end | |
1694 | ||
1695 | elseif count > 2 then | |
1696 | registertimer(0, "delayMsg", "Invalid Syntax: /info", message, player) | |
1697 | registertimer(0, "delayMsg", "Invalid Syntax: /info [player]", message, player) | |
1698 | display = 0 | |
1699 | end | |
1700 | end | |
1701 | ||
1702 | if display == 1 then | |
1703 | ||
1704 | local m_playerObjId = readdword(m_player, 0x34) | |
1705 | local m_object = getobject(m_playerObjId) | |
1706 | ||
1707 | local player_name = readstring(m_player, 0x4, 0x14) | |
1708 | local player_team = readdword(m_player, 0x20) | |
1709 | local player_respawn_time = readdword(m_player, 0x2C) | |
1710 | local player_invis_time = readword(m_player, 0x68) | |
1711 | local player_speed = readfloat(m_player, 0x6C) | |
1712 | local player_objective_mode = readbyte(m_player, 0x74) | |
1713 | local player_objective_mode2 = readbyte(m_player, 0x7A) | |
1714 | local player_killstreak = readword(m_player, 0x96) | |
1715 | local player_kills = readword(m_player, 0x9C) | |
1716 | local player_assists = readword(m_player, 0xA4) | |
1717 | local player_betrays = readword(m_player, 0xAC) | |
1718 | local player_deaths = readword(m_player, 0xAE) | |
1719 | local player_suicides = readword(m_player, 0xB0) | |
1720 | local player_ping = readword(m_player, 0xDC) | |
1721 | local player_x_coord = readfloat(m_player, 0xF8) | |
1722 | local player_y_coord = readfloat(m_player, 0xFC) | |
1723 | local player_z_coord = readfloat(m_player, 0x100) | |
1724 | ||
1725 | local obj_max_health = readfloat(m_object, 0xD8) | |
1726 | local obj_max_shields = readfloat(m_object, 0xDC) | |
1727 | local obj_health = readfloat(m_object, 0xE0) | |
1728 | local obj_shields = readfloat(m_object, 0xE4) | |
1729 | local obj_flashlight_mode = readbyte(m_object, 0x206) | |
1730 | local obj_crouch = readbyte(m_object, 0x2A0) | |
1731 | local obj_weap_type = readbyte(m_object, 0x2F2) | |
1732 | local obj_nade_type = readbyte(m_object, 0x31C) | |
1733 | local obj_primary_nades = readbyte(m_object, 0x31E) | |
1734 | local obj_secondary_nades = readbyte(m_object, 0x31F) | |
1735 | local obj_flashlight_level = readfloat(m_object, 0x344) | |
1736 | local obj_invis_scale = readfloat(m_object, 0x37C) | |
1737 | local obj_airborne = readbyte(m_object, 0x4CC) | |
1738 | ||
1739 | local obj_primary_weap_id = readdword(m_object, 0x2F8) | |
1740 | local obj_secondary_weap_id = readdword(m_object, 0x2FC) | |
1741 | local primary_weap = getobject(obj_primary_weap_id) | |
1742 | local secondary_weap = getobject(obj_secondary_weap_id) | |
1743 | ||
1744 | local m_vehicle = getobject(readdword(m_object, 0x11C)) | |
1745 | ||
1746 | if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then | |
1747 | primary_weap = getobject(readdword(m_vehicle, 0x2F8)) | |
1748 | end | |
1749 | ||
1750 | local primary_weap_heat = readfloat(primary_weap, 0x23C) | |
1751 | local primary_weap_age = readfloat(primary_weap, 0x240) | |
1752 | local primary_weap_ammo = readword(primary_weap, 0x2B6) | |
1753 | local primary_weap_clip = readword(primary_weap, 0x2B8) | |
1754 | local secondary_weap_heat = readfloat(secondary_weap, 0x23C) | |
1755 | local secondary_weap_age = readfloat(secondary_weap, 0x240) | |
1756 | local secondary_weap_ammo = readword(secondary_weap, 0x2B6) | |
1757 | local secondary_weap_clip = readword(secondary_weap, 0x2B8) | |
1758 | ||
1759 | local teamsize = getteamsize(player_team) | |
1760 | ||
1761 | if player_team == 0 then | |
1762 | player_team = "Red" | |
1763 | elseif player_team == 1 then | |
1764 | player_team = "Blue" | |
1765 | end | |
1766 | ||
1767 | if player_objective_mode == 0x22 and player_objective_mode2 == 0x71 then | |
1768 | player_objective_mode = "Hill" | |
1769 | elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x71 then | |
1770 | player_objective_mode = "Juggernaut" | |
1771 | elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x72 then | |
1772 | player_objective_mode = "It" | |
1773 | elseif player_objectivemode == 0x29 and player_objective_mode2 == 0x70 then | |
1774 | player_objective_mode = "Ball" | |
1775 | else | |
1776 | player_objective_mode = "None" | |
1777 | end | |
1778 | ||
1779 | if obj_weap_type == 2 and player_objective_mode == "None" then | |
1780 | player_objective_mode = "Flag" | |
1781 | end | |
1782 | ||
1783 | player_respawn_time = round(player_respawn_time / 30) | |
1784 | player_invis_time = round(player_invis_time / 30) | |
1785 | ||
1786 | player_betrays = player_betrays - player_suicides | |
1787 | ||
1788 | player_x_coord = round(player_x_coord) | |
1789 | player_y_coord = round(player_y_coord) | |
1790 | player_z_coord = round(player_z_coord) | |
1791 | ||
1792 | obj_invis_scale = round(obj_invis_scale * 100) | |
1793 | ||
1794 | if obj_invis_scale == 0 then | |
1795 | obj_invis_scale = "No" | |
1796 | else | |
1797 | obj_invis_scale = obj_invis_scale .. "%" | |
1798 | end | |
1799 | ||
1800 | local invis_info = "Invis: " .. obj_invis_scale | |
1801 | ||
1802 | if obj_invis_scale ~= "No" then | |
1803 | invis_info = "Invis: " .. obj_invis_scale .. " (" .. player_invis_time .. " secs)" | |
1804 | end | |
1805 | ||
1806 | if obj_flashlight_mode == 8 then | |
1807 | obj_flashlight_mode = "On" | |
1808 | else | |
1809 | obj_flashlight_mode = "Off" | |
1810 | end | |
1811 | ||
1812 | obj_flashlight_level = round(obj_flashlight_level * 100) | |
1813 | ||
1814 | if primary_weap_age == 0 then | |
1815 | if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then | |
1816 | writefloat(primary_weap, 0x240, 1) | |
1817 | primary_weap_age = 1 | |
1818 | end | |
1819 | end | |
1820 | ||
1821 | if secondary_weap_age == 0 then | |
1822 | if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then | |
1823 | writefloat(secondary_weap, 0x240, 1) | |
1824 | secondary_weap_age = 1 | |
1825 | end | |
1826 | end | |
1827 | ||
1828 | if obj_weap_type == 1 then | |
1829 | primary_weap_heat = readfloat(secondary_weap, 0x23C) | |
1830 | primary_weap_age = readfloat(secondary_weap, 0x240) | |
1831 | primary_weap_ammo = readword(secondary_weap, 0x2B6) | |
1832 | primary_weap_clip = readword(secondary_weap, 0x2B8) | |
1833 | secondary_weap_heat = readfloat(primary_weap, 0x23C) | |
1834 | secondary_weap_age = readfloat(primary_weap, 0x240) | |
1835 | secondary_weap_ammo = readword(primary_weap, 0x2B6) | |
1836 | secondary_weap_clip = readword(primary_weap, 0x2B8) | |
1837 | end | |
1838 | ||
1839 | primary_weap_heat = round(primary_weap_heat * 100) | |
1840 | primary_weap_age = round((1 - primary_weap_age) * 100) | |
1841 | secondary_weap_heat = round(secondary_weap_heat * 100) | |
1842 | secondary_weap_age = round((1 - secondary_weap_age) * 100) | |
1843 | ||
1844 | local primary_weap_info = "Primary: Empty" | |
1845 | local secondary_weap_info = "Secondary: Empty" | |
1846 | ||
1847 | if obj_health ~= 0 then | |
1848 | if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then | |
1849 | if primary_weap_age == 100 and primary_weap_ammo == 0 and primary_weap_clip == 0 then | |
1850 | primary_weap_info = "Primary: Infinite" | |
1851 | else | |
1852 | primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo | |
1853 | end | |
1854 | else | |
1855 | ||
1856 | if primary_weap ~= nil then | |
1857 | if primary_weap_age == 0 then | |
1858 | if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then | |
1859 | primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo | |
1860 | end | |
1861 | else | |
1862 | primary_weap_info = "Primary Battery: " .. primary_weap_heat .. "% / " .. primary_weap_age .. "%" | |
1863 | end | |
1864 | end | |
1865 | ||
1866 | if secondary_weap ~= nil then | |
1867 | if secondary_weap_age == 0 then | |
1868 | if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then | |
1869 | secondary_weap_info = "Secondary Ammo: " .. secondary_weap_clip .. " / " .. secondary_weap_ammo | |
1870 | end | |
1871 | else | |
1872 | secondary_weap_info = "Secondary Battery: " .. secondary_weap_heat .. "% / " .. secondary_weap_age .. "%" | |
1873 | end | |
1874 | end | |
1875 | ||
1876 | end | |
1877 | end | |
1878 | ||
1879 | local nade_info = "Frag Grenades: " .. obj_primary_nades .. " | " .. "Plasma Grenades: " .. obj_secondary_nades | |
1880 | ||
1881 | if obj_nade_type == 1 then | |
1882 | nade_info = "Plasma Grenades: " .. obj_secondary_nades .. " | " .. "Frag Grenades: " .. obj_primary_nades | |
1883 | end | |
1884 | ||
1885 | if obj_crouch == 0 then | |
1886 | obj_crouch = "Warthog: Driver" | |
1887 | elseif obj_crouch == 1 then | |
1888 | obj_crouch = "Warthog: Gunner" | |
1889 | elseif obj_crouch == 2 then | |
1890 | obj_crouch = "Warthog: Passenger" | |
1891 | elseif obj_crouch == 3 then | |
1892 | obj_crouch = "Stance: Crouching" | |
1893 | elseif obj_crouch == 4 then | |
1894 | obj_crouch = "Stance: Standing" | |
1895 | elseif obj_crouch == 5 then | |
1896 | obj_crouch = "Ghost: Driver" | |
1897 | elseif obj_crouch == 6 then | |
1898 | obj_crouch = "Banshee: Pilot" | |
1899 | elseif obj_crouch == 13 then | |
1900 | obj_crouch = "Scorpion: Driver" | |
1901 | elseif obj_crouch == 17 then | |
1902 | obj_crouch = "Shade: Gunner" | |
1903 | elseif obj_crouch == 20 or obj_crouch == 21 or obj_crouch == 22 or obj_crouch == 23 then | |
1904 | obj_crouch = "Scorpion: Passenger" | |
1905 | end | |
1906 | ||
1907 | if obj_crouch == "Stance: Crouching" or obj_crouch == "Stance: Standing" then | |
1908 | if obj_airborne == 1 then | |
1909 | obj_crouch = "Stance: Airborne" | |
1910 | end | |
1911 | end | |
1912 | ||
1913 | if obj_health == 0 and obj_shields == 0 then | |
1914 | obj_crouch = "Stance: Dead" | |
1915 | end | |
1916 | ||
1917 | obj_max_health = round(obj_health * obj_max_health) | |
1918 | obj_max_shields = round(obj_shields * obj_max_shields) | |
1919 | obj_health = round(obj_health * 100) | |
1920 | obj_shields = round(obj_shields * 100) | |
1921 | ||
1922 | local health_info = "Health: " .. obj_health .. "% (" .. obj_max_health .. ") | " .. "Shields: " .. obj_shields .. "% (" .. obj_max_shields .. ")" | |
1923 | ||
1924 | if obj_health == 0 and obj_shields == 0 and player_respawn_time ~= 0 then | |
1925 | if player_respawn_time == 1 then | |
1926 | health_info = "Respawn: " .. player_respawn_time .. " sec" | |
1927 | else | |
1928 | health_info = "Respawn: " .. player_respawn_time .. " secs" | |
1929 | end | |
1930 | end | |
1931 | ||
1932 | if suspend_table[hash] == 2 then | |
1933 | health_info = "Respawn: Never" | |
1934 | end | |
1935 | ||
1936 | privatesay(player, "----------") | |
1937 | privatesay(player, "Name: " .. player_name .. " (" .. player_number .. ") | " .. "Team: " .. player_team .. " (" .. teamsize .. ") | " .. "Speed: " .. player_speed .. " | " .. "Location: " .. player_x_coord .. ", " .. player_y_coord .. ", " .. player_z_coord) | |
1938 | privatesay(player, "Hash: " .. hash .. " | " .. "Ping: " .. player_ping .. " | " .. obj_crouch) | |
1939 | privatesay(player, "Kills: " .. player_kills .. " (" .. player_killstreak .. ") | " .. "Assists: " .. player_assists .. " | " .. "Betrays: " .. player_betrays .. " | " .. "Suicides: " .. player_suicides .. " | " .. "Deaths: " .. player_deaths) | |
1940 | privatesay(player, health_info .. " | " .. invis_info .. " | " .. "Light: " .. obj_flashlight_mode .. " (" .. obj_flashlight_level .. "%)") | |
1941 | privatesay(player, primary_weap_info .. " | " .. secondary_weap_info .. " | " .. "Objective: " .. player_objective_mode) | |
1942 | privatesay(player, nade_info) | |
1943 | privatesay(player, "----------") | |
1944 | ||
1945 | end | |
1946 | ||
1947 | end | |
1948 | ||
1949 | if mute_table[hash] ~= nil then | |
1950 | AllowChat = 0 | |
1951 | end | |
1952 | ||
1953 | if spamtimeout_table[hash] ~= nil then | |
1954 | AllowChat = 0 | |
1955 | end | |
1956 | ||
1957 | if AllowChat == 1 and access == nil then | |
1958 | if spam_table[hash] == nil then | |
1959 | spam_table[hash] = 1 | |
1960 | else | |
1961 | spam_table[hash] = spam_table[hash] + 1 | |
1962 | end | |
1963 | end | |
1964 | ||
1965 | return AllowChat | |
1966 | ||
1967 | end | |
1968 | ||
1969 | function Spawn(message, objname, objtype, objloc, player, give) | |
1970 | message = message:gsub('"', "") | |
1971 | m = {} | |
1972 | vehid = 0 | |
1973 | local count = gettokencount(message, " ") | |
1974 | ||
1975 | for i=1,count do | |
1976 | local word = gettoken(message, " ", i - 1) | |
1977 | word = string.lower(word) | |
1978 | table.insert(m, word) | |
1979 | end | |
1980 | if count == 2 then -- only spawn one next to person spawning | |
1981 | local m_player = getplayer(player) | |
1982 | local m_playerObjId = readdword(m_player, 0x34) | |
1983 | local m_object = getobject(m_playerObjId) | |
1984 | local m_vehicleId = readdword(m_object, 0x11C) | |
1985 | if m_object ~= nil then | |
1986 | if m_vehicleId ~= 0xFFFFFFFF then | |
1987 | x,y,z = getobjectcoords(m_vehicleId) | |
1988 | else | |
1989 | x,y,z = getobjectcoords(m_playerObjId) | |
1990 | local camera_x = readfloat(m_object, 0x230) | |
1991 | local camera_y = readfloat(m_object, 0x234) | |
1992 | x = x + camera_x * 2 | |
1993 | y = y + camera_y * 2 | |
1994 | z = z + 2 | |
1995 | end | |
1996 | vehid = createobject(objtype, objloc, 0, 60, false, x+1.0, y, z + 1.3) | |
1997 | if give == true then | |
1998 | assignweapon(player, vehid) | |
1999 | registertimer(0, "delayMsg", objname .. " given to " .. getname(player), message, player) | |
2000 | else | |
2001 | registertimer(0, "delayMsg", objname .. " spawned at " .. getname(player) .. "'s location", message, player) | |
2002 | end | |
2003 | else | |
2004 | registertimer(0, "delayMsg", "You cannot spawn stuff while dead!", message, player) | |
2005 | end | |
2006 | elseif count >= 3 and count <= 6 then | |
2007 | if validplayer(m[3]) ~= false then | |
2008 | for i = 1,#players do | |
2009 | local m_player = getplayer(players[i]) | |
2010 | local m_playerObjId = readdword(m_player, 0x34) | |
2011 | local m_object = getobject(m_playerObjId) | |
2012 | local m_vehicleId = readdword(m_object, 0x11C) | |
2013 | if m_object ~= nil then | |
2014 | if m_vehicleId ~= 0xFFFFFFFF and m_vehicleId ~= nil then | |
2015 | x,y,z = getobjectcoords(m_vehicleId) | |
2016 | else | |
2017 | x,y,z = getobjectcoords(m_playerObjId) | |
2018 | local camera_x = readfloat(m_object, 0x230) | |
2019 | local camera_y = readfloat(m_object, 0x234) | |
2020 | x = x + camera_x * 2 | |
2021 | y = y + camera_y * 2 | |
2022 | z = z + 2 | |
2023 | end | |
2024 | if count == 3 then | |
2025 | vehid = createobject(objtype, objloc, 0, 60, false, x, y, z) | |
2026 | if objtype == "weap" and give == true then | |
2027 | assignweapon(players[i], vehid) | |
2028 | registertimer(0, "delayMsg", objname .. " given to " .. getname(players[i]), message, player) | |
2029 | if string.sub(message, 1, 1) ~= "/" then | |
2030 | registertimer(0, "delayMsg", "You have been given a " .. objname .. ".", "\\", player) | |
2031 | end | |
2032 | else | |
2033 | registertimer(0, "delayMsg", objname .. " spawned at " .. getname(players[i]) .. "'s location.", message, player) | |
2034 | end | |
2035 | elseif count == 4 then -- specify amount | |
2036 | if m[4] ~= 0 then | |
2037 | for i = 1,m[4] do | |
2038 | createobject(objtype, objloc, 0, 0, false, x, y, z) | |
2039 | end | |
2040 | registertimer(0, "delayMsg", m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location.", message, player) | |
2041 | privatesay(players[i], objname .. " spawned above you.") | |
2042 | else | |
2043 | registertimer(0, "delayMsg", "You didn't spawn anything!") | |
2044 | end | |
2045 | elseif count == 5 then -- specify resptime | |
2046 | if m[4] ~= 0 then | |
2047 | for i = 1,m[4] do | |
2048 | createobject(objtype, objloc, 0, m[5], false, x, y, z) | |
2049 | end | |
2050 | registertimer(0, "delayMsg", m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location.", message, player) | |
2051 | privatesay(players[i], objname .. " spawned above you.") | |
2052 | else | |
2053 | registertimer(0, "delayMsg", "You didn't spawn anything!") | |
2054 | end | |
2055 | elseif count == 6 then -- specify recycle boolean | |
2056 | if m[4] ~= 0 then | |
2057 | for i = 1,m[4] do | |
2058 | createobject(objtype, objloc, 0, m[5], m[6], x, y, z) | |
2059 | end | |
2060 | registertimer(0, "delayMsg", m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location.", message, player) | |
2061 | privatesay(players[i], objname .. " spawned above you.") | |
2062 | else | |
2063 | registertimer(0, "delayMsg", "You didn't spawn anything!", message, player) | |
2064 | end | |
2065 | else | |
2066 | registertimer(0, "delayMsg", "Invalid Syntax: /spawn [object] {person} {amount} {resptime} {recycle}", message, player) | |
2067 | end | |
2068 | else | |
2069 | say("Could not spawn next to " .. getname(players[i]) ". Player is dead.") | |
2070 | end | |
2071 | end | |
2072 | ||
2073 | else | |
2074 | registertimer(5, "delayMsg", "Invalid Player!") | |
2075 | end | |
2076 | else | |
2077 | registertimer(5, "delayMsg", "Invalid Syntax: /spawn [object]") | |
2078 | registertimer(5, "delayMsg", "Invalid Syntax: /spawn [object] [person]") | |
2079 | registertimer(5, "delayMsg", "Invalid Syntax: /spawn [object] [person] [amount]") | |
2080 | registertimer(5, "delayMsg", "Invalid Syntax: /spawn [object] [person] [amount] [resptime]") | |
2081 | registertimer(5, "delayMsg", "Invalid Syntax: /spawn [object] [person] [amount] [resptime] [recycle]") | |
2082 | end | |
2083 | return vehid | |
2084 | end | |
2085 | ||
2086 | function OnServerCommand(player, command) | |
2087 | ||
2088 | local response = 1 | |
2089 | local toksize = getcmdtokencount(command) | |
2090 | local cmd = getcmdtoken(command, 0) | |
2091 | local count = gettokencount(command, " ") | |
2092 | t = {} | |
2093 | ||
2094 | for i=1,count do | |
2095 | local word = gettoken(command, " ", i - 1) | |
2096 | word = string.lower(word) | |
2097 | word = word:gsub('"', "") | |
2098 | table.insert(t, word) | |
2099 | end | |
2100 | if t[1] == "sv_afk" then | |
2101 | response = 0 | |
2102 | if count == 2 then | |
2103 | if validplayer(t[2]) ~= false then | |
2104 | for i = 1,#players do | |
2105 | local m_player = getplayer(players[i]) | |
2106 | local player_respawn_time = readdword(m_player, 0x2c) | |
2107 | if player_respawn_time >= 20 then | |
2108 | writedword(m_player, 0x2c, 1 * 33) | |
2109 | hprintf(getname(players[i]) .. " is no longer afk!") | |
2110 | else | |
2111 | kill(players[i]) | |
2112 | writedword(m_player, 0x2c, 9999 * 33) | |
2113 | hprintf(getname(players[i]) .. " is now afk!") | |
2114 | end | |
2115 | end | |
2116 | else | |
2117 | hprintf("Invalid Player!") | |
2118 | end | |
2119 | else | |
2120 | hprintf("Invalid Syntax: sv_afk {player}") | |
2121 | end | |
2122 | elseif t[1] == "sv_gethash" then | |
2123 | response = 0 | |
2124 | if count == 2 then | |
2125 | if validplayer(t[2]) ~= false then | |
2126 | for i = 1,#players do | |
2127 | hprintf(gethash(players[i])) | |
2128 | end | |
2129 | else | |
2130 | hprintf("Invalid Player!") | |
2131 | end | |
2132 | else | |
2133 | hprintf("Invalid Syntax: sv_gethash [player]") | |
2134 | end | |
2135 | elseif t[1] == "sv_help" then | |
2136 | response = 0 | |
2137 | if t[2] == "a" then | |
2138 | hprintf("Syntax: sv_a [player] [nickname] [level]") | |
2139 | hprintf("Adds a player to the admin list.") | |
2140 | elseif t[2] == "ammo" then | |
2141 | hprintf("Syntax: sv_ammo [player] [ammo]") | |
2142 | hprintf("Sets the player's primary weapon's ammo. Use * for all players.") | |
2143 | elseif t[2] == "b" then | |
2144 | hprintf("Syntax: sv_b [player] {time}") | |
2145 | hprintf("Bans a player indefinitely, or for the time specified.") | |
2146 | elseif t[2] == "c" then | |
2147 | hprintf("Syntax: sv_c [victim] [controller]") | |
2148 | hprintf("Forces the victim to move in any direction the controller is moving.") | |
2149 | elseif t[2] == "deathless" then | |
2150 | hprintf("Syntax: sv_deathless [boolean]") | |
2151 | hprintf("Will set the game so no one can die. 0 for off, 1 for on.") | |
2152 | hprintf("Using 'heal' will override this, however") | |
2153 | elseif t[2] == "e" then | |
2154 | hprintf("Syntax: sv_e [Command]") | |
2155 | hprintf("This will execute any command that you would normally put in the console.") | |
2156 | hprintf("This is also used more commonly to tell if the script is working.") | |
2157 | hprintf("Or if a player has admin.") | |
2158 | elseif t[2] == "eject" then | |
2159 | hprintf("Syntax: sv_eject [player]") | |
2160 | hprintf("Ejects a player. Use * for all players.") | |
2161 | elseif t[2] == "enter" then | |
2162 | hprintf("Syntax: sv_enter [player] [seat]") | |
2163 | hprintf("Will cause you to enter the player's vehicle, and the seat specified.") | |
2164 | elseif t[2] == "getloc" then | |
2165 | hprintf("Syntax: sv_getloc [player]") | |
2166 | hprintf("Will display the location of the player specified.") | |
2167 | elseif t[2] == "godmode" then | |
2168 | hprintf("Syntax: sv_godmode [player]") | |
2169 | hprintf("Will make this person unkillable. Backtaps, however, will still kill them.") | |
2170 | elseif t[2] == "hax" then | |
2171 | hprintf("Syntax: sv_hax") | |
2172 | hprintf("I made this command because I was bored.") | |
2173 | elseif t[2] == "heal" then | |
2174 | hprintf("Syntax: sv_heal [player]") | |
2175 | hprintf("Will heal the specified player.") | |
2176 | elseif t[2] == "help" then | |
2177 | hprintf("Syntax: sv_help [Command]") | |
2178 | hprintf("Will provide details on any specified command.") | |
2179 | hprintf("Do not include sv_ or \ for the [Command]") | |
2180 | elseif t[2] == "hitler" then | |
2181 | hprintf("Syntax: sv_hitler") | |
2182 | hprintf("Will lethaly inject everyone.") | |
2183 | elseif t[2] == "infammo" then | |
2184 | hprintf("Syntax: sv_infammo [boolean]") | |
2185 | hprintf("Will set the game so everyone has infinite ammo. 0 for off, 1 for on") | |
2186 | elseif t[2] == "give" then | |
2187 | hprintf("Syntax: sv_give [weapon] {player}") | |
2188 | hprintf("Will give yourself, or the person specified, a weapon.") | |
2189 | hprintf("You can hold up to 4 weapons. If you are holding 4 weapons,") | |
2190 | hprintf("you cannot pickup the flag, or the oddball.") | |
2191 | elseif t[2] == "gethash" then | |
2192 | hprintf("Syntax: sv_gethash [player]") | |
2193 | hprintf("This will get the hash of the player specified.") | |
2194 | elseif t[2] == "invis" then | |
2195 | hprintf("Syntax: sv_invis [player] {time}") | |
2196 | hprintf("This will camouflage the person specified for the amount of time specified.") | |
2197 | elseif t[2] == "j" then | |
2198 | hprintf("Syntax: sv_j [player] [x] [y] [z]") | |
2199 | hprintf("Moves the specified player by coords specified.") | |
2200 | elseif t[2] == "k" then | |
2201 | hprintf("Syntax: sv_k [player]") | |
2202 | hprintf("Will kick the player specified.") | |
2203 | elseif t[2] == "kill" then | |
2204 | hprintf("Syntax: sv_kill [player]") | |
2205 | hprintf("Will kill the player specified.") | |
2206 | elseif t[2] == "lo3" then | |
2207 | hprintf("Syntax: sv_lo3") | |
2208 | hprintf("Will lo3 the game.") | |
2209 | elseif t[2] == "m" then | |
2210 | hprintf("Syntax: sv_m [map] [gametype] {script} {script2} . . .") | |
2211 | hprintf("Will load the map specified. No need to specify chatcommands script.") | |
2212 | elseif t[2] == "mc" then | |
2213 | hprintf("Syntax: sv_mc") | |
2214 | hprintf("Starts the mapcycle.") | |
2215 | elseif t[2] == "mnext" then | |
2216 | hprintf("Syntax: sv_mnext") | |
2217 | hprintf("Loads the next map in the mapcycle.") | |
2218 | elseif t[2] == "mute" then | |
2219 | hprintf("Syntax: sv_mute [player] {time}") | |
2220 | hprintf("Mutes the player. Admins cannot be muted.") | |
2221 | elseif t[2] == "pass" then | |
2222 | hprintf("Syntax: sv_pass [password]") | |
2223 | hprintf("Sets the server password.") | |
2224 | elseif t[2] == "reset" then | |
2225 | hprintf("Syntax: sv_reset") | |
2226 | hprintf("Resets the map.") | |
2227 | elseif t[2] == "resp" then | |
2228 | hprintf("Syntax: sv_resp [player] [time]") | |
2229 | hprintf("Sets respawn time of player. Only works if player is dead.") | |
2230 | elseif t[2] == "say" then | |
2231 | hprintf("Syntax: sv_say [message]") | |
2232 | hprintf("Will say something as the server. No quotes needed.") | |
2233 | elseif t[2] == "sc" then | |
2234 | hprintf("Syntax: sv_sc [player] [nickname]") | |
2235 | hprintf("Will set the player's nickname. Used instead of player IDs") | |
2236 | elseif t[2] == "setassists" then | |
2237 | hprintf("Syntax: sv_setassists [player] [# of assists]") | |
2238 | hprintf("Will set the assists of the player specified.") | |
2239 | elseif t[2] == "setdeaths" then | |
2240 | hprintf("Syntax: sv_setdeaths [player] [# of deaths]") | |
2241 | hprintf("Will set the deaths of the player specified.") | |
2242 | elseif t[2] == "setfrags" then | |
2243 | hprintf("Syntax: sv_setfrags [player] [# of frags]") | |
2244 | hprintf("Will set the # of frag grenades of the player specified.") | |
2245 | elseif t[2] == "setkills" then | |
2246 | hprintf("Syntax: sv_setkills [player] [# of kills]") | |
2247 | hprintf("Will set the kills of the player specified.") | |
2248 | elseif t[2] == "setname" then | |
2249 | hprintf("Syntax: sv_setname [player] [name]") | |
2250 | hprintf("Sets the name of the player specified.") | |
2251 | hprintf("You will only notice a difference on rejoin.") | |
2252 | elseif t[2] == "setresp" then | |
2253 | hprintf("Syntax: sv_setresp [time]") | |
2254 | hprintf("Sets the universal respawn time of all mapssv_gametypes.") | |
2255 | elseif t[2] == "setplasmas" then | |
2256 | hprintf("Syntax: sv_setplasmas [player] [# of plasma grenades]") | |
2257 | hprintf("Will set the plasma grenades of the player specified.") | |
2258 | elseif t[2] == "spd" then | |
2259 | hprintf("Syntax: sv_spd [player] [speed]") | |
2260 | hprintf("Will set the speed of the player specified.") | |
2261 | elseif t[2] == "spawn" then | |
2262 | hprintf("Syntax: sv_spawn [object] {player} {ammount} {resptime} {recycle}") | |
2263 | hprintf("Will spawn a object over a player if specified.") | |
2264 | elseif t[2] == "st" then | |
2265 | hprintf("Syntax: sv_st [location]") | |
2266 | hprintf("Will set a teleport location to wherever you're standing.") | |
2267 | elseif t[2] == "suspend" then | |
2268 | hprintf("Syntax: sv_suspend [player] {time}") | |
2269 | hprintf("Will suspend the player for the time specified.") | |
2270 | elseif t[2] == "t" then | |
2271 | hprintf("Syntax: sv_t [player] [location]") | |
2272 | hprintf("Will teleport the player specified to the location specified.") | |
2273 | elseif t[2] == "td" then | |
2274 | hprintf("Syntax: sv_td [location]") | |
2275 | hprintf("Will delete the teleport location specified.") | |
2276 | elseif t[2] == "test" then | |
2277 | hprintf("Syntax: sv_test [player]") | |
2278 | hprintf("I used this to randomly see the returns of some addresses and offsets.") | |
2279 | elseif t[2] == "tp" then | |
2280 | hprintf("Syntax: sv_tp [player] [t_player]") | |
2281 | hprintf("Will teleport player to t_player") | |
2282 | elseif t[2] == "ts" then | |
2283 | hprintf("Syntax: sv_changeteam [player] {team}") | |
2284 | hprintf("Will switch the players team. Teams are 0 and 1") | |
2285 | elseif t[2] == "unhax" then | |
2286 | hprintf("Syntax: sv_unhax") | |
2287 | hprintf("Unhax's you. I was bored, what can i say?") | |
2288 | elseif t[2] == "unmute" then | |
2289 | hprintf("Syntax: sv_unmute [player]") | |
2290 | hprintf("Unmutes the player specified.") | |
2291 | elseif t[2] == "unsuspend" then | |
2292 | hprintf("Syntax: sv_unsuspend [player]") | |
2293 | hprintf("Unsuspends the player specified.") | |
2294 | elseif t[2] == "credits" then | |
2295 | hprintf("Created by [DWM]Wizard") | |
2296 | hprintf("Base script created by Smiley") | |
2297 | else | |
2298 | hprintf("Invalid Command! Use sv_list for list of commands!") | |
2299 | end | |
2300 | elseif t[1] == "sv_deathless" then | |
2301 | response = 0 | |
2302 | if count == 1 then | |
2303 | if deathless == 1 then | |
2304 | hprintf("Deathless is currently enabled.") | |
2305 | else | |
2306 | hprintf("Deathless is currently disabled") | |
2307 | end | |
2308 | elseif count == 2 then | |
2309 | if (t[2] == "1" or t[2] == "true") and deathless ~= 1 then | |
2310 | for c = 0,15 do | |
2311 | if getplayer(c) ~= nil then | |
2312 | local m_player = getplayer(c) | |
2313 | local m_playerObjId = readdword(m_player, 0x34) | |
2314 | local m_object = getobject(m_playerObjId) | |
2315 | local obj_health = readfloat(m_object, 0xE0) | |
2316 | local obj_shields = readfloat(m_object, 0xE4) | |
2317 | writefloat(m_object, 0xE0, 99999999) | |
2318 | writefloat(m_object, 0xE4, 99999999) | |
2319 | end | |
2320 | end | |
2321 | hprintf("Deathless player is now on. You cannot die.") | |
2322 | deathless = 1 | |
2323 | elseif t[2] == "1" or t[2] == "true" then | |
2324 | hprintf("Deathless is already enabled!") | |
2325 | elseif (t[2] == "0" or t[2] == "false") and deathless ~= 0 then | |
2326 | local c = 0 | |
2327 | for c = 0,15 do | |
2328 | if getplayer(c) ~= nil then | |
2329 | local m_player = getplayer(c) | |
2330 | local m_playerObjId = readdword(m_player, 0x34) | |
2331 | local m_object = getobject(m_playerObjId) | |
2332 | local obj_health = readfloat(m_object, 0xE0) | |
2333 | local obj_shields = readfloat(m_object, 0xE4) | |
2334 | writefloat(m_object, 0xE0, 1) | |
2335 | writefloat(m_object, 0xE4, 1) | |
2336 | end | |
2337 | end | |
2338 | hprintf("Deathless player is now off.") | |
2339 | deathless = 0 | |
2340 | elseif t[2] == "0" or t[2] == "false" then | |
2341 | hprintf("Deathless is already disabled!") | |
2342 | else | |
2343 | hprintf("Invalid Boolean: 0 for false, 1 for true") | |
2344 | end | |
2345 | else | |
2346 | hprintf("Invalid Syntax: sv_deathless {boolean}") | |
2347 | end | |
2348 | elseif t[1] == "sv_setmode" then | |
2349 | response = 0 | |
2350 | if validplayer(t[2]) ~= false then | |
2351 | if count == 3 then | |
2352 | for i = 1,#players do | |
2353 | if t[3] == "destroy" then | |
2354 | mode[gethash(players[i])] = "destroy" | |
2355 | hprintf(getname(players[i]) .. " is now in destroy mode!") | |
2356 | elseif t[3] == "portalgun" then | |
2357 | mode[gethash(players[i])] = "portalgun" | |
2358 | hprintf(getname(players[i]) .. " is now in portalgun mode!") | |
2359 | elseif t[3] == "entergun" then | |
2360 | mode[gethash(players[i])] = "entergun" | |
2361 | hprintf(getname(players[i]) .. " is now in entergun mode!") | |
2362 | elseif t[3] == "controlgun" then | |
2363 | mode[gethash(players[i])] = "controlgun" | |
2364 | hprintf(getname(players[i]) .. " is now in controlgun mode!") | |
2365 | elseif t[3] == "normal" or t[3] == "none" or t[3] == "regular" then | |
2366 | objspawntype[gethash(players[i])] = nil | |
2367 | objspawntag[gethash(players[i])] = nil | |
2368 | mode[gethash(players[i])] = nil | |
2369 | hprintf(getname(players[i]) .. " is now in normal mode!") | |
2370 | end | |
2371 | end | |
2372 | elseif count == 4 then | |
2373 | for i = 1,#players do | |
2374 | if t[3] == "spawngun" then | |
2375 | local objexists = false | |
2376 | objspawntype[gethash(players[i])] = nil | |
2377 | objspawntag[gethash(players[i])] = nil | |
2378 | mode[gethash(players[i])] = nil | |
2379 | for j = 1,#objects do | |
2380 | if t[4] == objects[j][1] then | |
2381 | mode[gethash(players[i])] = "spawngun" | |
2382 | objspawntype[gethash(players[i])] = objects[j][2] | |
2383 | objspawntag[gethash(players[i])] = objects[j][3] | |
2384 | hprintf(getname(players[i]) .. " is now spawning " .. objects[j][3] .. "!") | |
2385 | objexists = true | |
2386 | break | |
2387 | end | |
2388 | end | |
2389 | if objexists == false then | |
2390 | hprintf("Object does not exist. Make sure you are spelling it right.") | |
2391 | end | |
2392 | end | |
2393 | end | |
2394 | else | |
2395 | hprintf("Invalid Syntax: sv_setmode [player] [mode] {object}") | |
2396 | end | |
2397 | else | |
2398 | say("Invalid Player!") | |
2399 | end | |
2400 | elseif t[1] == "sv_eject" then | |
2401 | response = 0 | |
2402 | if count == 2 then | |
2403 | if validplayer(t[2]) ~= false then | |
2404 | for i = 1,#players do | |
2405 | local player_struct = getplayer(players[i]) | |
2406 | local player_respawn_time = readdword(player_struct, 0x2c) | |
2407 | local player_obj_struct = getobject(getplayerobjectid(players[i])) | |
2408 | local player_vehicle_id = readdword(player_obj_struct, 0x11C) | |
2409 | if player_obj_struct ~= nil and player_respawn_time == 0 then | |
2410 | if player_vehicle_id ~= 0xffffffff then | |
2411 | exitvehicle(players[i]) | |
2412 | hprintf("Ejecting " .. getname(players[i]) .. " from his/her vehicle!") | |
2413 | else | |
2414 | hprintf("Error! " .. getname(players[i]) .. " is not in a vehicle!") | |
2415 | end | |
2416 | else | |
2417 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2418 | end | |
2419 | end | |
2420 | else | |
2421 | hprintf("Invalid Player") | |
2422 | end | |
2423 | else | |
2424 | hprintf("Invalid Syntax: sv_eject [player]") | |
2425 | end | |
2426 | elseif t[1] == "sv_getloc" then | |
2427 | response = 0 | |
2428 | if count == 2 then | |
2429 | if validplayer(t[2]) ~= false then | |
2430 | for i = 1,#players do | |
2431 | local m_playerObjId = getplayerobjectid(players[i]) | |
2432 | if getobject(m_playerObjId) ~= nil then | |
2433 | local x,y,z = getobjectcoords(m_playerObjId) | |
2434 | hprintf(getname(players[i]) .. "'s coords are: X: " .. x .. " Y: " .. y .. " Z: " .. z) | |
2435 | else | |
2436 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2437 | end | |
2438 | end | |
2439 | else | |
2440 | hprintf("Invalid Player!") | |
2441 | end | |
2442 | else | |
2443 | hprintf("Invalid Syntax: sv_getloc [player]") | |
2444 | end | |
2445 | elseif t[1] == "sv_ghost" then | |
2446 | response = 0 | |
2447 | if count == 1 then | |
2448 | local m_object = getobject(getplayerobjectid(player)) | |
2449 | if m_object ~= nil then | |
2450 | writebit(m_object, 0x10, 7, 1) | |
2451 | hprintf("You are now a ghost!") | |
2452 | else | |
2453 | hprintf("You cannot become a ghost while dead!") | |
2454 | end | |
2455 | elseif count == 2 then | |
2456 | if validplayer(t[2]) ~= false then | |
2457 | for i = 1,#players do | |
2458 | local m_object = getobject(getplayerobjectid(players[i])) | |
2459 | if m_object ~= nil then | |
2460 | writebit(m_object, 0x10, 7, 1) | |
2461 | hprintf(getname(players[i]) .. " is now a ghost!") | |
2462 | privatesay(players[i], "You are now a ghost.") | |
2463 | else | |
2464 | hprintf("You cannot ghost " .. getname(players[i]) .. " because " .. getname(players[i]) .. " is dead!") | |
2465 | end | |
2466 | end | |
2467 | else | |
2468 | hprintf("Invalid Player!") | |
2469 | end | |
2470 | else | |
2471 | hprintf("Invalid Syntax: sv_ghost {player}") | |
2472 | end | |
2473 | elseif t[1] == "sv_unghost" then | |
2474 | response = 0 | |
2475 | if count == 1 then | |
2476 | local m_object = getobject(getplayerobjectid(player)) | |
2477 | if m_object ~= nil then | |
2478 | writebit(m_object, 0x10, 7, 0) | |
2479 | hprintf("You are no longer a ghost.") | |
2480 | else | |
2481 | hprintf("You cannot unghost while dead!") | |
2482 | end | |
2483 | elseif count == 2 then | |
2484 | if validplayer(t[2]) ~= false then | |
2485 | for i = 1,#players do | |
2486 | local m_object = getobject(getplayerobjectid(players[i])) | |
2487 | if m_object ~= nil then | |
2488 | writebit(m_object, 0x10, 7, 0) | |
2489 | hprintf(getname(players[i]) .. " is no longer a ghost!") | |
2490 | privatesay(players[i], "You are no longer a ghost.") | |
2491 | else | |
2492 | hprintf("You cannot unghost " .. getname(players[i]) .. " because " .. getname(players[i]) .. " is dead!") | |
2493 | end | |
2494 | end | |
2495 | else | |
2496 | hprintf("Invalid Player!") | |
2497 | end | |
2498 | else | |
2499 | hprintf("Invalid Syntax: sv_unghost {player}") | |
2500 | end | |
2501 | elseif t[1] == "sv_setgod" then | |
2502 | response = 0 | |
2503 | if count == 2 then | |
2504 | if deathless ~= 1 then | |
2505 | if validplayer(t[2]) ~= false then | |
2506 | for i = 1,#players do | |
2507 | local m_player = getplayer(players[i]) | |
2508 | local m_playerObjId = readdword(m_player, 0x34) | |
2509 | local m_object = getobject(m_playerObjId) | |
2510 | if m_object ~= nil then | |
2511 | local obj_health = readfloat(m_object, 0xE0) | |
2512 | local obj_shields = readfloat(m_object, 0xE4) | |
2513 | writefloat(m_object, 0xE0, 99999999) | |
2514 | writefloat(m_object, 0xE4, 99999999) | |
2515 | hprintf(getname(players[i]) .. " has been given godmode!") | |
2516 | privatesay(players[i], "You have been given godmode.") | |
2517 | else | |
2518 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2519 | end | |
2520 | end | |
2521 | else | |
2522 | hprintf("Invalid Player") | |
2523 | end | |
2524 | else | |
2525 | hprintf("Deathless is enabled! You cannot give out godmode!") | |
2526 | end | |
2527 | else | |
2528 | hprintf("Invalid Syntax: sv_setgod [player]") | |
2529 | end | |
2530 | elseif t[1] == "cheat_hax" then | |
2531 | response = 0 | |
2532 | if count == 2 then | |
2533 | if validplayer(t[2]) ~= false then | |
2534 | for i = 1,#players do | |
2535 | local m_player = getplayer(players[i]) | |
2536 | writeword(m_player, 0x9C, 9999) | |
2537 | writeword(m_player, 0xA4, 9999) | |
2538 | writeword(m_player, 0xAC, 9999) | |
2539 | writeword(m_player, 0xAE, 9999) | |
2540 | writeword(m_player, 0xB0, 9999) | |
2541 | privatesay(players[i], "You have been haxed!") | |
2542 | end | |
2543 | end | |
2544 | else | |
2545 | hprintf("Invalid Syntax: cheat_hax [player]") | |
2546 | end | |
2547 | elseif t[1] == "sv_heal" then | |
2548 | response = 0 | |
2549 | if count == 2 then | |
2550 | if validplayer(t[2]) ~= false then | |
2551 | for i = 1,#players do | |
2552 | local m_player = getplayer(players[i]) | |
2553 | local m_playerObjId = readdword(m_player, 0x34) | |
2554 | local m_object = getobject(m_playerObjId) | |
2555 | if m_object ~= nil then | |
2556 | local obj_health = readfloat(m_object, 0xE0) | |
2557 | local obj_shields = readfloat(m_object, 0xE4) | |
2558 | writefloat(m_object, 0xE0, 1) | |
2559 | writefloat(m_object, 0xE4, 1) | |
2560 | hprintf(getname(players[i]) .. " has been healed!") | |
2561 | privatesay(players[i], "You have been healed!") | |
2562 | else | |
2563 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2564 | end | |
2565 | end | |
2566 | else | |
2567 | hprintf("Invalid Player") | |
2568 | end | |
2569 | else | |
2570 | hprintf("Invalid Syntax: sv_heal [player]") | |
2571 | end | |
2572 | elseif t[1] == "sv_ungod" then | |
2573 | response = 0 | |
2574 | if count == 2 then | |
2575 | if validplayer(t[2]) ~= false then | |
2576 | for i = 1,#players do | |
2577 | local m_player = getplayer(players[i]) | |
2578 | local m_playerObjId = readdword(m_player, 0x34) | |
2579 | local m_object = getobject(m_playerObjId) | |
2580 | local obj_health = readfloat(m_object, 0xE0) | |
2581 | local obj_shields = readfloat(m_object, 0xE4) | |
2582 | writefloat(m_object, 0xE0, 1) | |
2583 | writefloat(m_object, 0xE4, 1) | |
2584 | hprintf(getname(players[i]) .. " is no longer in godmode") | |
2585 | privatesay(players[i], "You are no longer in godmode.") | |
2586 | end | |
2587 | else | |
2588 | hprintf("Invalid Player") | |
2589 | end | |
2590 | else | |
2591 | hprintf("Invalid Syntax: sv_ungod [player]") | |
2592 | end | |
2593 | elseif t[1] == "sv_hitler" then | |
2594 | response = 0 | |
2595 | if count == 1 then | |
2596 | local c = 0 | |
2597 | for c = 0,15 do | |
2598 | if getplayer(c) ~= nil then | |
2599 | kill(c) | |
2600 | hprintf(getname(c) .. " was given a lethal injection!") | |
2601 | end | |
2602 | end | |
2603 | else | |
2604 | hprintf("Invalid Syntax: sv_hitler") | |
2605 | end | |
2606 | elseif t[1] == "sv_infinite_ammo" then | |
2607 | response = 0 | |
2608 | if count == 1 then | |
2609 | if infammo == 1 then | |
2610 | hprintf("Infinite ammo is currently enabled") | |
2611 | elseif infammo == 0 then | |
2612 | hprintf("Infinite ammo is currently disabled") | |
2613 | end | |
2614 | elseif count == 2 then | |
2615 | if t[2] == "1" and infammo ~= 1 then | |
2616 | for c = 0,15 do | |
2617 | if getplayer(c) ~= nil then | |
2618 | local m_player = getplayer(c) | |
2619 | local m_ObjId = readdword(m_player, 0x34) | |
2620 | local m_Object = getobject(m_ObjId) | |
2621 | if m_player ~= nil and m_Object ~= nil then | |
2622 | for i = 0, 3 do | |
2623 | local m_weaponId = readdword(m_Object, 0x2F8 + (i*4)) | |
2624 | if m_weaponId ~= -1 then | |
2625 | local m_weapon = getobject(m_weaponId) | |
2626 | writeword(m_weapon, 0x2B6, 9999) -- unloaded clip to 9999 | |
2627 | --writeword(m_weapon, 0x2B8, 9999) -- loaded clip to 9999 | |
2628 | --updateammo(m_weaponId) | |
2629 | end | |
2630 | end | |
2631 | end | |
2632 | end | |
2633 | end | |
2634 | infammo = 1 | |
2635 | hprintf("Infinite Ammo is now enabled!") | |
2636 | elseif t[2] == "1" then | |
2637 | hprintf("Infammo is already enabled!") | |
2638 | elseif t[2] ~= "0" then | |
2639 | hprintf("Invalid Boolean: 0 for false, 1 for true") | |
2640 | elseif t[2] == "0" and infammo ~= 0 then | |
2641 | if nadetimer ~= nil then | |
2642 | removetimer(nadetimer) | |
2643 | end | |
2644 | for c = 0,15 do | |
2645 | if getplayer(c) ~= nil then | |
2646 | local m_player = getplayer(c) | |
2647 | local m_ObjId = readdword(m_player, 0x34) | |
2648 | local m_Object = getobject(m_ObjId) | |
2649 | if m_player ~= nil and m_Object ~= nil then | |
2650 | for i = 0, 3 do | |
2651 | local m_weaponId = readdword(m_Object, 0x2F8 + (i*4)) | |
2652 | if m_weaponId ~= -1 then | |
2653 | local m_weapon = getobject(m_weaponId) | |
2654 | writeword(m_weapon, 0x2B6, 20) -- unloaded clip to 20 | |
2655 | writeword(m_weapon, 0x2B8, 3) | |
2656 | end | |
2657 | end | |
2658 | writebyte(m_Object, 0x31E, 4) -- set frags to 4 | |
2659 | writebyte(m_Object, 0x31F, 4) -- set plasmas to 4 | |
2660 | end | |
2661 | end | |
2662 | end | |
2663 | infammo = 0 | |
2664 | hprintf("Infinite Ammo is now disabled!") | |
2665 | elseif t[2] == "0" then | |
2666 | hprintf("Infammo is already disabled!") | |
2667 | else | |
2668 | hprintf("Invalid Boolean: 0 for false, 1 for true") | |
2669 | end | |
2670 | else | |
2671 | hprintf("Invalid Syntax: sv_infinite_ammo [boolean]") | |
2672 | end | |
2673 | elseif t[1] == "sv_invis" then | |
2674 | response = 0 | |
2675 | if count == 2 then | |
2676 | if validplayer(t[2]) ~= false then | |
2677 | for i = 1,#players do | |
2678 | if getobject(getplayerobjectid(players[i])) ~= nil then | |
2679 | applycamo(players[i], 0) | |
2680 | hprintf(getname(players[i]) .. " is now invisible!") | |
2681 | privatesay(players[i], "You are now invisible until you die.") | |
2682 | else | |
2683 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2684 | end | |
2685 | end | |
2686 | else | |
2687 | hprintf("Invalid Player") | |
2688 | end | |
2689 | elseif count == 3 then | |
2690 | if validplayer(t[2]) ~= false then | |
2691 | for i = 1,#players do | |
2692 | applycamo(players[i], t[3]) | |
2693 | hprintf(getname(players[i]) .. " is now invisible for " .. t[3] .. " seconds!") | |
2694 | privatesay(players[i], "You are now invisible for " .. t[3] .. " seconds.") | |
2695 | end | |
2696 | else | |
2697 | hprintf("Invalid Player") | |
2698 | end | |
2699 | else | |
2700 | hprintf("Invalid Syntax: sv_invis [player]") | |
2701 | hprintf("Invalid Syntax: sv_invis [player] [time]") | |
2702 | end | |
2703 | elseif t[1] == "sv_move" then | |
2704 | response = 0 | |
2705 | if count == 5 then | |
2706 | if validplayer(t[2]) ~= false then | |
2707 | for i = 1,#players do | |
2708 | local m_playerObjId = getplayerobjectid(players[i]) | |
2709 | if m_playerObjId ~= 0xFFFFFFFF then | |
2710 | local m_objectId = 0xFFFFFFFF | |
2711 | local m_vehicleId = readdword(getobject(m_playerObjId), 0x11C) | |
2712 | if m_vehicleId ~= 0xFFFFFFFF then | |
2713 | m_objectId = m_vehicleId | |
2714 | elseif m_playerObjId ~= 0xFFFFFFFF then | |
2715 | m_objectId = m_playerObjId | |
2716 | end | |
2717 | if m_objectId ~= 0xFFFFFFFF then | |
2718 | local x,y,z = getobjectcoords(m_objectId) | |
2719 | movobjcoords(m_objectId, x+t[3], y+t[4], z+t[5]) | |
2720 | hprintf(getname(players[i]) .. " has been moved!") | |
2721 | end | |
2722 | else | |
2723 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2724 | end | |
2725 | end | |
2726 | else | |
2727 | hprintf("Invalid Player") | |
2728 | end | |
2729 | else | |
2730 | hprintf("Invalid Syntax: sv_move [player] [x] [y] [z]") | |
2731 | end | |
2732 | elseif t[1] == "sv_scrim" then | |
2733 | response = 0 | |
2734 | if count == 1 then | |
2735 | lo3timer = registertimer(2000, "lo3Timer") | |
2736 | hprintf("Live on three.") | |
2737 | else | |
2738 | hprintf("Invalid Syntax: SV_scrim") | |
2739 | end | |
2740 | elseif t[1] == "sv_mute" then | |
2741 | response = 0 | |
2742 | if count == 2 then | |
2743 | local mute = nil | |
2744 | for k,v in pairs(admin_table) do | |
2745 | if k == hash2 then | |
2746 | mute = 1 | |
2747 | break | |
2748 | end | |
2749 | end | |
2750 | if validplayer(t[2]) ~= false then | |
2751 | for i = 1,#players do | |
2752 | if mute == nil then | |
2753 | if mute_table[gethash(players[i])] == nil and spamtimeout_table[gethash(players[i])] == nil then | |
2754 | mute_table[gethash(players[i])] = 1 | |
2755 | hprintf(getname(players[i]) .. " was muted by an admin!") | |
2756 | else | |
2757 | hprintf(getname(players[i]) .. " has already been muted.") | |
2758 | end | |
2759 | else | |
2760 | hprintf("Admins cannot be muted.") | |
2761 | end | |
2762 | end | |
2763 | else | |
2764 | hprintf("Invalid Player") | |
2765 | end | |
2766 | else | |
2767 | hprintf("Invalid Syntax: sv_mute [player]") | |
2768 | end | |
2769 | elseif t[1] == "sv_noweapons" then | |
2770 | response = 0 | |
2771 | if count == 2 then | |
2772 | if t[2] == "1" and noweapons ~= 1 then | |
2773 | for c = 0,15 do | |
2774 | if getplayer(c) ~= nil and getobject(getplayerobjectid(player)) ~= nil then | |
2775 | local m_player = getplayer(c) | |
2776 | local m_playerObjId = readdword(m_player, 0x34) | |
2777 | local m_object = getobject(m_playerObjId) | |
2778 | local obj_primary_weap_id = readdword(m_object, 0x2F8) | |
2779 | local obj_secondary_weap_id = readdword(m_object, 0x2FC) | |
2780 | local obj_ternary_weap_id = readdword(m_object, 0x300) | |
2781 | local obj_quartary_weap_id = readdword(m_object, 0x304) | |
2782 | if obj_primary_weap_id ~= 4294967295 then | |
2783 | destroyobject(obj_primary_weap_id) | |
2784 | end | |
2785 | if obj_secondary_weap_id ~= 4294967295 then | |
2786 | destroyobject(obj_secondary_weap_id) | |
2787 | end | |
2788 | if obj_ternary_weap_id ~= 4294967295 then | |
2789 | destroyobject(obj_ternary_weap_id) | |
2790 | end | |
2791 | if obj_quartary_weap_id ~= 4294967295 then | |
2792 | destroyobject(obj_quartary_weap_id) | |
2793 | end | |
2794 | end | |
2795 | end | |
2796 | hprintf("Noweapons is now on. You cannot pick up weapons.") | |
2797 | noweapons = 1 | |
2798 | elseif t[2] == "1" then | |
2799 | hprintf("Noweapons is already enabled!") | |
2800 | elseif t[2] ~= "0" then | |
2801 | hprintf("Invalid Boolean: 0 for false, 1 for true") | |
2802 | elseif t[2] == "0" and noweapons ~= 0 then | |
2803 | local c = 0 | |
2804 | for c = 0,15 do | |
2805 | if getplayer(c) ~= nil and getobject(getplayerobjectid(c)) ~= nil then | |
2806 | resetweapons(c) | |
2807 | end | |
2808 | end | |
2809 | hprintf("Noweapons is now off.") | |
2810 | noweapons = 0 | |
2811 | elseif t[2] == "0" then | |
2812 | hprintf("Noweapons is already disabled!") | |
2813 | else | |
2814 | hprintf("Invalid Boolean: 0 for false, 1 for true") | |
2815 | end | |
2816 | else | |
2817 | hprintf("Invalid Syntax: sv_noweapons [boolean]") | |
2818 | end | |
2819 | elseif t[1] == "sv_resp" then | |
2820 | response = 0 | |
2821 | if count == 3 then | |
2822 | if validplayer(t[2]) ~= false then | |
2823 | for i = 1,#players do | |
2824 | local m_player = getplayer(players[i]) | |
2825 | local player_respawn_time = readdword(m_player, 0x2C) | |
2826 | writedword(m_player, 0x2c, t[3] * 33) | |
2827 | hprintf("Setting " .. getname(players[i]) .. "'s respawn time to " .. t[3] .. " seconds!") | |
2828 | end | |
2829 | else | |
2830 | hprintf("Invalid Player") | |
2831 | end | |
2832 | else | |
2833 | hprintf("Invalid Syntax sv_resp [player] [respawn time]") | |
2834 | end | |
2835 | elseif t[1] == "sv_enter" then | |
2836 | response = 0 | |
2837 | if count == 3 then | |
2838 | if validplayer(t[3]) ~= false then | |
2839 | for i = 1,#players do | |
2840 | local vehid = nil | |
2841 | if t[2] == "wraith" then | |
2842 | vehid = Spawn(command, "Wraith", "vehi", "vehicles\\wraith\\wraith", players[i]) | |
2843 | elseif t[2] == "lifepod" then | |
2844 | vehid = Spawn(command, "Lifepod", "vehi", "vehicles\\lifepod\\lifepod", players[i]) | |
2845 | elseif t[2] == "longsword" then | |
2846 | vehid = Spawn(command, "Longsword", "vehi", "vehicles\\fighterbomber\\fighterbomber", players[i]) | |
2847 | elseif t[2] == "dropship" then | |
2848 | vehid = Spawn(command, "Covenant Dropship", "vehi", "vehicles\\c_dropship\\c_dropship", players[i]) | |
2849 | elseif t[2] == "cryotube" then | |
2850 | vehid = Spawn(command, "Cryotube", "vehi", "levels\\a10\\devices\\cryotube\\cryotube", players[i]) | |
2851 | elseif t[2] == "peli" or t[2] == "pelican" then | |
2852 | vehid = Spawn(command, "Pelican", "vehi", "vehicles\\pelican\\pelican", players[i]) | |
2853 | elseif t[2] == "ghost" then | |
2854 | vehid = Spawn(command, "Ghost", "vehi", "vehicles\\ghost\\ghost_mp", players[i]) | |
2855 | elseif t[2] == "hog" then | |
2856 | vehid = Spawn(command, "Warthog", "vehi", "vehicles\\warthog\\mp_warthog", players[i]) | |
2857 | elseif t[2] == "rhog" then | |
2858 | vehid = Spawn(command, "Rocket Warthog", "vehi", "vehicles\\rwarthog\\rwarthog", players[i]) | |
2859 | elseif t[2] == "shee" or t[2] == "banshee" then | |
2860 | vehid = Spawn(command, "Banshee", "vehi", "vehicles\\banshee\\banshee_mp", players[i]) | |
2861 | elseif t[2] == "tank" or t[2] == "scorpion" then | |
2862 | vehid = Spawn(command, "Tank", "vehi", "vehicles\\scorpion\\scorpion_mp", players[i]) | |
2863 | elseif t[2] == "turret" or t[2] == "shade" then | |
2864 | vehid = Spawn(command, "Gun Turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp", players[i]) | |
2865 | else | |
2866 | hprintf("Invalid Vehicle!") | |
2867 | end | |
2868 | if vehid ~= nil then | |
2869 | local m_player = getplayer(players[i]) | |
2870 | local m_playerObjId = getplayerobjectid(players[i]) | |
2871 | if m_playerObjId ~= 0xffffffff then | |
2872 | entervehicle(players[i], vehid, 0) | |
2873 | table.insert(vehicle_drone_table[players[i]], vehid) | |
2874 | hprintf(getname(players[i]) .. " has been forced to enter a vehicle!") | |
2875 | else | |
2876 | hprintf(getname(players[i]) .. " cannot enter a vehicle while dead!") | |
2877 | end | |
2878 | end | |
2879 | end | |
2880 | else | |
2881 | hprintf("Invalid Player!") | |
2882 | end | |
2883 | else | |
2884 | hprintf("Invalid Syntax: sv_enter [vehicle] [player]") | |
2885 | end | |
2886 | elseif t[1] == "sv_setassists" then | |
2887 | response = 0 | |
2888 | if count == 3 then | |
2889 | if validplayer(t[2]) ~= false then | |
2890 | for i = 1,#players do | |
2891 | writeword(getplayer(players[i]), 0xA4, t[3]) | |
2892 | hprintf(getname(players[i]) .. " had their assists set to " .. t[3]) | |
2893 | end | |
2894 | else | |
2895 | hprintf("Invalid Player") | |
2896 | end | |
2897 | else | |
2898 | hprintf("Invalid Syntax: sv_setassists [player] [assists]") | |
2899 | end | |
2900 | elseif t[1] == "sv_setdeaths" then | |
2901 | response = 0 | |
2902 | if count == 3 then | |
2903 | if validplayer(t[2]) ~= false then | |
2904 | for i = 1,#players do | |
2905 | writeword(getplayer(players[i]), 0xAE, t[3]) | |
2906 | hprintf(getname(players[i]) .. " had their deaths set to " .. t[3]) | |
2907 | end | |
2908 | else | |
2909 | hprintf("Invalid Player") | |
2910 | end | |
2911 | else | |
2912 | hprintf("Invalid Syntax: sv_setdeaths [player] [deaths]") | |
2913 | end | |
2914 | elseif t[1] == "sv_setfrags" then | |
2915 | response = 0 | |
2916 | if count == 3 then | |
2917 | if validplayer(t[2]) ~= false then | |
2918 | for i = 1,#players do | |
2919 | local m_object = getobject(getplayerobjectid(players[i])) | |
2920 | if m_object ~= nil then | |
2921 | if tonumber(t[3]) ~= nil then | |
2922 | writebyte(m_object, 0x31E, t[3]) | |
2923 | hprintf("Setting " .. getname(players[i]) .. "'s frag grenades to " .. t[3]) | |
2924 | privatesay(players[i], "Your frag grenades were set to " .. t[3]) | |
2925 | else | |
2926 | hprintf(t[3] .. " is not a valid number.") | |
2927 | end | |
2928 | else | |
2929 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2930 | end | |
2931 | end | |
2932 | else | |
2933 | hprintf("Invalid Player") | |
2934 | end | |
2935 | else | |
2936 | hprintf("Invalid Syntax: sv_setfrags [player] [amount]") | |
2937 | end | |
2938 | elseif t[1] == "sv_setkills" then | |
2939 | response = 0 | |
2940 | if count == 3 then | |
2941 | if validplayer(t[2]) ~= false then | |
2942 | for i = 1,#players do | |
2943 | writeword(getplayer(players[i]), 0x9C, t[3]) | |
2944 | hprintf(getname(players[i]) .. " had their kills set to " .. t[3]) | |
2945 | end | |
2946 | else | |
2947 | hprintf("Invalid Player") | |
2948 | end | |
2949 | else | |
2950 | hprintf("Invalid Syntax: sv_setkills [player] [kills]") | |
2951 | end | |
2952 | elseif t[1] == "sv_respawn_time" then | |
2953 | response = 0 | |
2954 | if count == 2 then | |
2955 | if t[2] == "default" then | |
2956 | respset = 0 | |
2957 | hprintf("Respawn time set to the gametype's default setting!") | |
2958 | elseif tonumber(t[2]) ~= nil then | |
2959 | resptime = t[2] | |
2960 | respset = 1 | |
2961 | hprintf("Respawn time set to " .. t[2] .. " seconds!") | |
2962 | else | |
2963 | hprintf("That is not a valid number.") | |
2964 | end | |
2965 | else | |
2966 | hprintf("Invalid Syntax: sv_respawn_time [seconds]") | |
2967 | end | |
2968 | elseif t[1] == "sv_setplasmas" then | |
2969 | response = 0 | |
2970 | if count == 3 then | |
2971 | if validplayer(t[2]) ~= false then | |
2972 | for i = 1,#players do | |
2973 | local m_object = getobject(getplayerobjectid(players[i])) | |
2974 | if m_object ~= nil then | |
2975 | if tonumber(t[3]) ~= nil then | |
2976 | writebyte(m_object, 0x31F, t[3]) | |
2977 | hprintf("Setting " .. getname(players[i]) .. "'s plasma grenades to " .. t[3]) | |
2978 | else | |
2979 | hprintf(t[3] .. " is not a valid number.") | |
2980 | end | |
2981 | else | |
2982 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
2983 | end | |
2984 | end | |
2985 | else | |
2986 | hprintf("Invalid Player") | |
2987 | end | |
2988 | else | |
2989 | hprintf("Invalid Syntax: sv_setplasmas [player] [amount]") | |
2990 | end | |
2991 | elseif t[1] == "sv_spawn" then | |
2992 | response = 0 | |
2993 | --Objects with 'bipd' tag | |
2994 | if t[2] == "cyborg" or t[2] == "bot" or t[2] == "mastercheif" or t[2] == "biped" or t[2] == "bipd" then | |
2995 | Spawn(command, "Cyborg", "bipd", "characters\\cyborg_mp\\cyborg_mp", player, false) | |
2996 | elseif t[2] == "captain" or t[2] == "keyes" then | |
2997 | Spawn(command, "Captain Keyes", "bipd", "characters\\captain\\captain", false) | |
2998 | elseif t[2] == "cortana" then | |
2999 | Spawn(command, "Cortana", "bipd", "characters\\cortana\\cortana", false) | |
3000 | elseif t[2] == "cortana2" then | |
3001 | Spawn(command, "Cortana2", "bipd", "characters\\cortana\\halo_enhanced\\halo_enhanced", false) | |
3002 | elseif t[2] == "crewman" then | |
3003 | Spawn(command, "Crewman", "bipd", "characters\\crewman\\crewman", false) | |
3004 | elseif t[2] == "elite" then | |
3005 | Spawn(command, "elite", "bipd", "characters\\elite\\elite", false) | |
3006 | elseif t[2] == "elite2" then | |
3007 | Spawn(command, "Elite Special", "bipd", "characters\\elite\\elite special", false) | |
3008 | elseif t[2] == "engineer" then | |
3009 | Spawn(command, "Engineer", "bipd", "characters\\engineer\\engineer", false) | |
3010 | elseif t[2] == "flood" then | |
3011 | Spawn(command, "Flood Captain", "bipd", "characters\\flood_captain\\flood_captain", false) | |
3012 | elseif t[2] == "flood2" then | |
3013 | Spawn(command, "Flood Infection", "bipd", "characters\\flood_infection\\flood_infection", false) | |
3014 | elseif t[2] == "flood3" then | |
3015 | Spawn(command, "Flood Carrier", "bipd", "characters\\floodcarrier\\floodcarrier", false) | |
3016 | elseif t[2] == "floodelite" then | |
3017 | Spawn(command, "FloodCombat Elite", "bipd", "characters\\floodcombat elite\\floodcombat elite", false) | |
3018 | elseif t[2] == "floodhuman" then | |
3019 | Spawn(command, "FloodCombat Human", "bipd", "characters\\floodcombat_human\\floodcombat_human", false) | |
3020 | elseif t[2] == "pedobear" or t[2] == "grunt" then | |
3021 | Spawn(command, "Pedobear", "bipd", "characters\\grunt\\grunt", false) | |
3022 | elseif t[2] == "hunter" then | |
3023 | Spawn(command, "Hunter", "bipd", "characters\\hunter\\hunter", false) | |
3024 | elseif t[2] == "marine" then | |
3025 | Spawn(command, "Marine", "bipd", "characters\\marine\\marine", false) | |
3026 | elseif t[2] == "marinesuicide" or t[2] == "marine2" then | |
3027 | Spawn(command, "Marine Suicidal", "bipd", "characters\\marine_suicidal\\marine_suicidal", false) | |
3028 | elseif t[2] == "monitor" then | |
3029 | Spawn(command, "Monitor", "bipd", "characters\\monitor\\monitor", false) | |
3030 | elseif t[2] == "sentinel" then | |
3031 | Spawn(command, "Sentinel", "bipd", "characters\\sentinel\\sentinel", false) | |
3032 | elseif t[2] == "johnson" then | |
3033 | Spawn(command, "Sgt. Johnson", "bipd", "characters\\johnson\\johnson", false) | |
3034 | --Objects with 'eqip' tags | |
3035 | elseif t[2] == "camo" or t[2] == "camouflage" then | |
3036 | Spawn(command, "Camouflage", "eqip", "powerups\\active camouflage", player, false) | |
3037 | elseif t[2] == "dblspd" then | |
3038 | Spawn(command, "Double Speed", "eqip", "powerups\\double speed", player, false) | |
3039 | elseif t[2] == "fullspec" then | |
3040 | Spawn(command, "Full-Spectrum Vision", "eqip", "powerups\\full-spectrum vision", player, false) | |
3041 | elseif t[2] == "fnade" or t[2] == "nades" then | |
3042 | Spawn(command, "Frag Grenade", "eqip", "weapons\\frag grenade\\frag grenade", player, false) | |
3043 | elseif t[2] == "pnade" then | |
3044 | Spawn(command, "Plasma Grenade", "eqip", "weapons\\plasma grenade\\plasma grenade", player, false) | |
3045 | elseif t[2] == "overshield" or t[2] == "os" then | |
3046 | Spawn(command, "Overshield", "eqip", "powerups\\over shield", player, false) | |
3047 | elseif t[2] == "rifleammo" then | |
3048 | Spawn(command, "Assault Rifle Ammo", "eqip", "powerups\\assault rifle ammo\\assault rifle ammo", player, false) | |
3049 | elseif t[2] == "healthpack" then | |
3050 | Spawn(command, "Health Pack", "eqip", "powerups\\health pack", player, false) | |
3051 | elseif t[2] == "needlerammo" then | |
3052 | Spawn(command, "Needler Ammo", "eqip", "powerups\\needler ammo\\needler ammo", player, false) | |
3053 | elseif t[2] == "pistolammo" then | |
3054 | Spawn(command, "Pistol Ammo", "eqip", "powerups\\pistol ammo\\pistol ammo", player, false) | |
3055 | elseif t[2] == "rocketammo" then | |
3056 | Spawn(command, "Rocket Ammo", "eqip", "powerups\\rocket launcher ammo\\rocket launcher ammo", player, false) | |
3057 | elseif t[2] == "shottyammo" then | |
3058 | Spawn(command, "Shotgun Ammo", "eqip", "powerups\\shotgun ammo\\shotgun ammo", player, false) | |
3059 | elseif t[2] == "sniperammo" then | |
3060 | Spawn(command, "Sniper Ammo", "eqip", "powerups\\sniper rifle ammo\\sniper rifle ammo", player, false) | |
3061 | elseif t[2] == "flameammo" then | |
3062 | Spawn(command, "Flamethrower Ammo", "eqip", "powerups\\flamethrower ammo\\flamethrower ammo", player, false) | |
3063 | --Objects with 'weap' tag | |
3064 | elseif t[2] == "energysword" or t[2] == "esword" then | |
3065 | Spawn(command, "Energy Sword", "weap", "weapons\\energy sword\\energy sword", false) | |
3066 | elseif t[2] == "ball" or t[2] == "oddball" then | |
3067 | Spawn(command, "Oddball", "weap", "weapons\\ball\\ball", player, false) | |
3068 | elseif t[2] == "flag" then | |
3069 | Spawn(command, "Flag", "weap", "weapons\\flag\\flag", player, false) | |
3070 | elseif t[2] == "frg" or t[2] == "fuelrod" or t[2] == "rod" or t[2] == "plasmacannon" then | |
3071 | Spawn(command, "Fuel Rod", "weap", "weapons\\plasma_cannon\\plasma_cannon", player, false) | |
3072 | elseif t[2] == "ggun" or t[2] == "gravitygun" then | |
3073 | Spawn(command, "Gravity Gun", "weap", "weapons\\gravity rifle\\gravity rifle", player, false) | |
3074 | elseif t[2] == "needler" then | |
3075 | Spawn(command, "Needler", "weap", "weapons\\needler\\mp_needler", player, false) | |
3076 | elseif t[2] == "pistol" then | |
3077 | Spawn(command, "Pistol", "weap", "weapons\\pistol\\pistol", player, false) | |
3078 | elseif t[2] == "ppistol" or t[2] == "plasmapistol" then | |
3079 | Spawn(command, "Plasma Pistol", "weap", "weapons\\plasma pistol\\plasma pistol", player, false) | |
3080 | elseif t[2] == "prifle" or t[2] == "plasmarifle" then | |
3081 | Spawn(command, "Plasma Rifle", "weap", "weapons\\plasma rifle\\plasma rifle", player, false) | |
3082 | elseif t[2] == "rifle" or t[2] == "arifle" or t[2] == "assaultrifle" then | |
3083 | Spawn(command, "Assault Rifle", "weap", "weapons\\assault rifle\\assault rifle", player, false) | |
3084 | elseif t[2] == "rocket" or t[2] == "rocketlauncher" or t[2] == "rox" then | |
3085 | Spawn(command, "Rocket Launcher", "weap", "weapons\\rocket launcher\\rocket launcher", player, false) | |
3086 | elseif t[2] == "shotty" or t[2] == "shotgun" then | |
3087 | Spawn(command, "Shotgun", "weap", "weapons\\shotgun\\shotgun", player, false) | |
3088 | elseif t[2] == "sniper" then | |
3089 | Spawn(command, "Sniper Rifle", "weap", "weapons\\sniper rifle\\sniper rifle", player, false) | |
3090 | --Objects with 'vehi' tag | |
3091 | elseif t[2] == "wraith" then | |
3092 | Spawn(command, "Wraith", "vehi", "vehicles\\wraith\\wraith", player, false) | |
3093 | elseif t[2] == "peli" or t[2] == "pelican" then | |
3094 | Spawn(command, "Pelican", "vehi", "vehicles\\pelican\\pelican", player, false) | |
3095 | elseif t[2] == "ghost" then | |
3096 | Spawn(command, "Ghost", "vehi", "vehicles\\ghost\\ghost_mp", player, false) | |
3097 | elseif t[2] == "hog" or t[2] == "warthog" then | |
3098 | Spawn(command, "Warthog", "vehi", "vehicles\\warthog\\mp_warthog", player, false) | |
3099 | elseif t[2] == "rhog" or t[2] == "rocketwarthog" then | |
3100 | Spawn(command, "Rocket Warthog", "vehi", "vehicles\\rwarthog\\rwarthog", player, false) | |
3101 | elseif t[2] == "shee" or t[2] == "banshee" then | |
3102 | Spawn(command, "Banshee", "vehi", "vehicles\\banshee\\banshee_mp", player, false) | |
3103 | elseif t[2] == "tank" or t[2] == "scorpion" then | |
3104 | Spawn(command, "Tank", "vehi", "vehicles\\scorpion\\scorpion_mp", player, false) | |
3105 | elseif t[2] == "turret" or t[2] == "shade" then | |
3106 | Spawn(command, "Gun Turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp", player, false) | |
3107 | else | |
3108 | hprintf("Invalid Object!") | |
3109 | end | |
3110 | elseif t[1] == "sv_give" then | |
3111 | response = 0 | |
3112 | if t[2] == "energysword" or t[2] == "esword" or t[2] == "sword" then | |
3113 | Spawn(command, "Energy Sword", "weap", "weapons\\energy sword\\energy sword", player, true) | |
3114 | elseif t[2] == "ball" or t[2] == "oddball" then | |
3115 | Spawn(command, "Oddball", "weap", "weapons\\ball\\ball", player, true) | |
3116 | elseif t[2] == "flag" then | |
3117 | Spawn(command, "Flag", "weap", "weapons\\flag\\flag", player, true) | |
3118 | elseif t[2] == "frg" or t[2] == "fuelrod" or t[2] == "rod" or t[2] == "plasmacannon" then | |
3119 | Spawn(command, "Fuel Rod", "weap", "weapons\\plasma_cannon\\plasma_cannon", player, true) | |
3120 | elseif t[2] == "ggun" or t[2] == "gravitygun" then | |
3121 | Spawn(command, "Gravity Gun", "weap", "weapons\\gravity rifle\\gravity rifle", player, true) | |
3122 | elseif t[2] == "needler" then | |
3123 | Spawn(command, "Needler", "weap", "weapons\\needler\\mp_needler", player, true) | |
3124 | elseif t[2] == "pistol" then | |
3125 | Spawn(command, "Pistol", "weap", "weapons\\pistol\\pistol", player, true) | |
3126 | elseif t[2] == "ppistol" or t[2] == "plasmapistol" then | |
3127 | Spawn(command, "Plasma Pistol", "weap", "weapons\\plasma pistol\\plasma pistol", player, true) | |
3128 | elseif t[2] == "flamethrower" or t[2] == "flame" then | |
3129 | Spawn(command, "Flamethrower", "weap", "weapons\\flamethrower\\flamethrower", player, true) | |
3130 | elseif t[2] == "prifle" or t[2] == "plasmarifle" then | |
3131 | Spawn(command, "Plasma Rifle", "weap", "weapons\\plasma rifle\\plasma rifle", player, true) | |
3132 | elseif t[2] == "rifle" or t[2] == "arifle" or t[2] == "assaultrifle" then | |
3133 | Spawn(command, "Assault Rifle", "weap", "weapons\\assault rifle\\assault rifle", player, true) | |
3134 | elseif t[2] == "rocket" or t[2] == "rocketlauncher" or t[2] == "rox" then | |
3135 | Spawn(command, "Rocket Launcher", "weap", "weapons\\rocket launcher\\rocket launcher", player, true) | |
3136 | elseif t[2] == "shotty" or t[2] == "shotgun" then | |
3137 | Spawn(command, "Shotgun", "weap", "weapons\\shotgun\\shotgun", player, true) | |
3138 | elseif t[2] == "sniper" then | |
3139 | Spawn(command, "Sniper Rifle", "weap", "weapons\\sniper rifle\\sniper rifle", player, true) | |
3140 | else | |
3141 | hprintf("Invalid Object!") | |
3142 | end | |
3143 | elseif t[1] == "sv_suspend" then | |
3144 | response = 0 | |
3145 | if validplayer(t[2]) ~= false then | |
3146 | for i = 1,#players do | |
3147 | if suspend_table[gethash(players[i])] == nil then | |
3148 | local m_player = getplayer(players[i]) | |
3149 | local player_respawn_time = readdword(m_player, 0x2c) | |
3150 | if count == 2 then | |
3151 | kill(players[i]) | |
3152 | writedword(m_player, 0x2C, 2592000) | |
3153 | suspend_table[gethash(players[i])] = 2 | |
3154 | hprintf(getname(players[i]) .. " was suspended by an admin!") | |
3155 | elseif count == 3 then | |
3156 | kill(players[i]) | |
3157 | writedword(m_player, 0x2C, t[3] * 30) | |
3158 | suspend_table[gethash(players[i])] = 1 | |
3159 | if tonumber(t[3]) == 1 then | |
3160 | hprintf(getname(players[i]) .. " was suspended by an admin for " .. t[3] .. " second!") | |
3161 | else | |
3162 | hprintf(getname(players[i]) .. " was suspended by an admin for " .. t[3] .. " seconds!") | |
3163 | end | |
3164 | else | |
3165 | hprintf("Invalid Syntax: sv_suspend [player] {time}") | |
3166 | end | |
3167 | else | |
3168 | hprintf(getname(players[i]) .. " has already been suspended.") | |
3169 | end | |
3170 | end | |
3171 | else | |
3172 | hprintf("Invalid Player!") | |
3173 | end | |
3174 | elseif t[1] == "sv_teleport_pl" then | |
3175 | response = 0 | |
3176 | if count == 3 then | |
3177 | if validplayer(t[2]) ~= false then | |
3178 | for i = 1,#players do | |
3179 | local name = getname(players[i]) | |
3180 | local m_player = getplayer(players[i]) | |
3181 | local player_respawn_time = readdword(m_player, 0x2C) | |
3182 | local m_playerObjId = readdword(m_player, 0x34) | |
3183 | local m_object = getobject(m_playerObjId) | |
3184 | local m_vehicle = getobject(readdword(m_object, 0x11C)) | |
3185 | local validplayer = validplayer2(t[3]) | |
3186 | if validplayer == true then | |
3187 | local t_player = getplayer(players2[1]) | |
3188 | local t_name = getname(players2[1]) | |
3189 | local player2_respawn_time = readdword(t_player, 0x2C) | |
3190 | local player_x_coord,player_y_coord,player_z_coord = getobjectcoords(readdword(t_player, 0x34)) | |
3191 | if m_vehicle ~= nil then | |
3192 | writefloat(m_vehicle, 0x5C, player_x_coord) | |
3193 | writefloat(m_vehicle, 0x60, player_y_coord) | |
3194 | writefloat(m_vehicle, 0x64, player_z_coord + 1.5) | |
3195 | hprintf(name .. " was teleported to " .. t_name) | |
3196 | else | |
3197 | movobjcoords(m_playerObjId, player_x_coord, player_y_coord, player_z_coord+1) | |
3198 | hprintf(name .. " was teleported to " .. t_name) | |
3199 | end | |
3200 | elseif validplayer == nil then | |
3201 | hprintf("Invalid Player!") | |
3202 | end | |
3203 | end | |
3204 | else | |
3205 | hprintf("Invalid Player!") | |
3206 | end | |
3207 | else | |
3208 | hprintf("Invalid Syntax: sv_teleport_pl [player] [player]") | |
3209 | hprintf("If you are unsure of a command, do /help on it") | |
3210 | end | |
3211 | elseif t[1] == "sv_changeteam" then | |
3212 | response = 0 | |
3213 | if count == 2 then | |
3214 | if validplayer(t[2]) ~= false then | |
3215 | for i = 1,#players do | |
3216 | changeteam(players[i], 1) | |
3217 | hprintf(getname(players[i]) .. " had their team changed!") | |
3218 | end | |
3219 | else | |
3220 | hprintf("Invalid Player") | |
3221 | end | |
3222 | else | |
3223 | hprintf("Invalid Syntax: sv_changeteam [player]") | |
3224 | end | |
3225 | elseif t[1] == "sv_test" then | |
3226 | response = 0 | |
3227 | if count == 2 then | |
3228 | if getplayer(rresolveplayer(t[2])) ~= nil then | |
3229 | player_struct = getplayer(rresolveplayer(t[2])) | |
3230 | m_playerObjId = readdword(player_struct, 0x34) | |
3231 | if m_playerObjId ~= 0xffffffff then | |
3232 | entervehicle(player, m_playerObjId, 0) | |
3233 | end | |
3234 | end | |
3235 | end | |
3236 | elseif t[1] == "sv_timelimit" then | |
3237 | response = 0 | |
3238 | if count == 2 then | |
3239 | settimelimit(t[2]) | |
3240 | hprintf("Timelimit set to " .. t[2] .. " minutes!") | |
3241 | else | |
3242 | hprintf("Invalid Syntax: sv_timelimit [time]") | |
3243 | end | |
3244 | elseif t[1] == "cheat_unhax" then | |
3245 | response = 0 | |
3246 | if count == 2 then | |
3247 | if validplayer(t[2]) ~= nil then | |
3248 | for i = 1,#players do | |
3249 | local m_player = getplayer(players[i]) | |
3250 | writeword(m_player, 0x9C, 0) | |
3251 | writeword(m_player, 0xA4, 0) | |
3252 | writeword(m_player, 0xAC, 0) | |
3253 | writeword(m_player, 0xAE, 0) | |
3254 | writeword(m_player, 0xB0, 0) | |
3255 | hprintf("Happy Hacking.") | |
3256 | end | |
3257 | else | |
3258 | hprintf("Invalid Player!") | |
3259 | end | |
3260 | else | |
3261 | hprintf("Invalid Syntax: cheat_unhax [player]") | |
3262 | end | |
3263 | elseif t[1] == "sv_unmute" then | |
3264 | response = 0 | |
3265 | if count == 2 then | |
3266 | if validplayer(t[2]) ~= false then | |
3267 | for i = 1,#players do | |
3268 | if gethash(players[i]) ~= nil then | |
3269 | if mute_table[gethash(players[i])] ~= nil or spamtimeout_table[gethash(players[i])] ~= nil then | |
3270 | mute_table[gethash(players[i])] = nil | |
3271 | spamtimeout_table[gethash(players[i])] = nil | |
3272 | hprintf(getname(players[i]) .. " was unmuted by an admin!") | |
3273 | else | |
3274 | hprintf(getname(players[i]) .. " has not been muted.") | |
3275 | end | |
3276 | else | |
3277 | hprintf("Invalid Player") | |
3278 | end | |
3279 | end | |
3280 | else | |
3281 | hprintf("Invalid Player!") | |
3282 | end | |
3283 | else | |
3284 | hprintf("Invalid Syntax: sv_unmute [player]") | |
3285 | end | |
3286 | elseif t[1] == "sv_uninvis" then | |
3287 | response = 0 | |
3288 | if count == 2 then | |
3289 | if validplayer(t[2]) ~= false then | |
3290 | for i = 1,#players do | |
3291 | local m_playerObjId = getplayerobjectid(players[i]) | |
3292 | if getobject(m_playerObjId) ~= nil then | |
3293 | local x,y,z = getobjectcoords(m_playerObjId) | |
3294 | local m_vehicleId = readdword(getobject(m_playerObjId), 0x11C) | |
3295 | if m_vehicleId ~= 0xFFFFFFFF then | |
3296 | exitvehicle(players[i]) | |
3297 | destroyobject(m_playerObjId) | |
3298 | registertimer(1000, "uninvisTimer", players[i], m_vehicleId, x, y, z) | |
3299 | elseif m_playerObjId ~= 0xFFFFFFFF then | |
3300 | destroyobject(m_playerObjId) | |
3301 | registertimer(1000, "uninvisTimer", players[i], m_vehicleId, x, y, z) | |
3302 | end | |
3303 | hprintf(getname(players[i]) .. " is no longer invisible!") | |
3304 | else | |
3305 | hprintf("Error! " .. getname(players[i]) .. " is dead!") | |
3306 | end | |
3307 | end | |
3308 | else | |
3309 | hprintf("Invalid Player!") | |
3310 | end | |
3311 | else | |
3312 | hprintf("Invalid Syntax: sv_uninvis [player]") | |
3313 | end | |
3314 | elseif t[1] == "sv_unsuspend" then | |
3315 | response = 0 | |
3316 | if count == 2 then | |
3317 | if validplayer(t[2]) ~= false then | |
3318 | for i = 1,#players do | |
3319 | local m_player = getplayer(players[i]) | |
3320 | if suspend_table[gethash(players[i])] ~= nil then | |
3321 | writedword(m_player, 0x2C, 0) | |
3322 | hprintf(getname(players[i]) .. " was unsuspended by an admin!") | |
3323 | else | |
3324 | hprintf(getname(players[i]) .. " has not been suspended.") | |
3325 | end | |
3326 | end | |
3327 | else | |
3328 | hprintf("Invalid Player!") | |
3329 | end | |
3330 | else | |
3331 | hprintf("Invalid Syntax: sv_unsuspend [player]") | |
3332 | end | |
3333 | elseif cmd == "sv_bos" then | |
3334 | response = 1 | |
3335 | if count == 2 then | |
3336 | if validplayer(t[2]) ~= false then | |
3337 | for i = 1,#players do | |
3338 | local bos_entry = bos_table[players[i]] | |
3339 | local words = {} | |
3340 | for word in bos_entry:gmatch("%w+") do | |
3341 | table.insert(words, word) | |
3342 | end | |
3343 | local size = table.getn(words) | |
3344 | local name = "" | |
3345 | local hash = words[size] | |
3346 | for i=1,(size - 1) do | |
3347 | name = name .. words[i] .. " " | |
3348 | end | |
3349 | hprintf("Adding " .. name .. "to BoS.") | |
3350 | hprintf("Entry: " .. name .. "- " .. hash) | |
3351 | table.insert(boslog_table, bos_entry) | |
3352 | end | |
3353 | else | |
3354 | hprintf("Invalid Player!") | |
3355 | end | |
3356 | else | |
3357 | hprintf("Invalid Syntax: sv_bos [player]") | |
3358 | end | |
3359 | elseif cmd == "sv_boslist" then | |
3360 | response = 0 | |
3361 | if count == 1 then | |
3362 | hprintf("[Num Name - Hash]") | |
3363 | for k,v in pairs(boslog_table) do | |
3364 | if v ~= nil then | |
3365 | local words = {} | |
3366 | for word in v:gmatch("%w+") do | |
3367 | table.insert(words, word) | |
3368 | end | |
3369 | local size = table.getn(words) | |
3370 | local name = "" | |
3371 | local hash = words[size] | |
3372 | for i=1,(size - 1) do | |
3373 | name = name .. " " .. words[i] | |
3374 | end | |
3375 | hprintf("[" .. k - 1 .. name .. " - " .. hash .. "]") | |
3376 | end | |
3377 | end | |
3378 | end | |
3379 | elseif cmd == "sv_stickman_animation" then | |
3380 | response = 0 | |
3381 | if toksize == 1 then | |
3382 | registertimer(750, "stickman") | |
3383 | else | |
3384 | hprintf("Invalid Syntax: sv_stickman_animation") | |
3385 | end | |
3386 | elseif cmd == "sv_randomkill" then | |
3387 | response = 0 | |
3388 | if count == 1 then | |
3389 | local random = getrandomnumber(0, 15) | |
3390 | local player_number = resolveplayer(random) | |
3391 | while player_number == -1 do | |
3392 | random = getrandomnumber(0, 15) | |
3393 | player_number = resolveplayer(random) | |
3394 | end | |
3395 | kill(rresolveplayer(player_number)) | |
3396 | else | |
3397 | hprintf("Invalid Syntax: sv_randomkill") | |
3398 | end | |
3399 | elseif cmd == "sv_unbos" then | |
3400 | response = 0 | |
3401 | if count == 2 then | |
3402 | local number = tonumber(getcmdtoken(command, 1) + 1) | |
3403 | local entry = boslog_table[number] | |
3404 | local words = {} | |
3405 | if entry == nil then | |
3406 | hprintf("Invalid Entry") | |
3407 | else | |
3408 | for word in entry:gmatch("%w+") do | |
3409 | table.insert(words, word) | |
3410 | end | |
3411 | local size = table.getn(words) | |
3412 | local name = "" | |
3413 | local hash = words[size] | |
3414 | for i=1,(size - 1) do | |
3415 | name = name .. " " .. words[i] | |
3416 | end | |
3417 | hprintf("Removing" .. name .. " - " .. hash .. " from BoS.") | |
3418 | table.remove(boslog_table, number) | |
3419 | end | |
3420 | else | |
3421 | hprintf("Invalid Syntax: sv_unbos [entry]") | |
3422 | end | |
3423 | elseif cmd == "sv_info" then | |
3424 | response = 0 | |
3425 | local player_number = player + 1 | |
3426 | local m_player = getplayer(player) | |
3427 | local hash = gethash(player) | |
3428 | local display = 1 | |
3429 | if count == 2 then | |
3430 | player_number = tonumber(getcmdtoken(command, 1)) | |
3431 | m_player = getplayer(rresolveplayer(player_number)) | |
3432 | hash = gethash(rresolveplayer(player_number)) | |
3433 | if hash == 0 then | |
3434 | hprintf("Invalid Player") | |
3435 | display = 0 | |
3436 | end | |
3437 | elseif toksize > 2 then | |
3438 | hprintf("Invalid Syntax: sv_info {player}") | |
3439 | display = 0 | |
3440 | end | |
3441 | if display == 1 then | |
3442 | local m_playerObjId = readdword(m_player, 0x34) | |
3443 | local m_object = getobject(m_playerObjId) | |
3444 | local player_name = readstring(m_player, 0x4, 0x14) | |
3445 | local player_team = readdword(m_player, 0x20) | |
3446 | local player_respawn_time = readdword(m_player, 0x2C) | |
3447 | local player_invis_time = readword(m_player, 0x68) | |
3448 | local player_speed = readfloat(m_player, 0x6C) | |
3449 | local player_objective_mode = readbyte(m_player, 0x74) | |
3450 | local player_objective_mode2 = readbyte(m_player, 0x7A) | |
3451 | local player_killstreak = readword(m_player, 0x96) | |
3452 | local player_kills = readword(m_player, 0x9C) | |
3453 | local player_assists = readword(m_player, 0xA4) | |
3454 | local player_betrays = readword(m_player, 0xAC) | |
3455 | local player_deaths = readword(m_player, 0xAE) | |
3456 | local player_suicides = readword(m_player, 0xB0) | |
3457 | local player_ping = readword(m_player, 0xDC) | |
3458 | local player_x_coord = readfloat(m_player, 0xF8) | |
3459 | local player_y_coord = readfloat(m_player, 0xFC) | |
3460 | local player_z_coord = readfloat(m_player, 0x100) | |
3461 | local obj_max_health = readfloat(m_object, 0xD8) | |
3462 | local obj_max_shields = readfloat(m_object, 0xDC) | |
3463 | local obj_health = readfloat(m_object, 0xE0) | |
3464 | local obj_shields = readfloat(m_object, 0xE4) | |
3465 | local obj_flashlight_mode = readbyte(m_object, 0x206) | |
3466 | local obj_crouch = readbyte(m_object, 0x2A0) | |
3467 | local obj_weap_type = readbyte(m_object, 0x2F2) | |
3468 | local obj_nade_type = readbyte(m_object, 0x31C) | |
3469 | local obj_primary_nades = readbyte(m_object, 0x31E) | |
3470 | local obj_secondary_nades = readbyte(m_object, 0x31F) | |
3471 | local obj_flashlight_level = readfloat(m_object, 0x344) | |
3472 | local obj_invis_scale = readfloat(m_object, 0x37C) | |
3473 | local obj_airborne = readbyte(m_object, 0x4CC) | |
3474 | local obj_primary_weap_id = readdword(m_object, 0x2F8) | |
3475 | local obj_secondary_weap_id = readdword(m_object, 0x2FC) | |
3476 | local primary_weap = getobject(obj_primary_weap_id) | |
3477 | local secondary_weap = getobject(obj_secondary_weap_id) | |
3478 | local m_vehicle = getobject(readdword(m_object, 0x11C)) | |
3479 | if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then | |
3480 | primary_weap = getobject(readdword(m_vehicle, 0x2F8)) | |
3481 | end | |
3482 | local primary_weap_heat = readfloat(primary_weap, 0x23C) | |
3483 | local primary_weap_age = readfloat(primary_weap, 0x240) | |
3484 | local primary_weap_ammo = readword(primary_weap, 0x2B6) | |
3485 | local primary_weap_clip = readword(primary_weap, 0x2B8) | |
3486 | local secondary_weap_heat = readfloat(secondary_weap, 0x23C) | |
3487 | local secondary_weap_age = readfloat(secondary_weap, 0x240) | |
3488 | local secondary_weap_ammo = readword(secondary_weap, 0x2B6) | |
3489 | local secondary_weap_clip = readword(secondary_weap, 0x2B8) | |
3490 | local teamsize = getteamsize(player_team) | |
3491 | if player_team == 0 then | |
3492 | player_team = "Red" | |
3493 | elseif player_team == 1 then | |
3494 | player_team = "Blue" | |
3495 | end | |
3496 | if player_objective_mode == 0x22 and player_objective_mode2 == 0x71 then | |
3497 | player_objective_mode = "Hill" | |
3498 | elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x71 then | |
3499 | player_objective_mode = "Juggernaut" | |
3500 | elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x72 then | |
3501 | player_objective_mode = "It" | |
3502 | elseif player_objectivemode == 0x29 and player_objective_mode2 == 0x70 then | |
3503 | player_objective_mode = "Ball" | |
3504 | else | |
3505 | player_objective_mode = "None" | |
3506 | end | |
3507 | if obj_weap_type == 2 and player_objective_mode == "None" then | |
3508 | player_objective_mode = "Flag" | |
3509 | end | |
3510 | player_respawn_time = round(player_respawn_time / 30) | |
3511 | player_invis_time = round(player_invis_time / 30) | |
3512 | player_betrays = player_betrays - player_suicides | |
3513 | ||
3514 | player_x_coord = round(player_x_coord) | |
3515 | player_y_coord = round(player_y_coord) | |
3516 | player_z_coord = round(player_z_coord) | |
3517 | ||
3518 | obj_invis_scale = round(obj_invis_scale * 100) | |
3519 | ||
3520 | if obj_invis_scale == 0 then | |
3521 | obj_invis_scale = "No" | |
3522 | else | |
3523 | obj_invis_scale = obj_invis_scale | |
3524 | end | |
3525 | ||
3526 | local invis_info = "Invis: " .. obj_invis_scale | |
3527 | ||
3528 | if obj_invis_scale ~= "No" then | |
3529 | invis_info = "Invis: " .. obj_invis_scale .. " (" .. player_invis_time .. " secs)" | |
3530 | end | |
3531 | ||
3532 | if obj_flashlight_mode == 8 then | |
3533 | obj_flashlight_mode = "On" | |
3534 | else | |
3535 | obj_flashlight_mode = "Off" | |
3536 | end | |
3537 | ||
3538 | obj_flashlight_level = round(obj_flashlight_level * 100) | |
3539 | ||
3540 | if primary_weap_age == 0 then | |
3541 | if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then | |
3542 | writefloat(primary_weap, 0x240, 1) | |
3543 | primary_weap_age = 1 | |
3544 | end | |
3545 | end | |
3546 | ||
3547 | if secondary_weap_age == 0 then | |
3548 | if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then | |
3549 | writefloat(secondary_weap, 0x240, 1) | |
3550 | secondary_weap_age = 1 | |
3551 | end | |
3552 | end | |
3553 | ||
3554 | if obj_weap_type == 1 then | |
3555 | primary_weap_heat = readfloat(secondary_weap, 0x23C) | |
3556 | primary_weap_age = readfloat(secondary_weap, 0x240) | |
3557 | primary_weap_ammo = readword(secondary_weap, 0x2B6) | |
3558 | primary_weap_clip = readword(secondary_weap, 0x2B8) | |
3559 | secondary_weap_heat = readfloat(primary_weap, 0x23C) | |
3560 | secondary_weap_age = readfloat(primary_weap, 0x240) | |
3561 | secondary_weap_ammo = readword(primary_weap, 0x2B6) | |
3562 | secondary_weap_clip = readword(primary_weap, 0x2B8) | |
3563 | end | |
3564 | ||
3565 | primary_weap_heat = round(primary_weap_heat * 100) | |
3566 | primary_weap_age = round((1 - primary_weap_age) * 100) | |
3567 | secondary_weap_heat = round(secondary_weap_heat * 100) | |
3568 | secondary_weap_age = round((1 - secondary_weap_age) * 100) | |
3569 | ||
3570 | local primary_weap_info = "Primary: Empty" | |
3571 | local secondary_weap_info = "Secondary: Empty" | |
3572 | ||
3573 | if obj_health ~= 0 then | |
3574 | if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then | |
3575 | if primary_weap_age == 100 and primary_weap_ammo == 0 and primary_weap_clip == 0 then | |
3576 | primary_weap_info = "Primary: Infinite" | |
3577 | else | |
3578 | primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo | |
3579 | end | |
3580 | else | |
3581 | ||
3582 | if primary_weap ~= 0 then | |
3583 | if primary_weap_age == 0 then | |
3584 | if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then | |
3585 | primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo | |
3586 | end | |
3587 | else | |
3588 | primary_weap_info = "Primary Battery: " .. primary_weap_heat .. " / " .. primary_weap_age | |
3589 | end | |
3590 | end | |
3591 | ||
3592 | if secondary_weap ~= 0 then | |
3593 | if secondary_weap_age == 0 then | |
3594 | if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then | |
3595 | secondary_weap_info = "Secondary Ammo: " .. secondary_weap_clip .. " / " .. secondary_weap_ammo | |
3596 | end | |
3597 | else | |
3598 | secondary_weap_info = "Secondary Battery: " .. secondary_weap_heat .. " / " .. secondary_weap_age | |
3599 | end | |
3600 | end | |
3601 | ||
3602 | end | |
3603 | end | |
3604 | ||
3605 | local nade_info = "Frag Grenades: " .. obj_primary_nades .. " | " .. "Plasma Grenades: " .. obj_secondary_nades | |
3606 | ||
3607 | if obj_nade_type == 1 then | |
3608 | nade_info = "Plasma Grenades: " .. obj_secondary_nades .. " | " .. "Frag Grenades: " .. obj_primary_nades | |
3609 | end | |
3610 | ||
3611 | if obj_crouch == 0 then | |
3612 | obj_crouch = "Warthog: Driver" | |
3613 | elseif obj_crouch == 1 then | |
3614 | obj_crouch = "Warthog: Gunner" | |
3615 | elseif obj_crouch == 2 then | |
3616 | obj_crouch = "Warthog: Passenger" | |
3617 | elseif obj_crouch == 3 then | |
3618 | obj_crouch = "Stance: Crouching" | |
3619 | elseif obj_crouch == 4 then | |
3620 | obj_crouch = "Stance: Standing" | |
3621 | elseif obj_crouch == 5 then | |
3622 | obj_crouch = "Ghost: Driver" | |
3623 | elseif obj_crouch == 6 then | |
3624 | obj_crouch = "Banshee: Pilot" | |
3625 | elseif obj_crouch == 13 then | |
3626 | obj_crouch = "Scorpion: Driver" | |
3627 | elseif obj_crouch == 17 then | |
3628 | obj_crouch = "Shade: Gunner" | |
3629 | elseif obj_crouch == 20 or obj_crouch == 21 or obj_crouch == 22 or obj_crouch == 23 then | |
3630 | obj_crouch = "Scorpion: Passenger" | |
3631 | end | |
3632 | ||
3633 | if obj_crouch == "Stance: Crouching" or obj_crouch == "Stance: Standing" then | |
3634 | if obj_airborne == 1 then | |
3635 | obj_crouch = "Stance: Airborne" | |
3636 | end | |
3637 | end | |
3638 | ||
3639 | if obj_health == 0 and obj_shields == 0 then | |
3640 | obj_crouch = "Stance: Dead" | |
3641 | end | |
3642 | ||
3643 | obj_max_health = round(obj_health * obj_max_health) | |
3644 | obj_max_shields = round(obj_shields * obj_max_shields) | |
3645 | obj_health = round(obj_health * 100) | |
3646 | obj_shields = round(obj_shields * 100) | |
3647 | ||
3648 | local health_info = "Health: " .. obj_health .. " (" .. obj_max_health .. ") | " .. "Shields: " .. obj_shields .. " (" .. obj_max_shields .. ")" | |
3649 | ||
3650 | if obj_health == 0 and obj_shields == 0 and player_respawn_time ~= 0 then | |
3651 | if player_respawn_time == 1 then | |
3652 | health_info = "Respawn: " .. player_respawn_time .. " sec" | |
3653 | else | |
3654 | health_info = "Respawn: " .. player_respawn_time .. " secs" | |
3655 | end | |
3656 | end | |
3657 | ||
3658 | if suspend_table[hash] == 2 then | |
3659 | health_info = "Respawn: Never" | |
3660 | end | |
3661 | ||
3662 | hprintf("----------") | |
3663 | hprintf("Name: " .. player_name .. " (" .. player_number .. ") | " .. "Team: " .. player_team .. " (" .. teamsize .. ") | " .. "Speed: " .. player_speed .. " | " .. "Location: " .. player_x_coord .. ", " .. player_y_coord .. ", " .. player_z_coord) | |
3664 | hprintf("Hash: " .. hash .. " | " .. "Ping: " .. player_ping .. " | " .. obj_crouch) | |
3665 | hprintf("Kills: " .. player_kills .. " (" .. player_killstreak .. ") | " .. "Assists: " .. player_assists .. " | " .. "Betrays: " .. player_betrays .. " | " .. "Suicides: " .. player_suicides .. " | " .. "Deaths: " .. player_deaths) | |
3666 | hprintf(health_info .. " | " .. invis_info .. " | " .. "Light: " .. obj_flashlight_mode .. " (" .. obj_flashlight_level .. ")") | |
3667 | hprintf(primary_weap_info .. " | " .. secondary_weap_info .. " | " .. "Objective: " .. player_objective_mode) | |
3668 | hprintf(nade_info) | |
3669 | hprintf("----------") | |
3670 | ||
3671 | end | |
3672 | ||
3673 | end | |
3674 | ||
3675 | return response | |
3676 | ||
3677 | end | |
3678 | ||
3679 | function getstatus(m_player) | |
3680 | local status = "" | |
3681 | local player_struct = getplayer(m_player) | |
3682 | local m_playerObjId = readdword(player_struct, 0x34) | |
3683 | local m_object = getobject(m_playerObjId) | |
3684 | local obj_crouch = readbyte(m_object, 0x2A0) | |
3685 | if obj_crouch == 0 then | |
3686 | status = "wpassenger" | |
3687 | elseif obj_crouch == 1 then | |
3688 | status = "wpassenger" | |
3689 | elseif obj_crouch == 2 then | |
3690 | status = "wpassenger" | |
3691 | elseif obj_crouch == 3 then | |
3692 | status = "crouching" | |
3693 | elseif obj_crouch == 4 then | |
3694 | status = "standing" | |
3695 | elseif obj_crouch == 5 then | |
3696 | status = "gdriver" | |
3697 | elseif obj_crouch == 6 then | |
3698 | status = "bpilot" | |
3699 | elseif obj_crouch == 13 then | |
3700 | status = "sdriver" | |
3701 | elseif obj_crouch == 17 then | |
3702 | status = "turret" | |
3703 | elseif obj_crouch == 20 or obj_crouch == 21 or obj_crouch == 22 or obj_crouch == 23 then | |
3704 | status = "spassenger" | |
3705 | end | |
3706 | return status | |
3707 | end | |
3708 | ||
3709 | function OnTeamDecision(cur_team) | |
3710 | return cur_team | |
3711 | end | |
3712 | ||
3713 | function OnPlayerJoin(player, team) | |
3714 | ||
3715 | cur_players = cur_players + 1 | |
3716 | local sv_player = resolveplayer(player) | |
3717 | local name = getname(player) | |
3718 | local hash = gethash(player) | |
3719 | local words = {} | |
3720 | ||
3721 | for k,v in pairs(boslog_table) do | |
3722 | ||
3723 | for word in v:gmatch("%w+") do | |
3724 | table.insert(words, word) | |
3725 | end | |
3726 | ||
3727 | local size = table.getn(words) | |
3728 | local entry_name = "" | |
3729 | local entry_hash = words[size] | |
3730 | ||
3731 | for i=1,(size - 1) do | |
3732 | entry_name = entry_name .. words[i] .. " " | |
3733 | end | |
3734 | ||
3735 | if entry_hash == hash then | |
3736 | ||
3737 | for i=0,15 do | |
3738 | ||
3739 | local player_hash = gethash(i) | |
3740 | ||
3741 | if admin_table[player_hash] ~= nil then | |
3742 | privatesay(i, name .. " banned from BoS.") | |
3743 | privatesay(i, "Entry: " .. entry_name .. "- " .. entry_hash) | |
3744 | end | |
3745 | ||
3746 | end | |
3747 | ||
3748 | hprintf(name .. " banned from BoS.") | |
3749 | hprintf("Entry: " .. entry_name .. "- " .. entry_hash) | |
3750 | svcmd("sv_ban " .. sv_player) | |
3751 | table.remove(boslog_table, k) | |
3752 | break | |
3753 | ||
3754 | end | |
3755 | ||
3756 | end | |
3757 | ||
3758 | for k,v in pairs(admin_table) do | |
3759 | if k == gethash(player) then | |
3760 | say("Server Admin: " .. getname(player)) | |
3761 | break | |
3762 | end | |
3763 | end | |
3764 | ||
3765 | end | |
3766 | ||
3767 | function OnPlayerLeave(player, team) | |
3768 | ||
3769 | cur_players = cur_players - 1 | |
3770 | local sv_player = resolveplayer(player) | |
3771 | local name = getname(player) | |
3772 | local hash = gethash(player) | |
3773 | bos_table[sv_player] = name .. "," .. hash | |
3774 | cleanupdrones(player) | |
3775 | ||
3776 | end | |
3777 | ||
3778 | function OnPlayerKill(killer, victim, mode) | |
3779 | if respset == 1 then | |
3780 | local m_player = getplayer(victim) | |
3781 | local player_respawn_time = readdword(m_player, 0x2C) | |
3782 | writedword(m_player, 0x2c, resptime * 33) | |
3783 | end | |
3784 | cleanupdrones(victim) | |
3785 | end | |
3786 | ||
3787 | function OnKillMultiplier(player, multiplier) | |
3788 | end | |
3789 | ||
3790 | function OnPlayerSpawn(player, m_objectId) | |
3791 | ||
3792 | local hash = gethash(player) | |
3793 | ||
3794 | if deathless == 1 then | |
3795 | local m_player = getplayer(player) | |
3796 | local m_playerObjId = readdword(m_player, 0x34) | |
3797 | local m_object = getobject(m_playerObjId) | |
3798 | local obj_health = readfloat(m_object, 0xE0) | |
3799 | local obj_shields = readfloat(m_object, 0xE4) | |
3800 | writefloat(m_object, 0xE0, 9999999999) | |
3801 | writefloat(m_object, 0xE4, 9999999999) | |
3802 | end | |
3803 | ||
3804 | if suspend_table[hash] ~= nil then | |
3805 | suspend_table[hash] = nil | |
3806 | end | |
3807 | ||
3808 | end | |
3809 | ||
3810 | function OnPlayerSpawnEnd(player, m_objectId) | |
3811 | end | |
3812 | ||
3813 | function OnTeamChange(relevant, player, team, dest_team) | |
3814 | return 1 | |
3815 | end | |
3816 | ||
3817 | function OnObjectInteraction(player, m_ObjectId, tagType, tagName) | |
3818 | local Pass = 1 | |
3819 | if noweapons == 1 then | |
3820 | Pass = 0 | |
3821 | end | |
3822 | return Pass | |
3823 | end | |
3824 | ||
3825 | function OnObjectCreation(m_objectId, player_owner, tag) | |
3826 | if getplayer(player_owner) ~= nil then | |
3827 | for i = 25,43 do | |
3828 | if mode[gethash(player_owner)] == "portalgun" then | |
3829 | if tag == objects[i][3] then | |
3830 | local m_object = getobject(m_objectId) | |
3831 | registertimer(20, "portalgunTimer", player_owner, m_object) | |
3832 | end | |
3833 | elseif mode[gethash(player_owner)] == "spawngun" then | |
3834 | if tag == objects[i][3] then | |
3835 | local m_object = getobject(m_objectId) | |
3836 | registertimer(0, "spawngunTimer", player_owner, m_object) | |
3837 | end | |
3838 | end | |
3839 | end | |
3840 | end | |
3841 | end | |
3842 | ||
3843 | function OnWeaponReload(player, weapon) | |
3844 | if infammo == 1 then | |
3845 | writeword(getobject(weapon), 0x2B6, 9999) | |
3846 | writeword(getobject(weapon), 0x2B8, 9999) | |
3847 | updateammo(weapon) | |
3848 | return 0 | |
3849 | else | |
3850 | return 1 | |
3851 | end | |
3852 | end | |
3853 | ||
3854 | function OnVehicleEntry(relevant, player, vehicleId, vehicle_tag, seat) | |
3855 | return 1 | |
3856 | end | |
3857 | function OnVehicleEject(player, forceEject) | |
3858 | local m_object = getobject(getplayerobjectid(player)) | |
3859 | if m_object ~= nil then | |
3860 | local vehicleId = readdword(m_object, 0x11c) | |
3861 | cleanupdrone(player, vehicleId) | |
3862 | end | |
3863 | return 1 | |
3864 | end | |
3865 | ||
3866 | function OnDamageLookup(receiving_obj, causing_obj, tagdata, tagname) | |
3867 | if deathless == 1 then | |
3868 | writebyte(tagdata, 0x1C4, 0) | |
3869 | end | |
3870 | if causing_obj ~= -1 and causing_obj ~= nil then | |
3871 | for i = 25,43 do | |
3872 | local player = objecttoplayer(causing_obj) | |
3873 | if mode[gethash(player)] == "destroy" then | |
3874 | if tagname == objects[i][3] then | |
3875 | destroyobject(receiving_obj) | |
3876 | end | |
3877 | elseif mode[gethash(player)] == "entergun" then | |
3878 | if tagname == objects[i][3] and string.sub(getobjecttag(receiving_obj), 1, 8) == "vehicles" then | |
3879 | entervehicle(player, receiving_obj, 0) | |
3880 | end | |
3881 | end | |
3882 | end | |
3883 | end | |
3884 | end | |
3885 | ||
3886 | function getobjecttag(object) | |
3887 | local m_object = getobject(object) | |
3888 | local object_map_id = readdword(m_object, 0x0) | |
3889 | ||
3890 | local map_pointer = 0x460678 | |
3891 | local map_base = readdword(map_pointer, 0x0) | |
3892 | local map_tag_count = todec(endian(map_base, 0xC, 0x3)) | |
3893 | local tag_table_base = map_base + 0x28 | |
3894 | local tag_table_size = 0x20 | |
3895 | ||
3896 | for i=0,(map_tag_count - 1) do | |
3897 | local tag_id = todec(endian(tag_table_base, 0xC + (tag_table_size * i), 0x3)) | |
3898 | ||
3899 | if tag_id == object_map_id then | |
3900 | tag_name_address = endian(tag_table_base, 0x10 + (tag_table_size * i), 0x3) | |
3901 | tag_name = readtagname("0x" .. tag_name_address) | |
3902 | ||
3903 | return tag_name | |
3904 | end | |
3905 | end | |
3906 | end | |
3907 | ||
3908 | function endian(address, offset, length) | |
3909 | ||
3910 | local data_table = {} | |
3911 | local data = "" | |
3912 | ||
3913 | for i=0,length do | |
3914 | ||
3915 | local hex = string.format("%X", readbyte(address, offset + i)) | |
3916 | ||
3917 | if tonumber(hex, 16) < 16 then | |
3918 | hex = 0 .. hex | |
3919 | end | |
3920 | ||
3921 | table.insert(data_table, hex) | |
3922 | ||
3923 | end | |
3924 | ||
3925 | for k,v in pairs(data_table) do | |
3926 | data = v .. data | |
3927 | end | |
3928 | ||
3929 | return data | |
3930 | ||
3931 | end | |
3932 | ||
3933 | function todec(number) | |
3934 | return tonumber(number, 16) | |
3935 | end | |
3936 | ||
3937 | function readtagname(address) | |
3938 | ||
3939 | local char_table = {} | |
3940 | local i = 0 | |
3941 | local string = "" | |
3942 | ||
3943 | while readbyte(address, i) ~= 0 do | |
3944 | table.insert(char_table, string.char(readbyte(address, i))) | |
3945 | i = i + 1 | |
3946 | end | |
3947 | ||
3948 | for k,v in pairs(char_table) do | |
3949 | string = string .. v | |
3950 | end | |
3951 | ||
3952 | return string | |
3953 | ||
3954 | end | |
3955 | ||
3956 | function getweapon(player, weapon) | |
3957 | ||
3958 | local tag_name_address = nil | |
3959 | local tag_name = "" | |
3960 | local m_player = getplayer(player) | |
3961 | local m_object = getobject(readdword(m_player, 0x34)) | |
3962 | local weap_id = getobject(readdword(m_object, 0x2F8 + ((weapon - 1) * 4))) | |
3963 | local weap_meta_id = readdword(weap_id, 0x0) | |
3964 | local map_pointer = 0x460678 | |
3965 | local map_base = readdword(map_pointer, 0x0) | |
3966 | local map_tag_count = todec(endian(map_base, 0xC, 0x3)) | |
3967 | local tags_base = map_base + 0x28 | |
3968 | local tags_size = 0x20 | |
3969 | local tag_address = 0 | |
3970 | ||
3971 | for i=0,(map_tag_count - 1) do | |
3972 | ||
3973 | local tag_id = todec(endian(tags_base, 0xC + (tags_size * i), 0x3)) | |
3974 | ||
3975 | if tag_id == weap_meta_id then | |
3976 | ||
3977 | tag_name_address = endian(tags_base, 0x10 + (tags_size * i), 0x3) | |
3978 | tag_name = readtagname("0x" .. tag_name_address) | |
3979 | end | |
3980 | end | |
3981 | ||
3982 | return tag_name | |
3983 | end | |
3984 | ||
3985 | function OnWeaponAssignment(player, object, count, tag) | |
3986 | end | |
3987 | ||
3988 | function cleanupdrones(player) | |
3989 | -- pretty hacky way to remove the vehicles, but only way i could get working | |
3990 | for k,v in pairs(vehicle_drone_table[player]) do | |
3991 | local seats = getseats(v) | |
3992 | if seats ~= nil then | |
3993 | for i = 0,seats - 1 do | |
3994 | entervehicle(player, v, i) | |
3995 | exitvehicle(player) | |
3996 | end | |
3997 | destroyobject(v) | |
3998 | end | |
3999 | vehicle_drone_table[player][k] = nil | |
4000 | end | |
4001 | end | |
4002 | ||
4003 | function getseats(m_objectId) | |
4004 | local seats = nil | |
4005 | local m_object = getobject(m_objectId) | |
4006 | local tagname = getobjecttag(m_object) | |
4007 | if tagname == "vehicles\\rwarthog\\rwarthog" or tagname == "vehicles\\warthog\\mp_warthog" then | |
4008 | seats = 3 | |
4009 | elseif tagname == "vehicles\\scorpion\\scorpion_mp" then | |
4010 | seats = 5 | |
4011 | else | |
4012 | seats = 1 | |
4013 | end | |
4014 | return seats | |
4015 | end | |
4016 | ||
4017 | function cleanupdrone(player, objid) | |
4018 | for k,v in pairs(vehicle_drone_table[player]) do | |
4019 | if v == objid then | |
4020 | entervehicle(player, v, 0) | |
4021 | exitvehicle(player) | |
4022 | local seats = getseats(v) | |
4023 | if seats ~= nil then | |
4024 | for i = 0,seats - 1 do | |
4025 | entervehicle(player, v, i) | |
4026 | exitvehicle(player) | |
4027 | end | |
4028 | end | |
4029 | --destroyobject(v) dont destroy, will destroy itself soon | |
4030 | vehicle_drone_table[player][k] = nil | |
4031 | break | |
4032 | end | |
4033 | end | |
4034 | end | |
4035 | ||
4036 | function MainTimer(id, count) | |
4037 | ||
4038 | for i=0,15 do | |
4039 | ||
4040 | local hash = gethash(i) | |
4041 | ||
4042 | if hash ~= nil then | |
4043 | if ghost_table[hash] == 1 then | |
4044 | local m_player = getplayer(i) | |
4045 | writefloat(m_player, 0x100, readfloat(m_player, 0x100) - 1000) | |
4046 | end | |
4047 | end | |
4048 | ||
4049 | end | |
4050 | ||
4051 | return 1 | |
4052 | ||
4053 | end | |
4054 | ||
4055 | function SpamTimer(id, count) | |
4056 | ||
4057 | for i=0,15 do | |
4058 | ||
4059 | local hash = gethash(i) | |
4060 | ||
4061 | if hash ~= nil then | |
4062 | ||
4063 | local name = getname(i) | |
4064 | ||
4065 | if spam_table[hash] == nil then | |
4066 | spam_table[hash] = 0 | |
4067 | end | |
4068 | ||
4069 | if spam_table[hash] < spam_max then | |
4070 | if spam_table[hash] > 0 then | |
4071 | spam_table[hash] = spam_table[hash] - 0.25 | |
4072 | end | |
4073 | else | |
4074 | say(name .. " has been muted for " .. spam_timeout .. " seconds for spamming!") | |
4075 | spam_table[hash] = -1 | |
4076 | end | |
4077 | ||
4078 | if spam_table[hash] == -1 then | |
4079 | ||
4080 | if spamtimeout_table[hash] == nil then | |
4081 | spamtimeout_table[hash] = spam_timeout | |
4082 | else | |
4083 | spamtimeout_table[hash] = spamtimeout_table[hash] - 1 | |
4084 | end | |
4085 | ||
4086 | if spamtimeout_table[hash] == 0 then | |
4087 | say(name .. " has been unmuted!") | |
4088 | spamtimeout_table[hash] = nil | |
4089 | spam_table[hash] = 0 | |
4090 | end | |
4091 | ||
4092 | end | |
4093 | ||
4094 | end | |
4095 | ||
4096 | end | |
4097 | ||
4098 | return 1 | |
4099 | ||
4100 | end | |
4101 | ||
4102 | function rtvTimer(id, count) | |
4103 | ||
4104 | if count == 1 then | |
4105 | rtv_initiated = rtv_timeout | |
4106 | say("The current rtv has expired!") | |
4107 | return 0 | |
4108 | else | |
4109 | return 1 | |
4110 | end | |
4111 | ||
4112 | end | |
4113 | ||
4114 | function votekickTimer(id, count, userdata) | |
4115 | ||
4116 | if count == 1 then | |
4117 | ||
4118 | local name = getname(userdata) | |
4119 | votekick_allowed = true | |
4120 | say("The votekick on " .. name .. " has expired!") | |
4121 | ||
4122 | for k,v in pairs(votekick_table) do | |
4123 | votekick_table[k] = nil | |
4124 | end | |
4125 | ||
4126 | return 0 | |
4127 | else | |
4128 | return 1 | |
4129 | end | |
4130 | ||
4131 | end | |
4132 | ||
4133 | function lo3Timer(id, count) | |
4134 | if count >= 3 then | |
4135 | say("Start your match!") | |
4136 | svcmd("sv_map_reset") | |
4137 | return 0 | |
4138 | else | |
4139 | svcmd("sv_map_reset") | |
4140 | return 1 | |
4141 | end | |
4142 | end | |
4143 | function round(num) | |
4144 | ||
4145 | under = math.floor(num) | |
4146 | upper = math.floor(num) + 1 | |
4147 | underV = -(under - num) | |
4148 | upperV = upper - num | |
4149 | ||
4150 | if (upperV > underV) then | |
4151 | return under | |
4152 | else | |
4153 | return upper | |
4154 | end | |
4155 | ||
4156 | end | |
4157 | function readstring(address, offset, length) | |
4158 | ||
4159 | local char_table = {} | |
4160 | local string = "" | |
4161 | ||
4162 | for i=0,length do | |
4163 | if readbyte(address, (offset + i)) ~= 0 then | |
4164 | table.insert(char_table, string.char(readbyte(address, (offset + i)))) | |
4165 | end | |
4166 | end | |
4167 | ||
4168 | for k,v in pairs(char_table) do | |
4169 | string = string .. v | |
4170 | end | |
4171 | ||
4172 | return string | |
4173 | ||
4174 | end | |
4175 | ||
4176 | function nadeTimer(id, count) | |
4177 | for c = 0,15 do | |
4178 | if getplayer(c) ~= nil then | |
4179 | local m_player = getplayer(c) | |
4180 | local m_ObjId = readdword(m_player, 0x34) | |
4181 | local m_Object = getobject(m_ObjId) | |
4182 | if m_player ~= -1 and m_Object ~= -1 then | |
4183 | writebyte(m_Object, 0x31E, 3) -- set frags to 3 | |
4184 | writebyte(m_Object, 0x31F, 3) -- set plasmas to 3 | |
4185 | if m_player ~= -1 and m_Object ~= -1 then | |
4186 | for i = 0, 3 do | |
4187 | local m_weaponId = readdword(m_Object, 0x2F8 + (i*4)) | |
4188 | if m_weaponId ~= -1 then | |
4189 | local m_weapon = getobject(m_weaponId) | |
4190 | --writeword(m_weapon, 0x2B8, 2) --loaded ammo | |
4191 | writeword(m_weapon, 0x2B6, 9999) -- unloaded clip to 9999 | |
4192 | end | |
4193 | end | |
4194 | end | |
4195 | end | |
4196 | end | |
4197 | end | |
4198 | if infammo == 1 then | |
4199 | return 1 | |
4200 | elseif infammo == 0 then | |
4201 | return 0 | |
4202 | end | |
4203 | end | |
4204 | ||
4205 | function TimelimitTimer(id, count) | |
4206 | ||
4207 | time_passed = time_passed + 1 -- Increase time_passed by one every time this function is called (every second) | |
4208 | ||
4209 | return 1 | |
4210 | ||
4211 | end | |
4212 | ||
4213 | function settimelimit(value) | |
4214 | ||
4215 | local gametype_base = 0x671340 | |
4216 | writedword(gametype_base, 0x78, (30*60*value) + ((time_passed + 1) * 30)) -- set game timer to the specified value (in minutes) + the amount of time passed (+ one second for testing purposes) | |
4217 | ||
4218 | end | |
4219 | ||
4220 | function Stickman(id, count) | |
4221 | if count == 1 then | |
4222 | hprintf(" _._ ") | |
4223 | hprintf(" / O \ ") | |
4224 | hprintf(" \| |/ ") | |
4225 | hprintf("O--+=-=+--O") | |
4226 | elseif count == 2 then | |
4227 | svcmd("cls") | |
4228 | hprintf(" ,-O-, ") | |
4229 | hprintf("O--=---=--O") | |
4230 | hprintf(" 2-2 ") | |
4231 | hprintf(" - - ") | |
4232 | elseif count == 3 then | |
4233 | svcmd("cls") | |
4234 | hprintf(" ,_O_, ") | |
4235 | hprintf("O--(---)--O") | |
4236 | hprintf(" >'> ") | |
4237 | hprintf(" - - ") | |
4238 | elseif count == 4 then | |
4239 | svcmd("cls") | |
4240 | hprintf(" ._O_. ") | |
4241 | hprintf("O--<-+->--O") | |
4242 | hprintf(" X ") | |
4243 | hprintf(" / \ ") | |
4244 | hprintf(" - - ") | |
4245 | elseif count == 5 then | |
4246 | svcmd("cls") | |
4247 | hprintf("O--=-O-=--O") | |
4248 | hprintf(" '-' ") | |
4249 | hprintf(" v ") | |
4250 | hprintf(" / ) ") | |
4251 | hprintf(" ~ z ") | |
4252 | elseif count == 6 then | |
4253 | svcmd("cls") | |
4254 | hprintf("O--,---,--O") | |
4255 | hprintf(" \ O / ") | |
4256 | hprintf(" - - ") | |
4257 | hprintf(" - ") | |
4258 | hprintf(" / \ ") | |
4259 | hprintf(" = = ") | |
4260 | elseif count == 7 then | |
4261 | svcmd("cls") | |
4262 | hprintf("O--=-O-=--O") | |
4263 | hprintf(" '-' ") | |
4264 | hprintf(" v ") | |
4265 | hprintf(" / ) ") | |
4266 | hprintf(" ~ z ") | |
4267 | elseif count == 8 then | |
4268 | svcmd("cls") | |
4269 | hprintf(" ._O_. ") | |
4270 | hprintf("O--<-+->--O") | |
4271 | hprintf(" X ") | |
4272 | hprintf(" / \ ") | |
4273 | hprintf(" - - ") | |
4274 | elseif count == 9 then | |
4275 | svcmd("cls") | |
4276 | hprintf(" ,_O_, ") | |
4277 | hprintf("O--(---)--O") | |
4278 | hprintf(" >'> ") | |
4279 | hprintf(" - - ") | |
4280 | elseif count == 10 then | |
4281 | svcmd("cls") | |
4282 | hprintf(" ,-O-, ") | |
4283 | hprintf("O--=---=--O") | |
4284 | hprintf(" 2-2 ") | |
4285 | hprintf(" - - ") | |
4286 | elseif count == 11 then | |
4287 | svcmd("cls") | |
4288 | hprintf(" _._ ") | |
4289 | hprintf(" / O \ ") | |
4290 | hprintf(" \| |/ ") | |
4291 | hprintf("O--+=-=+--O") | |
4292 | elseif count == 12 then | |
4293 | svcmd("cls") | |
4294 | return 0 | |
4295 | end | |
4296 | return 1 | |
4297 | end | |
4298 | function resetweapons(player) | |
4299 | local m_player = getplayer(player) | |
4300 | local m_object = getobject(readdword(m_player, 0x34)) | |
4301 | local x = readfloat(m_object, 0x5C) | |
4302 | local y = readfloat(m_object, 0x60) | |
4303 | local z = readfloat(m_object, 0x64) | |
4304 | local m_playerObjId = readdword(m_player, 0x34) | |
4305 | objId = createobject("weap", "weapons\\pistol\\pistol", 0, 60, false, x+1.0, y, z + 2.0) | |
4306 | assignweapon(player, objId) | |
4307 | objId = createobject("weap", "weapons\\assault rifle\\assault rifle", 0, 60, false, x+1.0, y, z + 2.0) | |
4308 | assignweapon(player, objId) | |
4309 | end | |
4310 | function portalgunTimer(id, count, player_owner, m_object) | |
4311 | if count == 500 then | |
4312 | return 0 | |
4313 | end | |
4314 | local m_player = getplayer(player_owner) | |
4315 | if m_player ~= nil and m_object ~= nil then | |
4316 | local obj_x_velocity = readfloat(m_object, 0x68) | |
4317 | local m_playerObjId = readdword(m_player, 0x34) | |
4318 | if obj_x_velocity == 0 then | |
4319 | local x = readfloat(m_object, 0x5C) | |
4320 | local y = readfloat(m_object, 0x60) | |
4321 | local z = readfloat(m_object, 0x64) | |
4322 | movobjcoords(m_playerObjId, x, y, z) | |
4323 | return 0 | |
4324 | else | |
4325 | return 1 | |
4326 | end | |
4327 | end | |
4328 | return 1 | |
4329 | end | |
4330 | function spawngunTimer(id, count, player_owner, m_object) | |
4331 | local m_player = getplayer(player_owner) | |
4332 | if m_player ~= nil and m_object ~= nil then | |
4333 | local m_playerObjId = readdword(player_owner, 0x34) | |
4334 | local x = readfloat(m_object, 0x5C) | |
4335 | local y = readfloat(m_object, 0x60) | |
4336 | local z = readfloat(m_object, 0x64) | |
4337 | createobject(objspawntype[gethash(player_owner)], objspawntag[gethash(player_owner)], 0, 60, false, x, y, z) | |
4338 | end | |
4339 | return 0 | |
4340 | end | |
4341 | ||
4342 | function validplayer2(message) | |
4343 | local valid = false | |
4344 | for i = 1,#players2 do | |
4345 | if players2[i] ~= nil then | |
4346 | players2[i] = nil | |
4347 | end | |
4348 | end | |
4349 | if string.len(message) == "1" and message == "*" then | |
4350 | for i = 0,15 do | |
4351 | if getplayer(i) ~= nil then | |
4352 | table.insert(players2, i) | |
4353 | valid = true | |
4354 | end | |
4355 | end | |
4356 | elseif string.sub(message, 1, 1) == "*" then | |
4357 | for c = 0,15 do | |
4358 | if getplayer(c) ~= nil then | |
4359 | local name = getname(c) | |
4360 | local lowerfix = string.gsub(message, "*", "") | |
4361 | if string.find(string.lower(name), string.lower(lowerfix)) ~= nil then | |
4362 | table.insert(players2, c) | |
4363 | valid = true | |
4364 | end | |
4365 | end | |
4366 | end | |
4367 | elseif string.sub(message, 1, 3) == "red" then | |
4368 | for i = 0,15 do | |
4369 | if getplayer(i) ~= nil then | |
4370 | local player_team = readdword(getplayer(i), 0x20) | |
4371 | if player_team == 0 then | |
4372 | table.insert(players2, i) | |
4373 | valid = true | |
4374 | end | |
4375 | end | |
4376 | end | |
4377 | elseif string.sub(message, 1, 4) == "blue" then | |
4378 | for i = 0,15 do | |
4379 | if getplayer(i) ~= nil then | |
4380 | local player_team = readdword(getplayer(i), 0x20) | |
4381 | if player_team == 1 then | |
4382 | table.insert(players2, i) | |
4383 | valid = true | |
4384 | end | |
4385 | end | |
4386 | end | |
4387 | elseif message == "1" or message == "2" or message == "3" or message == "4" or message == "5" or message == "6" or message == "7" or message == "8" or message == "9" or message == "10" or message == "11" or message == "12" or message == "13" or message == "14" or message == "15" or message == "16" then | |
4388 | if getplayer(rresolveplayer(message)) ~= nil then | |
4389 | table.insert(players2, rresolveplayer(message)) | |
4390 | valid = true | |
4391 | end | |
4392 | end | |
4393 | return valid | |
4394 | end | |
4395 | ||
4396 | function validplayer(message) | |
4397 | local valid = false | |
4398 | for i = 1,#players do | |
4399 | if players[i] ~= nil then | |
4400 | players[i] = nil | |
4401 | end | |
4402 | end | |
4403 | if string.len(message) == "1" and message == "*" then | |
4404 | for i = 0,15 do | |
4405 | if getplayer(i) ~= nil then | |
4406 | table.insert(players, i) | |
4407 | valid = true | |
4408 | end | |
4409 | end | |
4410 | elseif string.sub(message, 1, 1) == "*" then | |
4411 | for i = 0,15 do | |
4412 | if getplayer(i) ~= nil then | |
4413 | local name = getname(i) | |
4414 | local lowerfix = string.gsub(message, "*", "") | |
4415 | if string.find(string.lower(name), string.lower(lowerfix)) ~= nil then | |
4416 | table.insert(players, i) | |
4417 | valid = true | |
4418 | end | |
4419 | end | |
4420 | end | |
4421 | elseif string.sub(message, 1, 3) == "red" then | |
4422 | for i = 0,15 do | |
4423 | if getplayer(i) ~= nil then | |
4424 | local player_team = readdword(getplayer(i), 0x20) | |
4425 | if player_team == 0 then | |
4426 | table.insert(players, i) | |
4427 | valid = true | |
4428 | end | |
4429 | end | |
4430 | end | |
4431 | elseif string.sub(message, 1, 4) == "blue" then | |
4432 | for i = 0,15 do | |
4433 | if getplayer(i) ~= nil then | |
4434 | local player_team = readdword(getplayer(i), 0x20) | |
4435 | if player_team == 1 then | |
4436 | table.insert(players, i) | |
4437 | valid = true | |
4438 | end | |
4439 | end | |
4440 | end | |
4441 | elseif tonumber(message) ~= nil then | |
4442 | if message == "1" or message == "2" or message == "3" or message == "4" or message == "5" or message == "6" or message == "7" or message == "8" or message == "9" or message == "10" or message == "11" or message == "12" or message == "13" or message == "14" or message == "15" or message == "16" then | |
4443 | if getplayer(rresolveplayer(message)) ~= nil then | |
4444 | table.insert(players, rresolveplayer(message)) | |
4445 | valid = true | |
4446 | end | |
4447 | end | |
4448 | end | |
4449 | return valid | |
4450 | end | |
4451 | ||
4452 | function uninvisTimer(id, count, player, m_vehicleId, x, y, z) | |
4453 | m_playerObjId = getplayerobjectid(player) | |
4454 | if getobject(m_playerObjId) ~= nil then | |
4455 | if getobject(m_vehicleId) ~= nil then | |
4456 | movobjcoords(m_playerObjId, x, y, z+1) | |
4457 | entervehicle(player, m_vehicleId, 0) | |
4458 | else | |
4459 | movobjcoords(m_playerObjId, x, y, z) | |
4460 | end | |
4461 | end | |
4462 | return 0 | |
4463 | end | |
4464 | ||
4465 | function delayMsg(id, count, msg, message, player) | |
4466 | message = message:gsub('"', "") | |
4467 | if string.sub(message, 1, 1) == "\\" then | |
4468 | privatesay(player, msg) | |
4469 | elseif string.sub(message, 1, 1) == "/" then | |
4470 | say(msg) | |
4471 | else | |
4472 | hprintf(msg) | |
4473 | say(msg) | |
4474 | end | |
4475 | return 0 | |
4476 | end |