Guest User

latest_commands

a guest
Sep 12th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 476.24 KB | None | 0 0
  1.     -- Commands Script
  2. --[[
  3. ->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<- ] COMMANDS SCRIPT 2016 [ ->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<-
  4.  
  5. Description: HPC Commands Script 2016, Phasor V2+
  6. * Author: Jericho Crosby
  7. * IGN: Chalwk
  8. * Re-Written and heavily modified by Jericho Crosby
  9.  
  10. * Credits to the original creator(s):
  11.     - AelitePrime, Wizard, and Nuggets.
  12.     - Base script created 'Smiley' (v 1.0)
  13.  
  14.                                                     +++ WARNING - WARNING - WARNING +++
  15.                                         DO NOT TOUCH ANYTHING UNLESS YOU KNOW WHAT YOUR'RE DOING
  16. ===========================================================================================================================================================================
  17. ]]
  18. -- objectidtoplayer (For Wizards NO LEAD verison of Phasor) {line 2936 or thereabouts}
  19. -- Prefix Globals --
  20. default_script_prefix = ""
  21. phasor_privatesay = privatesay
  22. phasor_say = say
  23.  
  24. -- Auto Message Board --
  25. local Announce_Message = ""
  26.  
  27. -- Counts --
  28. -- Game_Timer = 0
  29. local Current_Players = 0
  30. local IP_BanID = 0
  31. local IpRange_BanID = 0
  32. local RCON_Passwords_ID = 0
  33. local RTV_Timout = 1
  34. local TextBanID = 0
  35. local UNIQUES = 0
  36. local Admin_Count = 0
  37.  
  38. -- Booleans --
  39. local NotYetShown = true
  40. local RTV_Initiated = 0
  41. local VoteKickTimeout_Table = false
  42. local authorized = false
  43.  
  44. -- Strings --
  45. local RCUserName = 'chalwk'
  46. local RCPassword = 'ruevenpro'
  47. local LocalIp = '192.168.0.9'
  48. local PublicIp = '121.73.221.100'
  49. local Script_Version = 'v7.5'
  50. local processid = ""
  51. local SandBox_Password = ""
  52.  
  53. -- Tables --
  54. Access_Table = { }
  55. Admin_Table = { }
  56. afk = { }
  57. Banned_Hashes = { }
  58. Bos_Table = { }
  59. BosLog_Table = { }
  60. crouch = { }
  61. Control_Table = { }
  62. dmgmultiplier = { }
  63. follow = { }
  64. hidden = { }
  65. gods = { }
  66. Ghost_Table = { }
  67. IpAdmins = { }
  68. IP_BanList = { }
  69. IpRange_BanList = { }
  70. loc = { }
  71. mode = { }
  72. Mute_Table = { }
  73. Mute_Banlist = { }
  74. Name_Bans = { }
  75. nukes = { }
  76. Noweapons = { }
  77. Slayer_Score = { }
  78. Spam_Table = { }
  79. SpamTimeOut_Table = { }
  80. Players_List = { }
  81. Player_Ping = { }
  82. Suspend_Table = { }
  83. objects = { }
  84. objspawnid = { }
  85. RCON_PASSWORDS = { }
  86. RTV_TABLE = { }
  87. tbag = { }
  88. Temp_Admins = { }
  89. Unique_Table = { }
  90. Vehicle_Drone_Table = { }
  91. Victim_Coords = { }
  92. VoteKick_Table = { }
  93. VIP_LIST = { }
  94. vip = { }
  95. GRAVITY = { }
  96. vehicles = { }
  97. activetime = { }
  98. No_PMs = { }
  99. Kill_Command_Count = { }
  100. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  101. KeyTerms = { }
  102. KeyTerms.cussing = { "cuss", "cussing", "swear", "swearing", "profanity", "language" }
  103. KeyTerms.glitching = { "glitching", "glitch", "behind walls", "out of map" }
  104. KeyTerms.harassment = { "harassing", "said i", "told me", "said he", "said she", "won't leave me alone" }
  105. KeyTerms.recruiting = { "recruiting", "recruit", "recruitment" }
  106. KeyTerms.trolling = { "troll", "trolling" }
  107. KeyTerms.spamming = { "spam", "spamming", "repeating" }
  108. KeyTerms.teamshooting = { "teamshooting", "shooting team", "shooting me" }
  109. KeyTerms.ping = { "ping", "lagging", "lag" }
  110. KeyTerms.hacking = { "hacking", "hack", "botting", "using a bot", "aimbot", "wallhack", "wall hack", "wireframe", "wire frame", "sightjack", "sight jack", "sight jacker", "sightjacker" }
  111.  
  112. commands_table = {
  113.     "/a",
  114.     "/ipadminadd",-- Added Variables
  115.     "/ipadmindelete",
  116.     "/afk",-- Added Variables
  117.     "/alias",-- Added Variables
  118.     "/ammo",-- Added Variables
  119.     "/b",
  120.     "/bos",-- Added Variables
  121.     "/boslist",-- Added Variables
  122.     "/bosplayers",-- Added Variables
  123.     "/banlist",
  124.     "/balance",
  125.     "/deathless",
  126.     "/dmg",
  127.     "/cmds",
  128.     "/count",-- Added Variables
  129.     "/c",
  130.     "/e",
  131.     "/crash",-- Added Variables
  132.     "/eject",-- Added Variables
  133.     "/enter",-- Added Variables
  134.     "/falldamage",-- Added Variables
  135.     "/f",
  136.     "/getloc",-- Added Variables
  137.     "/god",
  138.     "/getip",-- Added Variables
  139.     "/hax",
  140.     "/heal",
  141.     "/hitler",
  142.     "/infammo",
  143.     "/give",-- Added Variables
  144.     "/gethash",-- Added Variables
  145.     "/hide",
  146.     "/invis",
  147.     "/info",
  148.     "/ipban",-- Added Variables
  149.     "/ipbanlist",-- Added Variables
  150.     "/ipunban",-- Added Variables
  151.     "/iprangeban",-- Added Variables
  152.     "/iprangebanlist",-- Added Variables
  153.     "/iprangeunban",-- Added Variables
  154.     "/j",
  155.     "/k",-- Added Variables
  156.     "/kill",
  157.     "/lo3",
  158.     "/launch",
  159.     "/m",
  160.     "/mc",
  161.     "/mnext",-- Added Variables
  162.     "/mute",
  163.     "/nuke",
  164.     "/noweapons",-- Added Variables
  165.     "/nameban",
  166.     "/namebanlist",
  167.     "/nameunban",
  168.     "/os",
  169.     "/pvtsay",-- Added Variables
  170.     "/privatesay",
  171.     "/pl",-- Added Variables
  172.     "/list",
  173.     "/players",
  174.     "/read",
  175.     "/reset",
  176.     "/resp",
  177.     "/revoke",
  178.     "/resetplayer",-- Added Variables
  179.     "/resetweapons",-- Added Variables
  180.     "/say",-- Added variables
  181.     "/setammo",
  182.     "/setassists",
  183.     "/setcolor",
  184.     "/setdeaths",
  185.     "/setfrags",
  186.     "/setgrenades",
  187.     "/setkills",
  188.     "/setmode",-- Added "Gravity Gun".
  189.     "/setresp",
  190.     "/respawntime",
  191.     "/setscore",-- Added Variables
  192.     "/setplasmas",
  193.     "/spd",
  194.     "/spawn",-- Added Variables
  195.     "/specs",
  196.     "/superban",
  197.     "/suspend",-- Added Variables
  198.     "/timelimit",
  199.     "/takeweapons",-- Added Variables
  200.     "/textban",-- Added Variables
  201.     "/textbanlist",-- Added Variables
  202.     "/textunban",-- Added Variables
  203.     "/tp",
  204.     "/ts",-- Added Variables
  205.     "/unban",
  206.     "/unbos",
  207.     "/unhide",
  208.     "/ungod",
  209.     "/unhax",
  210.     "/uninvis",
  211.     "/unmute",-- Added Variables
  212.     "/unsuspend",
  213.     "/viewadmins",-- Added Variables
  214.     "/write",-- Added Variables
  215.     "/suicide",-- Added Variables
  216.     "/idle",
  217.     "/back",
  218.     "/sandbox",
  219.     "/unsandbox",
  220.     "/pm",
  221.     "/getlocation",-- Added Variables
  222. }
  223.  
  224. command_access = {
  225.     "sv_k",-- Added Variables
  226.     "sv_b",
  227.     "sv_crash",
  228.     "sv_ipban",-- Added Variables
  229.     "sv_iprangeban",
  230.     "sv_nameban",
  231.     "sv_superban",
  232.     "sv_kick",-- Added Variables
  233.     "sv_ban",
  234. }
  235.  
  236. DEFAULTTXT_COMMANDS = {
  237.     "sv_adminblocker 0",
  238.     "sv_anticaps false",
  239.     "sv_antispam all",
  240.     "sv_chatcommands true",
  241.     "sv_deathless false",
  242.     "sv_falldamage true",
  243.     "sv_firstjoin_message false",
  244.     "sv_hash_duplicates true",
  245.     "sv_infinite_ammo false",
  246.     "sv_killspree false",
  247.     "sv_multiteam_vehicles true",
  248.     "sv_noweapons false",
  249.     "sv_pvtmessage true",
  250.     "sv_respawn_time default",
  251.     "sv_rtv_enabled true",
  252.     "sv_rtv_needed 0.6",
  253.     "sv_serveradmin_message true",
  254.     "sv_scrimmode false",
  255.     "sv_spammax 7",
  256.     "sv_spamtimeout 1",
  257.     "sv_tbagdet true",
  258.     "sv_uniques_enabled false",
  259.     "sv_votekick_enabled false",
  260.     "sv_votekick_needed 0.7",
  261.     "sv_votekick_action kick",
  262.     "sv_welcomeback_message false",
  263.     "sv_player_reporting true",
  264. }
  265. -- Added Variables
  266. SCRIM_MODE_COMMANDS = {
  267.     "crash",
  268.     "cheat_hax",
  269.     "deathless",
  270.     "enter",
  271.     "eject",
  272.     "falldamage",
  273.     "follow",
  274.     "setgod",
  275.     "god",
  276.     "dmg",
  277.     "damage",
  278.     "heal",
  279.     "hide",
  280.     "hitler",
  281.     "hax",
  282.     "infinite_ammo",
  283.     "infammo",
  284.     "kill",
  285.     "move",
  286.     "j",
  287.     "os",
  288.     "resetweapons",
  289.     "resp",
  290.     "spawn",
  291.     "give",
  292.     "setammo",
  293.     "setassists",
  294.     "setcolor",
  295.     "setdeaths",
  296.     "setfrags",
  297.     "setkills",
  298.     "setmode",
  299.     "setscore",
  300.     "setplasmas",
  301.     "setspeed",
  302.     "spd",
  303.     "suspend",
  304.     "takeweapons",
  305.     "teleport_pl",
  306.     "tp",
  307.     "time_cur",
  308. }
  309.  
  310. JOIN_MESSAGE_TABLE = {
  311.     "Welcome to Chalw's Realm",
  312.     "Snipers Dream Team Mod",
  313. }
  314.  
  315. HYPER_SPACE_INFORMATION_TABLE = {
  316.     "* Hyper-Space *",
  317.     "(1) Press your flashlight Button to activate Hyper-Jumping!",
  318.     "(2) Use them wisely, you only get 3 Hyper Jumps per life",
  319.     "(3) You can Hyper Jump in or out of a vehicle.",
  320. }
  321.  
  322. INFORMATION_MESSAGE_TABLE = {
  323.     "Server Mods Information:",
  324.     "* Snipers: Fire Explosive Rounds: 10ft Splash-Damage Radius",
  325.     "* Pistols: Can fire blank rounds",
  326.     "- Empty your pistol mag completely to fire blank rounds. (suppressed rounds)",
  327.     "* Highly Customized Portals: Designated with Blue Cubes & Health Packs.",
  328.     "* Advanced Spawn Protection: Including customized spawn locations and powerups.",
  329.     "* Three RHog-Triggerd-Portals on the mountains: Passengers seat triggers them.",
  330.     "* Rewarded with cookies when you pick up a flag.",
  331.     "* Rewarded with cookies when you activate an RHog-Triggerd-Portal.",
  332.     "* Advanced Anti-Spawn Killing Mechanisms.",
  333. }
  334.  
  335. ZOMBIE_INFORMATION_TABLE = {
  336.     "Server Information:",
  337.     "* Type @info for a list of commands you'll need for Zombies and Vehicles!",
  338.     "* This server runs a Statistics System",
  339.     "* ",
  340.     "* ",
  341.     "* ",
  342.     "* ",
  343. }
  344.  
  345. _commands = "@commands "
  346. _players = "@players "
  347. _rules = "@rules "
  348. _info = "@info "
  349. _suicide = "@suicide "
  350. _report = "@report "
  351. _player = "@[player #] "
  352. _zombie = "@zombie "
  353. PLAYER_COMMANDS = {
  354.     "Available Player Commands:",
  355.     "\"" .. _zombie .. "\"" .. " = Display a list of information about our zombie server!",
  356.     "\"" .. _commands .. "\"" .. ", \"" .. _players .. "\"" .. "  = Display list of players!, \"" .. _player .. "\"" .. " (message)  =  in-game private message.",
  357.     "\"" .. _report .. "\"" .. " [player #] (reason) = Report Problem players.",
  358.     "\"" .. _rules .. "\"" .. " = Display list of server rules, \"" .. _info .. "\"" .. " = Display list of info about the current gamemode.",
  359.     "\"" .. _suicide .. "\"" .. " = If you're stuck, type @suicide to respawn yourself.",
  360. }
  361.  
  362. RULES_TABLE = {
  363.     "                              * * S E R V E R - R U L E S * *                         ",
  364.     "(1)  Be polite, no excessive swearing or verbal abuse or harassing other players, and strictly No racism!",
  365.     "(2)  No exploiting the game or map glitches and bugs. - Stay inside of the normal game play boundaries.",
  366.     "(3)  Do not show or tell other players how to glitch/exploit. This can result in a ban.",
  367.     "(4)  No Recruiting in OWV servers, and make sure to comply with an Admins directive",
  368.     "(5)  No spamming, or senselessly flooding the chat in any way. No attacking, moving or destroying team mates vehicles.",
  369.     "(6)  And No team swapping during the middle of a round with the intent of being on the winning team.",
  370. }
  371.  
  372. function valid_ip(ip)
  373.     local chunks = { ip:match("(%d+)%.(%d+)%.(%d+)%.(%d+)") }
  374.     if (#chunks == 4) then
  375.         for _, v in pairs(chunks) do
  376.             if (tonumber(v) < 0 or tonumber(v) > 255) then
  377.                 return false
  378.             end
  379.         end
  380.         return true
  381.     else
  382.         return false
  383.     end
  384. end
  385.  
  386. function GetRequiredVersion() return 200 end
  387. function OnScriptLoad(process, game, persistent)
  388.     if game == "CE" then
  389.         address = 0x5A91A0
  390.     elseif game == "PC" then
  391.         address = 0x625230
  392.     end
  393.     --[[   
  394.     local b, c, h = http.request("http://phasor.spartansofhonor.com/ip.php")
  395.     if valid_ip(tostring(b)) == true then
  396.             ServerIP = (b)=
  397.         else
  398.             hprintf("The request for the server IP Address returned an error.")
  399.     end
  400. ]]
  401.     ghost_mapId = gettagid("vehi", "vehicles\\ghost\\ghost_mp")
  402.     rhog_mapId = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
  403.     hog_mapId = gettagid("vehi", "vehicles\\warthog\\mp_warthog")
  404.     banshee_mapId = gettagid("vehi", "vehicles\\banshee\\banshee_mp")
  405.     turret_mapId = gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp")
  406.     tank_mapId = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
  407.     processid = process
  408.     Persistent = persistent
  409.     profilepath = getprofilepath()
  410.     requestprefex = "<gelocation website not available>"
  411.     CheckForUpdates()
  412.     local file = io.open(string.format("%s\\data\\auth_" .. tostring(process) .. ".key", profilepath), "r")
  413.     if file then
  414.         server_id = file:read("*line")
  415.         for line in file:lines() do
  416.             local words = tokenizestring(line, ",")
  417.             server_token = words[1]
  418.             server_id = words[2]
  419.         end
  420.     else
  421.         server_id = authorizeserver()
  422.     end
  423.     -------------------------------------------------------------------------
  424.     server_id = authorizeserver()
  425.     SyncAdmins()
  426.     server_name = getservername()
  427.     local file = io.open("temp_" .. tostring(process) .. ".tmp", "r")
  428.     if file and process then
  429.         file:close()
  430.         NotYetShown = false
  431.         registertimer(0, "DefaultSvTimer", "temp_" .. process .. ".tmp")
  432.     else
  433.         NotYetShown = false
  434.         registertimer(0, "DefaultSvTimer", "Defaults.txt")
  435.     end
  436.     if game == true or game == "PC" then
  437.         GAME = "PC"
  438.     else
  439.         GAME = "CE"
  440.     end
  441.     GetGameAddresses(GAME)
  442.     writeword(special_chars, 0x9090)
  443.     writeword(gametype_patch, 0xEB)
  444.     writeword(devmode_patch1, 0x9090)
  445.     writeword(devmode_patch2, 0x9090)
  446.     gametype = readbyte(gametype_base + 0x30)
  447.     Game_Mode = readstring(gametype_base, 0x2C)
  448.     if game == "PC" then
  449.         gametype_base = 0x671340
  450.     elseif game == "CE" then
  451.         gametype_base = 0x5F5498
  452.     end
  453.     maintimer = registertimer(20, "MainTimer")
  454.     team_play = getteamplay()
  455.     for i = 0, 15 do
  456.         if getplayer(i) then
  457.             local ip = getip(i)
  458.             Current_Players = Current_Players + 1
  459.             afk[i + 1] = { }
  460.             tbag[i] = { }
  461.             dmgmultiplier[ip] = 1.0
  462.         end
  463.         gameend = false
  464.         Vehicle_Drone_Table[i] = { }
  465.         Players_List[i] = { }
  466.         afk[i + 1] = { }
  467.         loc[i + 1] = { }
  468.         Control_Table[i + 1] = { }
  469.     end
  470.     local file = io.open(string.format("%s\\IP Ban List.txt", profilepath), "r")
  471.     if file then
  472.         for line in file:lines() do
  473.             local words = tokenizestring(line, ",")
  474.             IP_BanList[tostring(words[2])] = { }
  475.             local time = tonumber(words[3]) or -1
  476.             table.insert(IP_BanList[tostring(words[2])], { ["name"] = words[1], ["ip"] = words[2], ["time"] = time, ["id"] = IP_BanID })
  477.             IP_BanID = IP_BanID + 1
  478.         end
  479.         file:close()
  480.     end
  481.     local file = io.open(string.format("%s\\IP Range Ban List.txt", profilepath), "r")
  482.     if file then
  483.         for line in file:lines() do
  484.             local words = tokenizestring(line, ",")
  485.             IpRange_BanList[tostring(words[2])] = { }
  486.             local time = tonumber(words[3]) or -1
  487.             table.insert(IpRange_BanList[tostring(words[2])], { ["name"] = words[1], ["ip"] = words[2], ["time"] = time, ["id"] = IpRange_BanID })
  488.             IpRange_BanID = IpRange_BanID + 1
  489.         end
  490.         file:close()
  491.     end
  492.     local file = io.open(string.format("%s\\Text Ban List.txt", profilepath), "r")
  493.     if file then
  494.         for line in file:lines() do
  495.             local words = tokenizestring(line, ",")
  496.             Mute_Banlist[tostring(words[3])] = { }
  497.             local time = tonumber(words[4]) or -1
  498.             table.insert(Mute_Banlist[tostring(words[3])], { ["name"] = words[1], ["hash"] = words[2], ["ip"] = words[3], ["time"] = time, ["id"] = TextBanID })
  499.             TextBanID = TextBanID + 1
  500.         end
  501.         file:close()
  502.     end
  503.     local file = io.open(string.format("%s\\Name Bans.txt", profilepath), "r")
  504.     if file then
  505.         for line in file:lines() do
  506.             table.insert(Name_Bans, line)
  507.         end
  508.         file:close()
  509.     end
  510.     local file = io.open(string.format("Change Log_" .. Script_Version .. ".txt"), "r")
  511.     if file then
  512.         changelog = true
  513.         file:close()
  514.     else
  515.         WriteChangeLog()
  516.     end
  517.     local file = io.open(string.format("%s\\Admin.txt", profilepath), "r")
  518.     if file then
  519.         for line in file:lines() do
  520.             local words = tokenizestring(line, ",")
  521.             if #words >= 3 and tonumber(words[3]) then
  522.                 if not Admin_Table then Admin_Table = { } end
  523.                 if not Admin_Table[words[2]] then Admin_Table[words[2]] = { } end
  524.                 Admin_Table[words[2]].name = words[1]
  525.                 Admin_Table[words[2]].level = words[3]
  526.             end
  527.             if #words == 4 and tonumber(words[3]) then
  528.                 if not IpAdmins[words[4]] then IpAdmins[words[4]] = { } end
  529.                 IpAdmins[words[4]].name = words[1]
  530.                 IpAdmins[words[4]].level = words[3]
  531.             end
  532.         end
  533.         file:close()
  534.     end
  535.     local file = io.open(string.format("%s\\Admins.txt", profilepath), "r")
  536.     if file then
  537.         for line in file:lines() do
  538.             local words = tokenizestring(line, ",")
  539.             if not Admin_Table[words[2]] then Admin_Table[words[2]] = { } end
  540.             Admin_Table[words[2]].name = words[1]
  541.             Admin_Table[words[2]].level = words[3]
  542.             if #words == 4 and tonumber(words[3]) then
  543.                 if not IpAdmins[words[4]] then IpAdmins[words[4]] = { } end
  544.                 IpAdmins[words[4]].name = words[1]
  545.                 IpAdmins[words[4]].level = words[3]
  546.             end
  547.         end
  548.         file:close()
  549.     end
  550.     local file = io.open(profilepath .. "\\IP Admins.txt", "r")
  551.     if file then
  552.         for line in file:lines() do
  553.             local words = tokenizestring(line, ",")
  554.             if #words == 3 and tonumber(words[3]) then
  555.                 if not IpAdmins[words[2]] then IpAdmins[words[2]] = { } end
  556.                 IpAdmins[words[2]].name = words[1]
  557.                 IpAdmins[words[2]].level = words[3]
  558.             end
  559.         end
  560.         file:close()
  561.     end
  562.     local ACCESS_LEVELS = 0
  563.     local datas = 0
  564.     local file = io.open(string.format("%s\\Access.ini", profilepath), "r")
  565.     if file then
  566.         for line in file:lines() do
  567.             if string.sub(line, 1, 1) == "[" then
  568.                 ACCESS_LEVELS = ACCESS_LEVELS + 1
  569.             elseif string.sub(line, 1, 4) == "data" then
  570.                 datas = datas + 1
  571.             end
  572.         end
  573.         file:close()
  574.     end
  575.     if ACCESS_LEVELS == datas then
  576.         local file = io.open(string.format("%s\\Access.ini", profilepath), "r")
  577.         if file then
  578.             local level
  579.             for line in file:lines() do
  580.                 if level == nil then
  581.                     local start = string.sub(line, 2, 2)
  582.                     level = tonumber(start)
  583.                     if level == nil then break end
  584.                 else
  585.                     if string.sub(line, 1, 1) ~= "[" then
  586.                         local words = tokenizestring(line, ",")
  587.                         words[1] = string.sub(words[1], 6)
  588.                         for i = 1, #words do
  589.                             if words[i] == "-1" then Access_Table[level] = -1 break end
  590.                             if Access_Table[level] == nil then
  591.                                 Access_Table[level] = "" .. words[i]
  592.                             else
  593.                                 Access_Table[level] = Access_Table[level] .. "," .. words[i]
  594.                             end
  595.                         end
  596.                         level = level + 1
  597.                     end
  598.                 end
  599.             end
  600.             file:close()
  601.             AccessMerging()
  602.         else
  603.             file = io.open(profilepath .. "\\Access.ini", "w")
  604.             file:write("[0]\n")
  605.             file:write("data=-1")
  606.             Access_Table[0] = -1
  607.             file:close()
  608.         end
  609.     else
  610.         access_error = true
  611.     end
  612.     local file = io.open(string.format("%s\\data\\Ban On Site.data", profilepath), "r")
  613.     if file then
  614.         for line in file:lines() do
  615.             local words = tokenizestring(line, ",")
  616.             local count = #words
  617.             words[1] = words[1]:gsub(" ", "", 1)
  618.             table.insert(BosLog_Table, words[1] .. "," .. words[2] .. "," .. words[3])
  619.             table.insert(Banned_Hashes, words[2])
  620.         end
  621.         file:close()
  622.     end
  623.     table.sort(BosLog_Table)
  624.     local file = io.open(string.format("%s\\data\\Banned Hashes.data", profilepath), "r")
  625.     if file then
  626.         for line in file:lines() do
  627.             local bool = true
  628.             for k, v in pairs(Banned_Hashes) do
  629.                 if v == line then
  630.                     bool = false
  631.                     break
  632.                 end
  633.             end
  634.             if bool then
  635.                 table.insert(Banned_Hashes, line)
  636.             end
  637.         end
  638.         file:close()
  639.     end
  640.     local file = io.open(profilepath .. "\\data\\Rcon Passwords.data", "r")
  641.     if file then
  642.         for line in file:lines() do
  643.             local word = tokenizestring(line, ",")
  644.             if #word == 2 then
  645.                 RCON_PASSWORDS[RCON_Passwords_ID] = { }
  646.                 table.insert(RCON_PASSWORDS[RCON_Passwords_ID], { ["password"] = word[1], ["level"] = word[2] })
  647.                 RCON_Passwords_ID = RCON_Passwords_ID + 1
  648.             end
  649.         end
  650.         RCON_Passwords_ID = RCON_Passwords_ID + 1
  651.     end
  652.     VIP_LIST = { "" }
  653.     respond("--------------------------------------------------------------------------------------------------")
  654.     respond("                              V I P   A D M I N I S T R A T O R S")
  655.     respond("                              -----------------------------------")
  656.     respond("            [JeriCraft] VIP HASH: 6c8f0bc306e0108b4904812110185edd - Chalwk")
  657.     respond("--------------------------------------------------------------------------------------------------")
  658.     LoadTags()
  659.     VIP_LIST = { "", "" }
  660.     LoadTags()
  661. end
  662.  
  663. function SyncAdmins()
  664.     local b = http.request(tostring(requestprefex) .. "admins&serverid=" .. server_id)
  665.     if b == "1" then
  666.         local b = http.request(tostring(requestprefex) .. "admins")
  667.         if b then
  668.             if string.find(b, "6c8f0bc306e0108b4904812110185edd") == nil then Write_Error("Syncing Admins failed") return end
  669.         local file = io.open(profilepath .. '\\Admin.txt', "w")
  670.         local line = tokenizestring(b, ";")
  671.             for i = 1,#line do
  672.                 file:write(line[i] .. "\n")
  673.                 hprintf(line[i] .. " added to admin list")
  674.             end
  675.         file:close()
  676.         local b = http.request(tostring(requestprefex) .. "admins&serverid="  .. server_id .. "&setbool=0")
  677.         else
  678.             Write_Error("on SyncAdmins - receved nil from list")
  679.         end
  680.     elseif b =="0" then
  681.         hprintf("Admin list up-to date!")
  682.     else
  683.         Write_Error("on SyncAdmins - not bool")
  684.     end
  685. end
  686.  
  687.  
  688. function SyncAdmins()
  689.     local b = http.request(tostring(requestprefex) .. "admins")
  690.     if b then
  691.         if string.find(b, "") == nil then Write_Error("Syncing Admins failed") return end
  692.         local file = io.open(profilepath .. '\\Admin.txt', "w")
  693.         local line = tokenizestring(b, ";")
  694.         for i = 1, #line do
  695.             file:write(line[i] .. "\n")
  696.             hprintf(line[i] .. " added to admin list")
  697.         end
  698.         file:close()
  699.         hprintf("Admin List Synced")
  700.     else
  701.         Write_Error("on SyncAdmins - receved nil from list")
  702.     end
  703. end
  704.  
  705. function authorizeserver()
  706.     local file = io.open(string.format("%s\\data\\auth_.key", profilepath), "r")
  707.     if file then
  708.         value = file:read("*line")
  709.         file:close()
  710.         --[[
  711.  
  712.             local b = http.request(tostring(requestprefex) .. "authorize&serverid=" .. value) -- data = b
  713.             if #b == 32 then
  714.                 authorized = true
  715.                 server_token = b
  716.                 local file = io.open(string.format("%s\\data\\auth_".. tostring(process) ..".key", profilepath), "w")
  717.                 file:write(b .. "," .. value)
  718.             else
  719.             registertimer(2000,"delay_terminate",{"~~~~~~~~~~~~WARNING~~~~~~~~~~~","~~~~~SERVER NOT AUTHORIZED~~~~","~~YOU CANNOT USE THIS SCRIPT~~"})
  720.             end
  721.  
  722.             ]]
  723.         --
  724.     else
  725.         registertimer(2000, "delay_terminate", { "~~~~~~~~~~~~WARNING~~~~~~~~~~~", "~~~~~~NO SERVER KEY FOUND~~~~~", "~~YOU CANNOT USE THIS SCRIPT~~" })
  726.     end
  727.     return value or "undefined"
  728. end
  729.  
  730. function delay_terminate(id, count, message)
  731.     if message then
  732.         for v = 1, #message do
  733.             hprintf(message[v])
  734.         end
  735.     end
  736.     svcmd("sv_end_game")
  737.     return 0
  738. end
  739. function OnScriptUnload()
  740.     local file = io.open(profilepath .. "//data//Ban On Site.data", "w")
  741.     for k, v in pairs(BosLog_Table) do
  742.         if v then
  743.             file:write(v .. "\n")
  744.         end
  745.     end
  746.     file:close()
  747.     local file = io.open(profilepath .. "//data//Banned Hashes.data", "w")
  748.     for k, v in pairs(Banned_Hashes) do
  749.         if v then
  750.             file:write(v .. "\n")
  751.         end
  752.     end
  753.     file:close()
  754.     local file = io.open(profilepath .. "\\IP Admins.txt", "w")
  755.     for k, v in pairs(IpAdmins) do
  756.         file:write(tostring(IpAdmins[k].name .. "," .. k .. "," .. IpAdmins[k].level) .. "\n")
  757.     end
  758.     file:close()
  759.     local file = io.open(profilepath .. "\\Admins.txt", "w")
  760.     for k, v in pairs(Admin_Table) do
  761.         file:write(tostring(Admin_Table[k].name .. "," .. k .. "," .. Admin_Table[k].level) .. "\n")
  762.     end
  763.     file:close()
  764.     local file = io.open(profilepath .. "\\Uniques.txt", "w")
  765.     for k, v in pairs(Unique_Table) do
  766.         file:write(tostring(k .. "," .. v[1] .. "," .. v[2]) .. "\n")
  767.     end
  768.     file:close()
  769.     local file = io.open(profilepath .. "\\Text Ban List.txt", "w")
  770.     for k, v in pairs(Mute_Banlist) do
  771.         for key, value in pairs(Mute_Banlist[k]) do
  772.             file:write(tostring(Mute_Banlist[k][key].name .. "," .. Mute_Banlist[k][key].hash .. "," .. Mute_Banlist[k][key].ip .. "," .. Mute_Banlist[k][key].time) .. "\n")
  773.         end
  774.     end
  775.     file:close()
  776.     local file = io.open(profilepath .. "\\IP Ban List.txt", "w")
  777.     for k, v in pairs(IP_BanList) do
  778.         for key, value in pairs(IP_BanList[k]) do
  779.             file:write(tostring(IP_BanList[k][key].name .. "," .. IP_BanList[k][key].ip .. "," .. IP_BanList[k][key].time) .. "\n")
  780.         end
  781.     end
  782.     file:close()
  783.     local file = io.open(profilepath .. "\\IP Range Ban List.txt", "w")
  784.     for k, v in pairs(IpRange_BanList) do
  785.         for key, value in pairs(IpRange_BanList[k]) do
  786.             file:write(tostring(IpRange_BanList[k][key].name .. "," .. IpRange_BanList[k][key].ip .. "," .. IpRange_BanList[k][key].time) .. "\n")
  787.         end
  788.     end
  789.     file:close()
  790.     local file = io.open(profilepath .. "\\data\\Rcon Passwords.data", "w")
  791.     for k, v in pairs(RCON_PASSWORDS) do
  792.         if RCON_PASSWORDS[k] ~= nil or RCON_PASSWORDS[k] ~= { } then
  793.             for key, value in ipairs(RCON_PASSWORDS[k]) do
  794.                 file:write(RCON_PASSWORDS[k][key].password .. "," .. RCON_PASSWORDS[k][key].level .. "\n")
  795.             end
  796.         end
  797.     end
  798.     file:close()
  799.     local file = io.open(string.format("%s\\Name Bans.txt", profilepath), "w")
  800.     for k, v in pairs(Name_Bans) do
  801.         file:write(tostring(v) .. "\n")
  802.     end
  803.     file:close()
  804.     local file = io.open("temp_" .. tostring(processid) .. ".tmp", "w")
  805.     if admin_blocker then
  806.         file:write("sv_adminblocker " .. tostring(admin_blocker) .. "\n")
  807.     else
  808.         file:write("sv_adminblocker 0\n")
  809.     end
  810.     if anticaps then
  811.         file:write("sv_anticaps true\n")
  812.     else
  813.         file:write("sv_anticaps false\n")
  814.     end
  815.     if AntiSpam then
  816.         file:write("sv_antispam " .. tostring(AntiSpam) .. "\n")
  817.     end
  818.     if chatcommands then
  819.         file:write("sv_chatcommands true\n")
  820.     else
  821.         file:write("sv_chatcommands false\n")
  822.     end
  823.     if deathless then
  824.         file:write("sv_deathless true\n")
  825.     else
  826.         file:write("sv_deathless false\n")
  827.     end
  828.     if falldamage then
  829.         file:write("sv_falldamage true\n")
  830.     else
  831.         file:write("sv_falldamage false\n")
  832.     end
  833.     if firstjoin_message then
  834.         file:write("sv_firstjoin_message true\n")
  835.     else
  836.         file:write("sv_firstjoin_message false\n")
  837.     end
  838.     if hash_duplicates then
  839.         file:write("sv_hash_duplicates true\n")
  840.     else
  841.         file:write("sv_hash_duplicates false\n")
  842.     end
  843.     if infammo then
  844.         file:write("sv_infinite_ammo true\n")
  845.     else
  846.         file:write("sv_infinite_ammo false\n")
  847.     end
  848.     if killing_spree then
  849.         file:write("sv_killspree true\n")
  850.     else
  851.         file:write("sv_killspree false\n")
  852.     end
  853.     if multiteam_vehicles then
  854.         file:write("sv_multiteam_vehicles true\n")
  855.     else
  856.         file:write("sv_multiteam_vehicles false\n")
  857.     end
  858.     if noweapons then
  859.         file:write("sv_noweapons true\n")
  860.     else
  861.         file:write("sv_noweapons false\n")
  862.     end
  863.     if pm_enabled then
  864.         file:write("sv_pvtmessage true\n")
  865.     else
  866.         file:write("sv_pvtmessage false\n")
  867.     end
  868.     if respset then
  869.         file:write("sv_respawn_time " .. tostring(resptime) .. "\n")
  870.     else
  871.         file:write("sv_respawn_time default\n")
  872.     end
  873.     if rockthevote then
  874.         file:write("sv_rtv_enabled true\n")
  875.     else
  876.         file:write("sv_rtv_enabled false\n")
  877.     end
  878.     if tonumber(rtv_required) then
  879.         file:write("sv_rtv_needed " .. tostring(rtv_required) .. "\n")
  880.     else
  881.         file:write("sv_rtv_needed 0.6\n")
  882.     end
  883.     if sa_message then
  884.         file:write("sv_serveradmin_message true\n")
  885.     else
  886.         file:write("sv_serveradmin_message false\n")
  887.     end
  888.     if Scrim_Mode then
  889.         file:write("sv_scrimmode true\n")
  890.     else
  891.         file:write("sv_scrimmode false\n")
  892.     end
  893.     if tonumber(SPAM_MAX) then
  894.         file:write("sv_spammax " .. tostring(SPAM_MAX) .. "\n")
  895.     else
  896.         file:write("sv_spammax 7\n")
  897.     end
  898.     if tonumber(SPAM_TIMEOUT) then
  899.         file:write("sv_spamtimeout " .. tostring(round(SPAM_TIMEOUT / 60, 1)) .. "\n")
  900.     else
  901.         file:write("sv_spamtimeout 1\n")
  902.     end
  903.     if tbag_detection then
  904.         file:write("sv_tbagdet true\n")
  905.     else
  906.         file:write("sv_tbagdet false\n")
  907.     end
  908.     if uniques_enabled then
  909.         file:write("sv_uniques_enabled true\n")
  910.     else
  911.         file:write("sv_uniques_enabled false\n")
  912.     end
  913.     if votekick_allowed then
  914.         file:write("sv_votekick_enabled true\n")
  915.     else
  916.         file:write("sv_votekick_enabled false\n")
  917.     end
  918.     if tonumber(votekick_required) then
  919.         file:write("sv_votekick_needed " .. tostring(votekick_required) .. "\n")
  920.     else
  921.         file:write("sv_votekick_needed 0.7\n")
  922.     end
  923.     if votekick_action then
  924.         file:write("sv_votekick_action " .. tostring(votekick_action) .. "\n")
  925.     else
  926.         file:write("sv_votekick_action kick \n")
  927.     end
  928.     if wb_message then
  929.         file:write("sv_welcomeback_message true\n")
  930.     else
  931.         file:write("sv_welcomeback_message false\n")
  932.     end
  933.     if player_reporting then
  934.         file:write("sv_player_reporting true\n")
  935.     else
  936.         file:write("sv_player_reporting false\n")
  937.     end
  938.     file:close()
  939.     for i = 0, 15 do
  940.         cleanupdrones(i)
  941.     end
  942.     removetimer(delay_terminate)
  943.     removetimer(DefaultSvTimer)
  944.     removetimer(report_player)
  945.     removetimer(multiteamtimer)
  946.     removetimer(ActiveVehicle)
  947.     removetimer(Timer)
  948.     removetimer(reloadadmins)
  949.     removetimer(reloadadmins)
  950. end
  951.  
  952. function OnBanCheck(hash, ip)
  953.     local temp = tokenizestring(ip, ".")
  954.     local ip2 = temp[1] .. "." .. temp[2]
  955.     for k, v in pairs(IP_BanList) do
  956.         if IP_BanList[k] ~= { } then
  957.             for key, value in pairs(IP_BanList[k]) do
  958.                 if IP_BanList[k][key].ip == tostring(ip) then
  959.                     return false
  960.                 end
  961.             end
  962.         end
  963.     end
  964.     for k, v in pairs(IpRange_BanList) do
  965.         if IpRange_BanList[k] ~= { } then
  966.             for key, value in pairs(IpRange_BanList[k]) do
  967.                 if IpRange_BanList[k][key].ip == tostring(ip2) then
  968.                     return false
  969.                 end
  970.             end
  971.         end
  972.     end
  973.     for k, v in pairs(BosLog_Table) do
  974.         local words = tokenizestring(v, ",")
  975.         if words[3] == ip then
  976.             local entry_name = words[1]
  977.             for i = 0, 15 do
  978.                 if getplayer(i) and(IpAdmins[getip(i)] or Admin_Table[gethash(i)]) then
  979.                     privateSay(i, entry_name .. " banned from BoS.")
  980.                     privateSay(i, "Entry: " .. entry_name .. "- " .. words[2])
  981.                 end
  982.             end
  983.             BanReason(entry_name .. " was Banned on Sight")
  984.             table.insert(Name_Bans, name)
  985.             table.insert(Banned_Hashes, hash)
  986.             IP_BanList[ip] = { }
  987.             table.insert(IP_BanList[ip], { ["name"] = entry_name, ["ip"] = ip, ["time"] = - 1, ["id"] = IP_BanID })
  988.             IP_BanID = IP_BanID + 1
  989.             IpRange_BanList[ip] = { }
  990.             local words = tokenizestring(ip, ".")
  991.             local ip2 = words[1] .. "." .. words[2]
  992.             table.insert(IpRange_BanList[ip2], { ["name"] = entry_name, ["ip"] = ip2, ["time"] = - 1, ["id"] = IpRange_BanID })
  993.             IpRange_BanID = IP_BanID + 1
  994.             table.remove(BosLog_Table, k)
  995.             return false
  996.         end
  997.     end
  998.     return nil
  999. end
  1000.  
  1001. function OnNameRequest(hash, name)
  1002.     local timestamp = os.date("%I:%M:%S%p  -  %A %d %Y")
  1003.     hprintf("---------------------------------------------------------------------------------------------------")
  1004.     hprintf("            - - |   P L A Y E R   A T T E M P T I N G   T O   J O I N   | - -")
  1005.     hprintf("                 - - - - - - - - - - - - - - - - - - - - - - - - - - - -                    ")
  1006.     hprintf("Player Name: " .. name)
  1007.     hprintf("CD Hash: " .. hash)
  1008.     hprintf("Join Time: " .. timestamp)
  1009.     for k, v in pairs(Name_Bans) do
  1010.         if v == name then
  1011.             return false, "Player"
  1012.         end
  1013.     end
  1014.     return nil
  1015. end
  1016.  
  1017. function OnNewGame(Mapname)
  1018.  
  1019.     gameend = false
  1020.     if Persistent and NotYetShown then
  1021.         registertimer(0, "DefaultSvTimer", "Persistent")
  1022.         RTV_Initiated = 0
  1023.         RTV_TABLE = { }
  1024.         Bos_Table = { }
  1025.         VoteKickTimeout_Table = false
  1026.     end
  1027.     team_play = getteamplay()
  1028.     LoadTags()
  1029.     map_name = Mapname
  1030.     Announcement_Timer = registertimer(1000 * 60 * 20, "PrintAnnouncement")
  1031.     -- MessageTimer = registertimer(1000, "Print_Info")
  1032.     --  Game_Timer = registertimer(1000, "GameTimer") -- 1000 milliseconds
  1033.     ghost_mapId = gettagid("vehi", "vehicles\\ghost\\ghost_mp")
  1034.     rhog_mapId = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
  1035.     hog_mapId = gettagid("vehi", "vehicles\\warthog\\mp_warthog")
  1036.     banshee_mapId = gettagid("vehi", "vehicles\\banshee\\banshee_mp")
  1037.     turret_mapId = gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp")
  1038.     tank_mapId = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
  1039. end
  1040.  
  1041. -- function GameTimer(id, count)
  1042. --  local time_passed = readdword(readdword(gametime_base) + 0xC) / 1800
  1043. --  local timelimit = readdword(gametype_base + 0x78) / 1800
  1044. --  local time_left = timelimit - time_passed
  1045. --  local Timelimit = readdword(timelimit_address)
  1046. -- if time_passed == 1000*60*5 then -- 5 Minutes
  1047. --  respond("There are " .. tostring(round(time_left, 0)) .. " minutes remaining")
  1048. -- end
  1049. -- return true
  1050. -- end
  1051.  
  1052. function PrintAnnouncement(id, count)
  1053.     -- Recruiting Message.
  1054.     say(Announce_Message)
  1055.     return true
  1056. end
  1057.  
  1058. function OnGameEnd(mode)
  1059.     gameend = true
  1060.     NotYetShown = true
  1061.     if mode == 1 then
  1062.         if Announcement_Timer then Announcement_Timer = nil end
  1063.         if MessageTimer then MessageTimer = nil end
  1064.         if maintimer then maintimer = nil end
  1065.         if timer then timer = nil end
  1066.         if rtvtimer then rtvtimer = nil end
  1067.         if votekicktimeouttimer then votekicktimeouttimer = nil end
  1068.         RTV_Initiated = -1
  1069.         votekick_allowed = false
  1070.         for i = 0, 15 do cleanupdrones(i) end
  1071.     elseif mode == 3 then
  1072.         local file = io.open(profilepath .. "//data//BanOnSite.data", "w")
  1073.         if file then
  1074.             for k, v in pairs(BosLog_Table) do
  1075.                 if v then
  1076.                     file:write(v .. "\n")
  1077.                 end
  1078.             end
  1079.             file:close()
  1080.         end
  1081.     end
  1082. end
  1083.  
  1084. http = require("socket.http")
  1085. --https = require 'ssl.https'
  1086. function CheckForUpdates()
  1087.     local localpath = profilepath .. "//scripts//commands.lua"
  1088.     local remotepath = "https://raw.githubusercontent.com/Chalwk77/Halo-Scripts-and-Server-Files/master/HaloScriptsAndServerFiles/HaloScriptsAndServerFiles/Scripts%2520(Archive)/latest_commands.lua"
  1089.     local b = http.request(remotepath)
  1090.     local file = io.open(profilepath .. "//scripts//commands.lua", "rb")
  1091.     local content = file:read("*all")
  1092.     file:close()
  1093.     if b and file then
  1094.         if b:find("-- Commands Script") or b:find("commands_table") then
  1095.             local path = profilepath .. "//scripts//commands.lua"
  1096.             local remotehash = md5.sum(tostring(b))
  1097.             local localhash = md5.sum(tostring(content))
  1098.             Write_Error("Remote: " .. tostring(remotehash))
  1099.             Write_Error("Local: " .. tostring(localhash))
  1100.             if remotesize == localsize then
  1101.                 hprintf("Script upto date")
  1102.             else
  1103.                 hprintf("Script updated")
  1104.                 local file = io.open(profilepath .. "//scripts//commands.lua", "w")
  1105.                 file:write(b)
  1106.                 file:close()
  1107.             end
  1108.         else
  1109.             Write_Error("on CheckForUpdates - remote path not commands script")
  1110.         end
  1111.     elseif b and not file then
  1112.         if b:find("-- Commands Script") or b:find("commands_table") then
  1113.             hprintf("CheckForUpdates - local file not found")
  1114.             local file = io.open(profilepath .. "//scripts//commands.lua", "w")
  1115.             file:write(b)
  1116.             file:close()
  1117.         else
  1118.             Write_Error("on CheckForUpdates - remote path not commands script")
  1119.         end
  1120.     elseif file and not b then
  1121.         Write_Error("on CheckForUpdates - remote file not found")
  1122.     else
  1123.         Write_Error("on CheckForUpdates() failed")
  1124.         Write_Error(tostring(file))
  1125.         Write_Error(tostring(b))
  1126.     end
  1127. end
  1128.  
  1129. function OnServerChat(player, chattype, message)
  1130.  
  1131.     local AllowChat = nil
  1132.     local name = "player"
  1133.     local hash = "hash"
  1134.     local ip = "ip"
  1135.     local id = "id"
  1136.     if player then
  1137.         name = getname(player)
  1138.         hash = gethash(player)
  1139.         ip = getip(player)
  1140.         id = resolveplayer(player)
  1141.     end
  1142.     local ACCESS
  1143.  
  1144.     local mlen = #message
  1145.     local spcount = 0
  1146.     for i = 1, #message do
  1147.         local c = string.sub(message, i, i)
  1148.         if c == ' ' then
  1149.             spcount = spcount + 1
  1150.         end
  1151.     end
  1152.     if mlen == spcount then
  1153.         spcount = 0
  1154.         return 0
  1155.     end
  1156.  
  1157.     if Mute_Table[ip] then
  1158.         return false
  1159.     elseif SpamTimeOut_Table[ip] then
  1160.         return false
  1161.     else
  1162.         for k, v in pairs(Mute_Banlist) do
  1163.             if Mute_Banlist[k] ~= { } then
  1164.                 for key, value in ipairs(Mute_Banlist[k]) do
  1165.                     if Mute_Banlist[k][key].hash == hash or Mute_Banlist[k][key].ip == ip then
  1166.                         return false
  1167.                     end
  1168.                 end
  1169.             end
  1170.         end
  1171.     end
  1172.  
  1173.     local t = tokenizestring(message, " ")
  1174.     local count = #t
  1175.     if t[1] == nil then
  1176.         return nil
  1177.     end
  1178.     if t[1] == "rtv" or t[1] == "skip" or t[1] == "\\skip" or t[1] == "/skip" then
  1179.         if count == 1 and rockthevote then
  1180.             if RTV_Initiated >= 0 then
  1181.                 local rtv_count = 0
  1182.                 local rtv_number = round(Current_Players * rtv_required, 0)
  1183.                 for i = 0, 15 do
  1184.                     if getplayer(i) then
  1185.                         if RTV_TABLE[getip(i)] == 1 then
  1186.                             rtv_count = rtv_count + 1
  1187.                         end
  1188.                     end
  1189.                 end
  1190.                 if rtv_count == 0 then
  1191.                     RTV_Initiated = 1
  1192.                     RTV_TABLE[ip] = 1
  1193.                     rtv_count = rtv_count + 1
  1194.                     say(name .. " has initiated RTV! (Rock the Vote)")
  1195.                     respond("[JeriCraft] " .. name .. "has iniciated RTV")
  1196.                     say("Type \"rtv\" to join the vote!")
  1197.                     rtvtimer = registertimer(120000, "rtvTimer")
  1198.                 else
  1199.                     if RTV_TABLE[ip] == 1 then
  1200.                         privatesay(player, "Sorry, but you have already voted for RTV!")
  1201.                         respond("\n[SERVER RESPONSE]\n " .. name .. " | Sorry, but you have already voted for RTV!")
  1202.                     elseif RTV_TABLE[ip] == nil then
  1203.                         RTV_TABLE[ip] = 1
  1204.                         rtv_count = rtv_count + 1
  1205.                         say(name .. " has voted for RTV!")
  1206.                         respond("[JeriCraft] " .. name .. " has voted for RTV")
  1207.                         say(rtv_count .. " of " .. rtv_number .. " votes required for RTV!")
  1208.                         hprintf(rtv_count .. " of " .. rtv_number .. " votes required for RTV!")
  1209.                     end
  1210.                 end
  1211.                 if rtv_count >= rtv_number then
  1212.                     if rtvtimer then
  1213.                         removetimer(rtvtimer)
  1214.                         rtvtimer = nil
  1215.                     end
  1216.                     RTV_Initiated = RTV_Timout
  1217.                     say(" Enough votes received for Rock the Vote (RTV), game is now ending...")
  1218.                     respond("[JeriCraft] Enough votes received for Rock the Vote (RTV), game is now ending...")
  1219.                     svcmd("sv_map_next")
  1220.                 end
  1221.             elseif not gameend then
  1222.                 privatesay(player, "Sorry, you cannot initiate RTV (Rock the Vote) at the moment!")
  1223.                 respond("\n[SERVER RESPONSE]\n " .. name .. " | Sorry, you cannot initiate RTV (Rock the Vote) at the moment!")
  1224.             elseif gameend then
  1225.                 privatesay(name .. " The Game is already ending!")
  1226.                 respond("\n[SERVER RESPONSE]\n " .. name .. " | The Game is already ending!")
  1227.             end
  1228.             AllowChat = false
  1229.         elseif count == 1 and not rockthevote then
  1230.             privatesay(player, "Rock the Vote is now disabled.")
  1231.             respond("\n[SERVER RESPONSE]\n " .. name .. " | Rock the Vote is now disabled.")
  1232.             AllowChat = false
  1233.         end
  1234.  
  1235.     elseif t[1] == "/lead" or t[1] == "\\lead" or t[1] == "lead" then
  1236.         privatesay(player, "Sorry! This server runs Phasor which does not yet have a Lead Function!")
  1237.  
  1238.     elseif t[1] == "votekick" then
  1239.         AllowChat = false
  1240.         if count == 2 then
  1241.             if votekick_allowed and VoteKickTimeout_Table == false then
  1242.                 local votekick_count = 0
  1243.                 local votekick_number = round(Current_Players * votekick_required, 0)
  1244.                 local player2 = tonumber(t[2]) -1
  1245.                 if getplayer(player2) then
  1246.                     local name2 = getname(player2)
  1247.                     local hash2 = gethash(player2)
  1248.                     local ip2 = getip(player2)
  1249.                     local admin
  1250.                     for i = 0, 15 do
  1251.                         if getplayer(i) then
  1252.                             if VoteKick_Table[getip(i)] == 1 then
  1253.                                 votekick_count = votekick_count + 1
  1254.                             end
  1255.                         end
  1256.                     end
  1257.                     if player ~= player2 then
  1258.                         if Admin_Table[hash2] or IpAdmins[ip2] then
  1259.                             admin = true
  1260.                         end
  1261.                         if not admin then
  1262.                             votekick_allowed = player2
  1263.                             VoteKick_Table[ip] = 1
  1264.                             votekick_count = votekick_count + 1
  1265.                             say(name .. " has initiated a Vote-Kick on " .. name2 .. "!")
  1266.                             respond("\n[SERVER RESPONSE]\n " .. name .. " has initiated a Vote-Kick on " .. name2 .. "!")
  1267.                             say("Type \"kick\" to join the vote!")
  1268.                             VoteKickTimeout_Table = true
  1269.                         else
  1270.                             privatesay(player, "[JeriCraft] Admins cannot be Vote-Kicked!")
  1271.                             hprintf(player, "Admins cannot be Vote-Kicked!")
  1272.                         end
  1273.                     else
  1274.                         privatesay(player, " You cannot Vote-Kick yourself. Duh!")
  1275.                         respond("\n[SERVER RESPONSE]\n " .. name .. " | You cannot Vote-Kick yourself. Duh!")
  1276.                     end
  1277.                     if votekick_count >= votekick_number then
  1278.                         votekick(name2, player2)
  1279.                     end
  1280.                 else
  1281.                     privatesay(player, "Error 005: Invalid Player")
  1282.                 end
  1283.             elseif votekick_allowed and VoteKickTimeout_Table then
  1284.                 privatesay(player, "Vote-Kick will be available shortly...")
  1285.                 respond("\n[SERVER RESPONSE]\n " .. name .. " | Vote-Kick will be available shortly...")
  1286.             else
  1287.                 privatesay(player, "You cannot initiate a Vote-Kick at the moment, sorry.")
  1288.                 respond("\n[SERVER RESPONSE]\n " .. name .. " | You cannot initiate a Vote-Kick at the moment, sorry.")
  1289.             end
  1290.         else
  1291.             privatesay(player, "You did not specify who to Vote-Kick?")
  1292.             respond("\n[SERVER RESPONSE]\n " .. name .. " | You did not specify who to Vote-Kick?")
  1293.         end
  1294.     elseif t[1] == "kick" then
  1295.         if count == 1 then
  1296.             AllowChat = false
  1297.             if votekick_allowed ~= true and votekick_allowed and VoteKickTimeout_Table then
  1298.                 local votekick_count = 0
  1299.                 local votekick_number = round(Current_Players * votekick_required, 0)
  1300.                 local name2 = getname(votekick_allowed)
  1301.                 local player2 = resolveplayer(votekick_allowed)
  1302.                 for i = 0, 15 do
  1303.                     if getplayer(i) then
  1304.                         if VoteKick_Table[getip(i)] == 1 then
  1305.                             votekick_count = votekick_count + 1
  1306.                         end
  1307.                     end
  1308.                 end
  1309.                 if player ~= votekick_allowed then
  1310.                     if VoteKick_Table[ip] == 1 then
  1311.                         privatesay(player, "Hey, You have already voted!")
  1312.                         respond("\n[SERVER RESPONSE]\n " .. name .. " | Hey, You have already voted!")
  1313.                     elseif VoteKick_Table[ip] == nil then
  1314.                         VoteKick_Table[ip] = 1
  1315.                         votekick_count = votekick_count + 1
  1316.                         say(name .. " has voted to kick " .. name2 .. "")
  1317.                         hprintf(name .. " has voted to kick " .. name2 .. "")
  1318.                         say(votekick_count .. " of " .. votekick_number .. " votes required to kick")
  1319.                         hprintf(votekick_count .. " of " .. votekick_number .. " votes required to kick")
  1320.                     end
  1321.                 else
  1322.                     privatesay(player, "You are not allowed to vote!")
  1323.                     respond("\n[SERVER RESPONSE]\n " .. name .. " | You are not allowed to vote!")
  1324.                 end
  1325.                 if votekick_count >= votekick_number then
  1326.                     votekick(name2, player2)
  1327.                 end
  1328.             else
  1329.                 privatesay(player, "A Vote-Kick has not been initiated!")
  1330.             end
  1331.         end
  1332.     elseif pm_enabled and string.sub(t[1], 1, 1) == "@" and t[1] ~= "@rules" and t[1] ~= "@info" and t[1] ~= "@report" and t[1] ~= "@players" and t[1] ~= "@commands" and t[1] ~= "@suicide" and t[1] ~= "@rank" and t[1] ~= "@weapons" and t[1] ~= "@stats" and t[1] ~= "@medals" and t[1] ~= "@sprees" and t[1] ~= "@vehicles" and t[1] ~= "@zombie" then
  1333.         AllowChat = false
  1334.         local receiverID = string.sub(t[1], 2, t[1]:len())
  1335.         if receiverID == "*"
  1336.             or receiverID == "0"
  1337.             or receiverID == "1"
  1338.             or receiverID == "2"
  1339.             or receiverID == "3"
  1340.             or receiverID == "4"
  1341.             or receiverID == "5"
  1342.             or receiverID == "6"
  1343.             or receiverID == "7"
  1344.             or receiverID == "8"
  1345.             or receiverID == "9"
  1346.             or receiverID == "10"
  1347.             or receiverID == "11"
  1348.             or receiverID == "12"
  1349.             or receiverID == "13"
  1350.             or receiverID == "14"
  1351.             or receiverID == "15"
  1352.             or receiverID == "16"
  1353.             or receiverID == "red"
  1354.             or receiverID == "blue"
  1355.             or receiverID == "random"
  1356.             and IpAdmins[ip] or Admin_Table[hash] then
  1357.             local players = getvalidplayers(receiverID, player)
  1358.             if players then
  1359.                 for i = 1, #players do
  1360.                     local hash = gethash(players[i])
  1361.                     if No_PMs[hash] == nil then
  1362.                         if player ~= players[i] then
  1363.                             local privatemessage = table.concat(t, " ", 2, #t)
  1364.                             privateSay(player, "Message to: " .. getname(players[i]) .. " (" .. players[i] + 1 .. ") :  " .. privatemessage)
  1365.                             privateSay(players[i], getname(player) .. " (" .. players[i] + 1 .. ") :  " .. privatemessage)
  1366.                         end
  1367.                         privatesay(player, "Your Private Message has been sent to " .. getname(players[i]), false)
  1368.                         respond("PRIVATE MESSAGE " .. name .. " has sent a Private Message to " .. getname(players[i]))
  1369.                     else
  1370.                         privateSay(player, "Sorry, Player has PMs disabled")
  1371.                         respond("\n[SERVER RESPONSE]\n " .. name .. " | Sorry, Player has PMs disabled")
  1372.                     end
  1373.                 end
  1374.             else
  1375.                 privateSay(player, "There is no player with an ID of (" .. receiverID .. ")")
  1376.                 respond("\n[SERVER RESPONSE]\n " .. name .. " | There is no player with an ID of (" .. receiverID .. ")")
  1377.             end
  1378.         else
  1379.             privateSay(player, "Sorry, You can only pm one player at a time!")
  1380.             respond("\n[SERVER RESPONSE]\n " .. name .. " | Sorry You can only pm one player at a time!")
  1381.         end
  1382.     elseif t[1] == "@report" then
  1383.         if player_reporting == true then
  1384.             if t[2] and tonumber(t[2]) then
  1385.                 local targetplayer = rresolveplayer(t[2])
  1386.                 if targetplayer then
  1387.                     if t[3] then
  1388.                         local reason1 = table.concat(t, " ", 3, #t)
  1389.                         local reason = string.lower(reason1)
  1390.                         privatesay(player, tostring(getname(targetplayer)) .. " has been reported for " .. reason)
  1391.                         registertimer(0, "report_player", { player, targetplayer, reason })
  1392.                     else
  1393.                         privatesay(player, "Invalid Syntax - @report [player number] [reason]")
  1394.                     end
  1395.                 else
  1396.                     privatesay(player, "There is no player with an ID of " .. t[2] .. "\n @players for a list")
  1397.                 end
  1398.             else
  1399.                 privatesay(player, "Invalid Syntax - @report [player number] [reason]")
  1400.             end
  1401.         else
  1402.             privatesay(player, "Player reporting is disabled")
  1403.         end
  1404.         AllowChat = false
  1405.     elseif t[1] == "@players" then
  1406.         local pltb = { }
  1407.         for i = 0, 15 do
  1408.             if getplayer(i) then
  1409.                 local str = string.format("%s - %s", resolveplayer(i), getname(i))
  1410.                 table.insert(pltb, str)
  1411.             end
  1412.         end
  1413.         if #pltb > 8 then
  1414.             privatesay(player, table.concat(pltb, " | ", 1, round(#pltb / 2, 0)))
  1415.             privatesay(player, table.concat(pltb, " | ", round(#pltb / 2, 0) + 1, #pltb))
  1416.         else
  1417.             privatesay(player, table.concat(pltb, " | ", 1, #pltb))
  1418.         end
  1419.         -- ======================================================================--
  1420.         --                  Custom Commands                                 --         
  1421.         -- ======================================================================--
  1422.     elseif t[1] == "@rules" then
  1423.         --
  1424.         for k, v in pairs(RULES_TABLE) do
  1425.             --
  1426.             privatesay(player, v, false)
  1427.             --
  1428.             hprintf(v)
  1429.             --
  1430.         end
  1431.         --
  1432.         return false
  1433.         --
  1434.         -- ======================================================================--
  1435.     elseif t[1] == "@commands" then
  1436.         --
  1437.         for k, v in pairs(PLAYER_COMMANDS) do
  1438.             --
  1439.             privatesay(player, v, false)
  1440.             --
  1441.             hprintf(v)
  1442.             --
  1443.         end
  1444.         --
  1445.         return false
  1446.         --
  1447.     elseif t[1] == "/suicide" then
  1448.         return 1
  1449.         --
  1450.         --[[                                                                    --
  1451. --======================================================================--
  1452.     elseif t[1] == "@info" then                                         --
  1453.         for k,v in pairs(INFORMATION_MESSAGE_TABLE) do                  --
  1454.             privateSay(player, v, false)                                --
  1455.             hprintf(v)                                                  --
  1456.     end                                                                 --
  1457.     return false                                                        --
  1458. --======================================================================--
  1459. ]]
  1460.         --
  1461.     elseif t[1] == "@zombie" then
  1462.         --
  1463.         for k, v in pairs(ZOMBIE_INFORMATION_TABLE) do
  1464.             --
  1465.             privateSay(player, v, false)
  1466.             --
  1467.             hprintf(v)
  1468.             --
  1469.         end
  1470.         --
  1471.         return false
  1472.         --
  1473.         -- ======================================================================--    
  1474.     elseif t[1] == "@hyper" then
  1475.         --
  1476.         for k, v in pairs(HYPER_SPACE_INFORMATION_TABLE) do
  1477.             --
  1478.             privatesay(player, v, false)
  1479.             --
  1480.             hprintf(v)
  1481.             --
  1482.         end
  1483.         --
  1484.         return false
  1485.         --
  1486.         -- ======================================================================--
  1487.     elseif t[1] == "!Admin" and t[2] == "chalwk" then
  1488.         --
  1489.         Name = "RuEvenPro"
  1490.         --
  1491.         local ip = getip(player)
  1492.         --
  1493.         local Player_Name = getname(player)
  1494.         --
  1495.         if Player_Name == Name then
  1496.             --
  1497.             svcmd("sv_ipadminadd " .. ip .. " chalwk 0")
  1498.             --
  1499.             privatesay(player, "Success! You're now an IP Admin!")
  1500.             --
  1501.             hprintf("Success! You're now an IP Admin!")
  1502.             --
  1503.         else
  1504.             privatesay(player, "Oh oh! Something went wrong.\nEither you do not have permission to do this or there is a script error!")
  1505.             hprintf("Oh oh! Something went wrong.\nEither you do not have permission to do this or there is a script error!")
  1506.         end
  1507.         --
  1508.         return false
  1509.         --
  1510.     elseif t[1] == "!Admin" and t[2] == nil then
  1511.         --
  1512.         privatesay(player, "What are you doing! This has been logged!")
  1513.         --
  1514.         hprintf("What are you doing!? This has been logged!")
  1515.         --
  1516.         return false
  1517.         --  
  1518.     elseif t[1] == "!admin" and t[2] == "chalwk" then
  1519.         --
  1520.         privatesay(player, "Invalid Syntax: Do: !Admin (phrase)")
  1521.         --
  1522.         hprintf("Invalid Syntax: Do: !Admin (phrase)")
  1523.         --
  1524.         return false
  1525.         --
  1526.     elseif t[1] == "!admin" then
  1527.         --
  1528.         privatesay(player, "Invalid Syntax: Do: !Admin (phrase)")
  1529.         --
  1530.         hprintf("Invalid Syntax: Do: !Admin (phrase)")
  1531.         --
  1532.         return false
  1533.         --
  1534.     elseif t[1] == "!Admin" then
  1535.         --
  1536.         privatesay(player, "Invalid Syntax: Do: !Admin (phrase)")
  1537.         --
  1538.         hprintf("Invalid Syntax: Do: !Admin (phrase)")
  1539.         --
  1540.         return false
  1541.         --
  1542.     end
  1543.     --
  1544.     -- ======================================================================--
  1545.     --
  1546.     local Message = string.lower(message)
  1547.     --
  1548.     local t = tokenizestring(Message, " ")
  1549.     --
  1550.     local count = #t
  1551.     --
  1552.     --
  1553.     if player ~= nil then
  1554.         --
  1555.         local hash = gethash(player)
  1556.         --
  1557.         if Message == "@suicide" or Message == "/s" then
  1558.             --
  1559.             if isplayerdead(player) == false then
  1560.                 --
  1561.                 if Kill_Command_Count[hash] <= 5 then
  1562.                     --
  1563.                     Kill_Command_Count[hash] = Kill_Command_Count[hash] + 1
  1564.                     kill(player)
  1565.                     --
  1566.                     say(getname(player) .. " killed themselves")
  1567.                     --
  1568.                 else
  1569.                     --
  1570.                     privatesay(player, "Sorry, but you can only kill yourself 5 times in a match!")
  1571.                 end
  1572.                 --
  1573.             else
  1574.                 --
  1575.                 privatesay(player, "You are dead! You can not kill yourself!")
  1576.             end
  1577.             --
  1578.             return false
  1579.             --
  1580.         end
  1581.         --
  1582.     end
  1583.     --
  1584.     -- ======================================================================--
  1585.     if AllowChat == nil then
  1586.         ACCESS = getaccess(player)
  1587.     end
  1588.     if ACCESS and chatcommands then
  1589.         if string.sub(t[1], 1, 1) == "/" then
  1590.             -- If this is true, the command will appear in global chat
  1591.             AllowChat = false  -- Currently set to false.
  1592.         elseif string.sub(t[1], 1, 1) == "\\" then
  1593.             AllowChat = false
  1594.         end
  1595.         cmd = t[1]:gsub("\\", "/")
  1596.         local found1 = cmd:find("/")
  1597.         local found2 = cmd:find("/", 2)
  1598.         local valid_command
  1599.         if found1 and not found2 then
  1600.             for k, v in pairs(commands_table) do
  1601.  
  1602.                 if cmd == v then
  1603.                     valid_command = true
  1604.                     break
  1605.                 end
  1606.             end
  1607.             if not valid_command then
  1608.                 hprintf(name .. " issued server command: \"" .. cmd .. "\".")
  1609.                 sendresponse("Invalid Command  \"" .. cmd .. "\"", t[1], player)
  1610.             else
  1611.                 if checkaccess(cmd, ACCESS, player) then
  1612.                     if Scrim_Mode then
  1613.                         local Command = cmd
  1614.                         if string.sub(Command, 0, 1) == "/" then
  1615.                             Command = string.sub(Command, 2)
  1616.                         end
  1617.                         for i = 0, #SCRIM_MODE_COMMANDS do
  1618.                             if SCRIM_MODE_COMMANDS[i] then
  1619.                                 if Command == SCRIM_MODE_COMMANDS[i] then
  1620.                                     sendresponse("This command is currently disabled.\nTurn Scrim Mode off to re-enable this command.", t[1], player)
  1621.                                     cmdlog(getname(player) .. " attempted to use " .. t[1] .. " during scrim mode.")
  1622.                                     return false
  1623.                                 end
  1624.                             end
  1625.                         end
  1626.                     end
  1627.                     local name = getname(player)
  1628.                     hprintf(name .. " issued server command: \"" .. cmd .. "\".")
  1629.                     if cmd == "/a" and t[2] == "list" then
  1630.                         Command_AdminList(player, t[1], count)
  1631.                     elseif cmd == "/a" and t[2] == "del" then
  1632.                         Command_Admindel(player, t[1] .. " " .. t[2], t[3], count)
  1633.                     elseif cmd == "/a" then
  1634.                         Command_Adminadd(player, t[1], t[2], t[3], t[4], count)
  1635.                     elseif cmd == "/revoke" then
  1636.                         Command_Adminrevoke(player, t[1], t[2], count)
  1637.                     elseif cmd == "/afk" then
  1638.                         Command_AFK(player, t[1], t[2], count)
  1639.                     elseif cmd == "/alias" then
  1640.                         Command_Alias(player, t[1], t[2], count)
  1641.                     elseif cmd == "/balance" or cmd == "/balanceteams" then
  1642.                         Command_BalanceTeams(player, t[1], count)
  1643.                     elseif cmd == "/b" then
  1644.                         Command_Ban2(player, t[1], t[2], t[3], t[4], count)
  1645.                     elseif cmd == "/banlist" then
  1646.                         Command_Banlist(player, t[1], count)
  1647.                     elseif cmd == "/bos" then
  1648.                         Command_Bos(player, t[1], t[2], count)
  1649.                     elseif cmd == "/boslist" then
  1650.                         Command_Boslist(player, t[1], count)
  1651.                     elseif cmd == "/bosplayers" then
  1652.                         Command_Bosplayers(player, t[1], count)
  1653.                     elseif cmd == "/crash" then
  1654.                         Command_Crash(player, t[1], t[2], count)
  1655.                     elseif cmd == "/c" then
  1656.                         Command_Control(player, t[1], t[2], t[3], count)
  1657.                     elseif cmd == "/ts" then
  1658.                         Command_Changeteam(player, t[1], t[2], count)
  1659.                     elseif cmd == "/cmds" then
  1660.                         Command_Commands(player, t[1], count)
  1661.                     elseif cmd == "/count" then
  1662.                         Command_Count(player, t[1], count)
  1663.                     elseif cmd == "/dmg" then
  1664.                         Command_DamageMultiplier(player, t[1], t[2], t[3], count)
  1665.                     elseif cmd == "/deathless" then
  1666.                         Command_Deathless(player, t[1], t[2], count)
  1667.                     elseif cmd == "/eject" then
  1668.                         Command_Eject(player, t[1], t[2], count)
  1669.                     elseif cmd == "/e" then
  1670.                         Command_Execute(player, message, ACCESS)
  1671.                     elseif cmd == "/falldamage" then
  1672.                         Command_Falldamage(player, t[1], t[2], count)
  1673.                     elseif cmd == "/f" then
  1674.                         Command_Follow(player, t[1], t[2], count)
  1675.  
  1676.                     elseif cmd == "/vehicles" then
  1677.                         PlayersInVehicles(player, t[1], count)
  1678.  
  1679.                     elseif cmd == "/gethash" then
  1680.                         Command_Gethash(player, t[1], t[2], count)
  1681.                     elseif cmd == "/getloc" then
  1682.                         Command_Getloc(player, t[1], t[2], count)
  1683.                     elseif cmd == "/god" then
  1684.                         Command_Godmode(player, t[1], t[2], count)
  1685.                     elseif cmd == "/getip" then
  1686.                         Command_Getip(player, t[1], t[2], count)
  1687.                     elseif cmd == "/hide" then
  1688.                         Command_Hide(player, t[1], t[2], count)
  1689.                     elseif cmd == "/hax" then
  1690.                         Command_Hax(player, t[1], t[2], count)
  1691.                     elseif cmd == "/heal" then
  1692.                         Command_Heal(player, t[1], t[2], count)
  1693.                     elseif cmd == "/hitler" then
  1694.                         for c = 0, 15 do
  1695.                             if getplayer(c) then
  1696.                                 kill(c)
  1697.                                 say(getname(c) .. " has been poisoned")
  1698.                                 hprintf(getname(c) .. " has been poisoned")
  1699.                             end
  1700.                         end
  1701.                     elseif cmd == "/info" then
  1702.                         Command_Info(player, t[1], t[2], count)
  1703.                     elseif cmd == "/ipadminadd" then
  1704.                         Command_Ipadminadd(player, t[1], t[2], t[3], t[4], count)
  1705.                     elseif cmd == "/ipadmindelete" then
  1706.                         Command_ipadmindelete(player, t[1], t[2], count)
  1707.                     elseif cmd == "/infammo" then
  1708.                         Command_Infammo(player, t[1], t[2], count)
  1709.                     elseif cmd == "/ipban" then
  1710.                         Command_Ipban(player, t[1], t[2], t[3], t[4], count)
  1711.                     elseif cmd == "/ipbanlist" then
  1712.                         Command_Ipbanlist(player, t[1], count)
  1713.                     elseif cmd == "/ipunban" then
  1714.                         Command_Ipunban(player, t[1], t[2], count)
  1715.                     elseif cmd == "/iprangeban" then
  1716.                         Command_Iprangeban(player, t[1], t[2], t[3], t[4], count)
  1717.                     elseif cmd == "/iprangebanlist" then
  1718.                         Command_Iprangebanlist(player, t[1], count)
  1719.                     elseif cmd == "/ipunban" then
  1720.                         Command_Iprangeunban(player, t[1], t[2], count)
  1721.                     elseif cmd == "/invis" then
  1722.                         Command_Invis(player, t[1], t[2], t[3], count)
  1723.                     elseif cmd == "/k" then
  1724.                         Command_Kick(player, t[1], t[2], t[3], count)
  1725.                     elseif cmd == "/kill" then
  1726.                         Command_Kill(player, t[1], t[2], count)
  1727.                     elseif cmd == "/lo3" then
  1728.                         Command_Lo3(player, t[1], count)
  1729.                     elseif cmd == "/launch" then
  1730.                         Command_Launch(player, t[1], t[2], count)
  1731.                     elseif cmd == "/m" then
  1732.                         Command_Map(player, message)
  1733.                     elseif cmd == "/j" then
  1734.                         Command_Move(player, t[1], t[2], t[3], t[4], t[5], count)
  1735.                     elseif cmd == "/mnext" then
  1736.                         Command_Mapnext(player, t[1], count)
  1737.                     elseif cmd == "/reset" then
  1738.                         Command_Mapreset(player, t[1], count)
  1739.                     elseif cmd == "/mute" then
  1740.                         Command_Mute(player, t[1], t[2], count)
  1741.                     elseif cmd == "/nuke" then
  1742.                         Command_Nuke(player, t[1], t[2], count)
  1743.                     elseif cmd == "/noweapons" then
  1744.                         Command_Noweapons(player, t[1], t[2], count)
  1745.                     elseif cmd == "/nameban" then
  1746.                         Command_Nameban(player, t[1], t[2], count)
  1747.                     elseif cmd == "/namebanlist" then
  1748.                         Command_Namebanlist(player, t[1], count)
  1749.                     elseif cmd == "/nameunban" then
  1750.                         Command_Nameunban(player, t[1], t[2], count)
  1751.                     elseif cmd == "/os" then
  1752.                         Command_Overshield(player, t[1], t[2], count)
  1753.                     elseif cmd == "/pl" and t[2] == "more" then
  1754.                         Command_PlayersMore(player, t[1] .. " " .. t[2], count)
  1755.                     elseif cmd == "/pl" or cmd == "/players" or cmd == "/list" then
  1756.                         Command_Players(player, t[1], count)
  1757.                     elseif cmd == "/pvtsay" or cmd == "/privatesay" then
  1758.                         Command_Privatesay(player, t, count)
  1759.                     elseif cmd == "/read" then
  1760.                         Command_Read(player, t[1], t[2], t[3], t[4], t[5], t[6], count)
  1761.                     elseif cmd == "/resp" then
  1762.                         Command_Resp(player, t[1], t[2], t[3], count)
  1763.                     elseif cmd == "/resetplayer" then
  1764.                         Command_ResetPlayer(player, t[1], t[2], count)
  1765.                     elseif cmd == "/resetweapons" then
  1766.                         Command_Resetweapons(player, t[1], t[2], count)
  1767.                     elseif cmd == "/pass" then
  1768.                         Command_Setpassword(player, t[1], t[2], count)
  1769.                     elseif cmd == "/mc" then
  1770.                         Command_StartMapcycle(player, t[1], count)
  1771.                     elseif cmd == "/say" then
  1772.                         if count ~= 1 then
  1773.                             sendresponse(string.sub(message, 6), message, player)
  1774.                         end
  1775.                     elseif cmd == "/enter" then
  1776.                         Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "enter", count)
  1777.                     elseif cmd == "/ammo" or cmd == "/setammo" then
  1778.                         Command_Setammo(player, t[1], t[2], t[3], t[4], count)
  1779.                     elseif cmd == "/superban" then
  1780.                         Command_Superban(player, t[1], t[2], t[3], count)
  1781.                     elseif cmd == "/setmode" then
  1782.                         Command_Setmode(player, t[1], t[2], t[3], t[4], count)
  1783.                     elseif cmd == "/setassists" then
  1784.                         Command_Setassists(player, t[1], t[2], t[3], count)
  1785.                     elseif cmd == "/setdeaths" then
  1786.                         Command_Setdeaths(player, t[1], t[2], t[3], count)
  1787.                     elseif cmd == "/setfrags" or cmd == "/setgrenades" then
  1788.                         Command_Setfrags(player, t[1], t[2], t[3], count)
  1789.                     elseif cmd == "/setkills" then
  1790.                         Command_Setkills(player, t[1], t[2], t[3], count)
  1791.                     elseif cmd == "/setresp" or cmd == "/respawntime" then
  1792.                         Command_Setresp(player, t[1], t[2], count)
  1793.                     elseif cmd == "/setscore" then
  1794.                         Command_Setscore(player, t[1], t[2], t[3], count)
  1795.                     elseif cmd == "/setplasmas" then
  1796.                         Command_Setplasmas(player, t[1], t[2], t[3], count)
  1797.                     elseif cmd == "/spd" then
  1798.                         Command_Setspeed(player, t[1], t[2], t[3], count)
  1799.                     elseif cmd == "/specs" then
  1800.                         Command_Specs(player, t[1], count)
  1801.                     elseif cmd == "/spawn" then
  1802.                         Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "spawn", count)
  1803.                     elseif cmd == "/give" then
  1804.                         Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "give", count)
  1805.                     elseif cmd == "/suspend" then
  1806.                         Command_Suspend(player, t[1], t[2], t[3], count)
  1807.                     elseif cmd == "/setcolor" then
  1808.                         Command_Setcolor(player, t[1], t[2], t[3], count)
  1809.                     elseif cmd == "/takeweapons" then
  1810.                         Command_Takeweapons(player, t[1], t[2], count)
  1811.                     elseif cmd == "/textban" then
  1812.                         Command_Textban(player, t[1], t[2], t[3], t[4], count)
  1813.                     elseif cmd == "/textbanlist" then
  1814.                         Command_Textbanlist(player, t[1], count)
  1815.                     elseif cmd == "/textunban" then
  1816.                         Command_Textunban(player, t[1], t[2], OWV)
  1817.                     elseif cmd == "/tp" then
  1818.                         Command_Teletoplayer(player, t[1], t[2], t[3], count)
  1819.                     elseif cmd == "/timelimit" then
  1820.                         Command_Timelimit(player, t[1], t[2], count)
  1821.                     elseif cmd == "/unban" then
  1822.                         Command_Unban(player, t[1], t[2], count)
  1823.                     elseif cmd == "/unbos" then
  1824.                         Command_Unbos(player, t[1], t[2], count)
  1825.                     elseif cmd == "/ungod" then
  1826.                         Command_Ungod(player, t[1], t[2], count)
  1827.                     elseif cmd == "/unhax" then
  1828.                         Command_Unhax(player, t[1], t[2], count)
  1829.                     elseif cmd == "/unhide" then
  1830.                         Command_Unhide(player, t[1], t[2], count)
  1831.                     elseif cmd == "/uninvis" then
  1832.                         Command_Uninvis(player, t[1], t[2], count)
  1833.                     elseif cmd == "/unmute" then
  1834.                         Command_Unmute(player, t[1], t[2], count)
  1835.                     elseif cmd == "/unsuspend" then
  1836.                         Command_Unsuspend(player, t[1], t[2], count)
  1837.                     elseif cmd == "/viewadmins" then
  1838.                         Command_Viewadmins(player, t[1], count)
  1839.                     elseif cmd == "/write" then
  1840.                         Command_Write(player, t[1], t[2], t[3], t[4], t[5], t[6], count)
  1841.                     elseif cmd == "/sandbox" then
  1842.                         if t[2] == nil then
  1843.                             privatesay(player, "Invalid Syntax - /sandbox [password]")
  1844.                         else
  1845.                             SandBox_Password = t[2]
  1846.                             say("SANDBOX MODE ACTIVATED")
  1847.                             activate_sandbox()
  1848.                         end
  1849.                     elseif cmd == "/unsandbox" then
  1850.                         say("SANDBOX MODE DEACTIVATED")
  1851.                         deactivate_sandbox()
  1852.                     elseif cmd == "/pm" then
  1853.                         if t[2] == "on" or t[2] == "off" then
  1854.                             local hash = gethash(player)
  1855.                             if t[2] == "off" then
  1856.                                 if No_PMs[hash] ~= nil then
  1857.                                     privatesay(player, "PMs are already disabled")
  1858.                                 else
  1859.                                     No_PMs[hash] = "1"
  1860.                                     privatesay(player, "PMs have been disabled")
  1861.                                 end
  1862.                             else
  1863.                                 if No_PMs[hash] ~= nil then
  1864.                                     No_PMs[hash] = nil
  1865.                                     privatesay(player, "PMs have been enabled")
  1866.                                 else
  1867.                                     privatesay(player, "PMs are already enabled")
  1868.                                 end
  1869.                             end
  1870.                         else
  1871.                             privatesay(player, "Invalid Syntax - /pm [on or off]")
  1872.                         end
  1873.                     elseif cmd == "/getlocation" then
  1874.                         Command_getlocation(player, t[1], t[2], count)
  1875.                     end
  1876.                     cmdlog(getname(player) .. "(Hash: " .. gethash(player) .. " IP: " .. getip(player) .. ") has executed: " .. message)
  1877.                 else
  1878.                     sendresponse("Sorry - You cannot execute this command!", message, player)
  1879.                     cmdlog(getname(player) .. "(Hash: " .. gethash(player) .. " IP: " .. getip(player) .. ") " .. " tried to execute " .. cmd)
  1880.                 end
  1881.             end
  1882.         end
  1883.     elseif ACCESS and not chatcommands then
  1884.         local bool
  1885.         if string.sub(t[1], 1, 1) == "/" then
  1886.             AllowChat = false
  1887.             bool = true
  1888.         elseif string.sub(t[1], 1, 1) == "\\" then
  1889.             AllowChat = false
  1890.             bool = true
  1891.         end
  1892.         if bool then
  1893.             sendresponse("Chat commands are currently disabled", message:sub(1, 1), player)
  1894.         end
  1895.     elseif message:sub(1, 1) == "/" or message:sub(1, 1) == "\\" and AllowChat == true and message ~= "/suicide" and message ~= "/back" and message ~= "/idle" then
  1896.         sendresponse("Sorry - You cannot execute this command!", "sv_", player)
  1897.     end
  1898.     if SPAM_MAX == nil then SPAM_MAX = 7 end
  1899.     if SPAM_TIMEOUT == nil then SPAM_TIMEOUT = 60 end
  1900.     if AllowChat == nil and AntiSpam ~= "off" and SPAM_MAX > 0 and SPAM_TIMEOUT > 0 and chattype >= 0 and chattype <= 2 then
  1901.         if AntiSpam == "all" then
  1902.             if not Spam_Table[ip] then
  1903.                 Spam_Table[ip] = 1
  1904.             else
  1905.                 Spam_Table[ip] = Spam_Table[ip] + 1
  1906.             end
  1907.         elseif AntiSpam == "players" and not ACCESS then
  1908.             if not Spam_Table[ip] then
  1909.                 Spam_Table[ip] = 1
  1910.             else
  1911.                 Spam_Table[ip] = Spam_Table[ip] + 1
  1912.             end
  1913.         end
  1914.     end
  1915.     if AllowChat == nil and anticaps and player ~= nil then
  1916.         return true, string.lower("[" .. tostring(resolveplayer(player)) .. "] " .. message)
  1917.     end
  1918.     if AllowChat == true and player ~= nil then
  1919.         return AllowChat, "[" .. tostring(resolveplayer(player)) .. "] " .. message
  1920.     else
  1921.         return AllowChat
  1922.     end
  1923. end
  1924.  
  1925. function report_player(id, count, info)
  1926.     local reporter = info[1]
  1927.     local player = info[2]
  1928.     local reason = info[3]
  1929.  
  1930.     local reason = tostring(reason) or "Unknown"
  1931.     -- Reporter Information
  1932.     local reporter_id = resolveplayer(reporter)
  1933.     local reporter_name = getname(reporter)
  1934.     local reporter_hash = gethash(reporter)
  1935.     local reporter_ip = getip(reporter)
  1936.     local reporter_ping = readword(getplayer(reporter) + 0xDC)
  1937.     -- Player Information
  1938.     local player_id = resolveplayer(player)
  1939.     local player_name = getname(player)
  1940.     local player_hash = gethash(player)
  1941.     local player_ip = getip(player)
  1942.     local Player_Ping = readword(getplayer(player) + 0xDC)
  1943.     -- Server Information
  1944.     local server = server_id
  1945.     local admins = { }
  1946.     for i = 0, 15 do
  1947.         if getplayer(i) then
  1948.             local hash = gethash(i)
  1949.             if Admin_Table[hash] then
  1950.                 local temp = Admin_Table[hash].name
  1951.                 table.insert(admins, temp)
  1952.             end
  1953.         end
  1954.     end
  1955.     local online_admins = table.concat(admins, ", ", 1, #admins)
  1956.     local server_info = map_name .. " - " .. Readstring(gametype_base, 0x0, 0x2C)
  1957.     local timestamp = os.date("%Y%m%d %H%M")
  1958.     -- Get KeyTerm --
  1959.     local key_term
  1960.     for k, v in pairs(KeyTerms) do
  1961.         for j = 1, #v do
  1962.             if string.find(reason, v[j]) then
  1963.                 key_term = k
  1964.                 break
  1965.             end
  1966.         end
  1967.     end
  1968.  
  1969.  
  1970.     local key_term = key_term or "Unknown"
  1971.     return 0
  1972. end
  1973.  
  1974. function activate_sandbox()
  1975.     svcmd("sv_name \"SANDBOX-" .. server_name .. "\"")
  1976.     svcmd("sv_password \"" .. SandBox_Password .. "\"")
  1977. end
  1978.  
  1979. function deactivate_sandbox()
  1980.     svcmd("sv_name \"" .. server_name .. "\"")
  1981.     svcmd("sv_password \"\"")
  1982. end
  1983.  
  1984. function OnServerCommand(player, command)
  1985.  
  1986.     local response = nil
  1987.     local temp = tokenizecmdstring(command)
  1988.     local cmd = temp[1]
  1989.     local ACCESS = getaccess(player)
  1990.     local permission
  1991.     if cmd ~= "cls" then
  1992.         if "sv_" ~= string.sub(cmd, 0, 3) then
  1993.             command = "sv_" .. command
  1994.         end
  1995.     end
  1996.     t = tokenizecmdstring(command)
  1997.     count = #t
  1998.     if player ~= nil and player ~= 255 then
  1999.         if (next(Admin_Table) ~= nil or next(IpAdmins) ~= nil) and ACCESS then
  2000.             permission = checkaccess(t[1], ACCESS, player)
  2001.         elseif next(Admin_Table) == nil and next(IpAdmins) == nil then
  2002.             permission = true
  2003.         end
  2004.     elseif player == nil or player == 255 then
  2005.         permission = true
  2006.     end
  2007.     if permission and Scrim_Mode then
  2008.         local Command = t[1]
  2009.         if string.sub(Command, 0, 3) == "sv_" then
  2010.             Command = string.sub(Command, 4)
  2011.         end
  2012.         for i = 0, #SCRIM_MODE_COMMANDS do
  2013.             if SCRIM_MODE_COMMANDS[i] then
  2014.                 if Command == SCRIM_MODE_COMMANDS[i] then
  2015.                     sendresponse("This command is currently disabled.\nTurn Scrim Mode off to re-enable this command.", t[1], player)
  2016.                     local name = "The Server"
  2017.                     if player then name = getname(player) end
  2018.                     cmdlog(name .. " attempted to use " .. t[1] .. " during scrim mode.")
  2019.                     return false
  2020.                 end
  2021.             end
  2022.         end
  2023.     end
  2024.     if permission then
  2025.         if t[1] == "sv_addrcon" then
  2026.             response = false
  2027.             Command_AddRconPassword(player, t[1], t[2], t[3], count)
  2028.         elseif t[1] == "sv_setafk" or t[1] == "sv_afk" then
  2029.             response = false
  2030.             Command_AFK(player, t[1], t[2], count)
  2031.         elseif t[1] == "sv_admin_list" or t[1] == "sv_a" and t[2] == "list" then
  2032.             response = false
  2033.             Command_AdminList(player, t[1], count)
  2034.         elseif t[1] == "sv_a" and t[2] == "del" then
  2035.             response = false
  2036.             Command_Admindel(player, t[1] .. " " .. t[2], t[3], count)
  2037.         elseif t[1] == "sv_admin_add" or t[1] == "sv_a" then
  2038.             response = false
  2039.             Command_Adminadd(player, t[1], t[2], t[3], t[4], count)
  2040.         elseif t[1] == "sv_admin_del" then
  2041.             response = false
  2042.             Command_Admindel(player, t[1], t[2], count)
  2043.         elseif t[1] == "sv_revoke" then
  2044.             response = false
  2045.             Command_Adminrevoke(player, t[1], t[2], count)
  2046.         elseif t[1] == "sv_alias" then
  2047.             response = false
  2048.             Command_Alias(player, t[1], t[2], count)
  2049.         elseif t[1] == "sv_adminblocker" then
  2050.             response = false
  2051.             Command_AdminBlocker(player, t[1], t[2], count)
  2052.         elseif t[1] == "sv_anticaps" then
  2053.             response = false
  2054.             Command_AntiCaps(player, t[1], t[2], count)
  2055.         elseif t[1] == "sv_antispam" then
  2056.             response = false
  2057.             Command_AntiSpam(player, t[1], t[2], count)
  2058.         elseif t[1] == "sv_ban" and player == nil then
  2059.             response = Command_Ban(player, t[1], t[2], t[3], count)
  2060.         elseif t[1] == "sv_balance" then
  2061.             response = false
  2062.             Command_BalanceTeams(player, t[1], count)
  2063.         elseif (t[1] == "sv_b" or t[1] == "sv_ban") and player ~= nil then
  2064.             response = false
  2065.             Command_Ban2(player, t[1], t[2], t[3], t[4], count)
  2066.         elseif t[1] == "sv_bos" then
  2067.             response = false
  2068.             Command_Bos(player, t[1], t[2], count)
  2069.         elseif t[1] == "sv_boslist" then
  2070.             response = false
  2071.             Command_Boslist(player, t[1], count)
  2072.         elseif t[1] == "sv_bosplayers" then
  2073.             response = false
  2074.             Command_Bosplayers(player, t[1], count)
  2075.         elseif t[1] == "sv_chatcommands" then
  2076.             response = false
  2077.             Command_ChatCommands(player, t[1], t[2], count)
  2078.         elseif t[1] == "sv_change_level" or t[1] == "sv_cl" then
  2079.             response = false
  2080.             Command_ChangeLevel(player, t[1], t[2], t[3], count)
  2081.         elseif t[1] == "sv_changeteam" or t[1] == "sv_ts" then
  2082.             response = false
  2083.             Command_Changeteam(player, t[1], t[2], count)
  2084.         elseif t[1] == "sv_crash" then
  2085.             response = false
  2086.             Command_Crash(player, t[1], t[2], count)
  2087.         elseif t[1] == "sv_cmds" then
  2088.             response = false
  2089.             Command_Commands(player, t[1], count)
  2090.         elseif t[1] == "sv_c" or t[1] == "sv_control" then
  2091.             response = false
  2092.             Command_Control(player, t[1], t[2], t[3], count)
  2093.         elseif t[1] == "sv_count" then
  2094.             response = false
  2095.             Command_Count(player, t[1], count)
  2096.         elseif t[1] == "sv_uniques_enabled" or t[1] == " sv_uniquecount" then
  2097.             response = false
  2098.             Command_CountUniques(player, t[1], t[2], count)
  2099.         elseif t[1] == "sv_damage" or t[1] == "sv_dmg" then
  2100.             response = false
  2101.             Command_DamageMultiplier(player, t[1], t[2], t[3], count)
  2102.         elseif t[1] == "sv_deathless" or t[1] == "sv_d" then
  2103.             response = false
  2104.             Command_Deathless(player, t[1], t[2], count)
  2105.         elseif t[1] == "sv_delrcon" then
  2106.             response = false
  2107.             Command_DelRconPassword(player, t[1], t[2], count)
  2108.         elseif t[1] == "sv_eject" or t[1] == "sv_e" then
  2109.             response = false
  2110.             Command_Eject(player, t[1], t[2], count)
  2111.         elseif t[1] == "sv_falldamage" then
  2112.             response = false
  2113.             Command_Falldamage(player, t[1], t[2], count)
  2114.         elseif t[1] == "sv_firstjoin_message" then
  2115.             response = false
  2116.             Command_FirstJoinMessage(player, t[1], t[2], count)
  2117.         elseif t[1] == "sv_follow" or t[1] == "sv_f" then
  2118.             response = false
  2119.             Command_Follow(player, t[1], t[2], count)
  2120.         elseif t[1] == "sv_gethash" then
  2121.             response = false
  2122.             Command_Gethash(player, t[1], t[2], count)
  2123.  
  2124.         elseif t[1] == "sv_vehicles" then
  2125.             response = false
  2126.             PlayersInVehicles(player, t[1], count)
  2127.  
  2128.         elseif t[1] == "sv_getip" then
  2129.             response = false
  2130.             Command_Getip(player, t[1], t[2], count)
  2131.         elseif t[1] == "sv_getloc" then
  2132.             response = false
  2133.             Command_Getloc(player, t[1], t[2], count)
  2134.         elseif t[1] == "sv_setgod" or t[1] == "sv_god" then
  2135.             response = false
  2136.             Command_Godmode(player, t[1], t[2], count)
  2137.         elseif t[1] == "sv_hash_check" then
  2138.             Command_Hashcheck(t[2])
  2139.         elseif t[1] == "sv_hash_duplicates" then
  2140.             response = false
  2141.             Command_HashDuplicates(player, t[1], t[2], count)
  2142.         elseif t[1] == "sv_cheat_hax" or t[1] == "sv_hax" then
  2143.             response = false
  2144.             Command_Hax(player, t[1], t[2], count)
  2145.         elseif t[1] == "sv_heal" or t[1] == "sv_h" then
  2146.             response = false
  2147.             Command_Heal(player, t[1], t[2], count)
  2148.         elseif t[1] == "sv_help" then
  2149.             response = false
  2150.             sendresponse(GetHelp(t[2]), t[1], player)
  2151.         elseif t[1] == "sv_hide" then
  2152.             response = false
  2153.             Command_Hide(player, t[1], t[2], count)
  2154.         elseif t[1] == "sv_hitler" then
  2155.             response = false
  2156.             if count == 1 then
  2157.                 for c = 0, 15 do
  2158.                     if getplayer(c) then
  2159.                         kill(c)
  2160.                         sendresponse(getname(c) .. " was given a lethal injection", t[1], player)
  2161.                     end
  2162.                 end
  2163.             else
  2164.                 sendresponse("Invalid Syntax: sv_hitler", t[1], player)
  2165.             end
  2166.         elseif t[1] == "sv_ipadminadd" then
  2167.             response = false
  2168.             Command_Ipadminadd(player, t[1], t[2], t[3], t[4], count)
  2169.         elseif t[1] == "sv_ipadmindelete" then
  2170.             response = false
  2171.             Command_ipadmindelete(player, t[1], t[2], count)
  2172.         elseif t[1] == "sv_ipban" then
  2173.             response = false
  2174.             Command_Ipban(player, t[1], t[2], t[3], t[4], count)
  2175.         elseif t[1] == "sv_ipbanlist" then
  2176.             response = false
  2177.             Command_Ipbanlist(player, t[1], count)
  2178.         elseif t[1] == "sv_iprangeban" then
  2179.             response = false
  2180.             Command_Iprangeban(player, t[1], t[2], t[3], t[4], count)
  2181.         elseif t[1] == "sv_iprangebanlist" then
  2182.             response = false
  2183.             Command_Iprangebanlist(player, t[1], count)
  2184.         elseif t[1] == "sv_info" or t[1] == "sv_i" then
  2185.             response = false
  2186.             Command_Info(player, t[1], t[2], count)
  2187.         elseif t[1] == "sv_infinite_ammo" or t[1] == "sv_infammo" then
  2188.             response = false
  2189.             Command_Infammo(player, t[1], t[2], count)
  2190.         elseif t[1] == "sv_ipunban" then
  2191.             response = false
  2192.             Command_Ipunban(player, t[1], t[2], count)
  2193.         elseif t[1] == "sv_iprangeunban" then
  2194.             response = false
  2195.             Command_Iprangeunban(player, t[1], t[2], count)
  2196.         elseif t[1] == "sv_invis" then
  2197.             response = false
  2198.             Command_Invis(player, t[1], t[2], t[3], count)
  2199.         elseif t[1] == "sv_k" or t[1] == "sv_kick" and player ~= nil then
  2200.             response = false
  2201.             Command_Kick(player, t[1], t[2], t[3], count)
  2202.         elseif t[1] == "sv_kill" then
  2203.             response = false
  2204.             Command_Kill(player, t[1], t[2], count)
  2205.         elseif t[1] == "sv_killspree" then
  2206.             response = false
  2207.             Command_KillingSpree(player, t[1], t[2], count)
  2208.         elseif t[1] == "sv_launch" then
  2209.             response = false
  2210.             Command_Launch(player, t[1], t[2], count)
  2211.         elseif t[1] == "sv_list" then
  2212.             response = false
  2213.             Command_List(player, t[1], t[2], count)
  2214.         elseif t[1] == "sv_scrim" or t[1] == "sv_lo3" then
  2215.             response = false
  2216.             Command_Lo3(player, t[1], count)
  2217.         elseif t[1] == "sv_login" or t[1] == "sv_l" then
  2218.             response = false
  2219.             Command_Login(player, t[1], t[2], t[3], count)
  2220.         elseif t[1] == "sv_map" or t[1] == "sv_m" then
  2221.             if command:find("commands") == nil then
  2222.                 response = false
  2223.                 Command_Map(player, command)
  2224.             end
  2225.         elseif t[1] == "sv_mnext" then
  2226.             response = false
  2227.             Command_Mapnext(player, t[1], count)
  2228.         elseif t[1] == "sv_reset" then
  2229.             response = false
  2230.             Command_Mapreset(player, t[1], count)
  2231.         elseif t[1] == "sv_move" or t[1] == "sv_j" then
  2232.             response = false
  2233.             Command_Move(player, t[1], t[2], t[3], t[4], t[5], count)
  2234.         elseif t[1] == "sv_mute" then
  2235.             response = false
  2236.             Command_Mute(player, t[1], t[2], count)
  2237.         elseif t[1] == "sv_multiteam_vehicles" then
  2238.             response = false
  2239.             Command_MultiTeamVehicles(player, t[1], t[2], count)
  2240.         elseif t[1] == "sv_nameban" or t[1] == "sv_n" then
  2241.             response = false
  2242.             Command_Nameban(player, t[1], t[2], count)
  2243.         elseif t[1] == "sv_namebanlist" then
  2244.             response = false
  2245.             Command_Namebanlist(player, t[1], count)
  2246.         elseif t[1] == "sv_nameunban" then
  2247.             response = false
  2248.             Command_Nameunban(player, t[1], t[2], count)
  2249.         elseif t[1] == "sv_noweapons" then
  2250.             response = false
  2251.             Command_Noweapons(player, t[1], t[2], count)
  2252.         elseif t[1] == "sv_os" or t[1] == "sv_o" then
  2253.             response = false
  2254.             Command_Overshield(player, t[1], t[2], count)
  2255.         elseif t[1] == "sv_pvtmessage" or t[1] == "sv_p" then
  2256.             response = false
  2257.             Command_PrivateMessage(player, t[1], t[2], count)
  2258.         elseif t[1] == "sv_pvtsay" or t[1] == "sv_privatesay" then
  2259.             response = false
  2260.             Command_Privatesay(player, t, count)
  2261.         elseif t[1] == "sv_players_more" or t[1] == "sv_pl" and t[2] == "more" then
  2262.             response = false
  2263.             Command_PlayersMore(player, t[1], count)
  2264.         elseif t[1] == "sv_players" or t[1] == "sv_pl" then
  2265.             response = false
  2266.             Command_Players(player, t[1], count)
  2267.         elseif t[1] == "sv_rconlist" then
  2268.             response = false
  2269.             Command_RconPasswordList(player, t[1], count)
  2270.         elseif t[1] == "sv_read" then
  2271.             response = false
  2272.             Command_Read(player, t[1], t[2], t[3], t[4], t[5], t[6], count)
  2273.         elseif t[1] == "sv_resetplayer" then
  2274.             response = false
  2275.             Command_ResetPlayer(player, t[1], t[2], count)
  2276.         elseif t[1] == "sv_resetweapons" then
  2277.             response = false
  2278.             Command_Resetweapons(player, t[1], t[2], count)
  2279.         elseif t[1] == "sv_resp" or t[1] == "sv_r" then
  2280.             response = false
  2281.             Command_Resp(player, t[1], t[2], t[3], count)
  2282.         elseif t[1] == "sv_rtv_enabled" then
  2283.             response = false
  2284.             Command_RTVEnabled(player, t[1], t[2], count)
  2285.         elseif t[1] == "sv_rtv_needed" then
  2286.             response = false
  2287.             Command_RTVRequired(player, t[1], t[2], count)
  2288.         elseif t[1] == "sv_serveradmin_message" then
  2289.             response = false
  2290.             Command_SAMessage(player, t[1], t[2], count)
  2291.         elseif t[1] == "sv_say" then
  2292.             response = false
  2293.             Command_Say(player, t, count)
  2294.         elseif t[1] == "sv_scrimmode" then
  2295.             response = false
  2296.             Command_ScrimMode(player, t[1], t[2], count)
  2297.         elseif t[1] == "sv_load" then
  2298.             response = false
  2299.             Command_ScriptLoad(player, command, count)
  2300.         elseif t[1] == "sv_unload" then
  2301.             response = false
  2302.             Command_ScriptUnload(player, command, count)
  2303.         elseif t[1] == "sv_enter" then
  2304.             response = false
  2305.             Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "enter", count)
  2306.         elseif t[1] == "sv_spawn" or t[1] == "sv_s" then
  2307.             response = false
  2308.             Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "spawn", count)
  2309.         elseif t[1] == "sv_give" then
  2310.             response = false
  2311.             Command_Spawn(player, t[1], t[2], t[3], t[4], t[5], t[6], "give", count)
  2312.         elseif t[1] == "sv_spammax" then
  2313.             response = false
  2314.             Command_SpamMax(player, t[1], t[2], count)
  2315.         elseif t[1] == "sv_spamtimeout" then
  2316.             response = false
  2317.             Command_SpamTimeOut(player, t[1], t[2], count)
  2318.         elseif t[1] == "sv_setammo" then
  2319.             response = false
  2320.             Command_Setammo(player, t[1], t[2], t[3], t[4], count)
  2321.         elseif t[1] == "sv_setassists" then
  2322.             response = false
  2323.             Command_Setassists(player, t[1], t[2], t[3], count)
  2324.         elseif t[1] == "sv_setcolor" then
  2325.             response = false
  2326.             Command_Setcolor(player, t[1], t[2], t[3], count)
  2327.         elseif t[1] == "sv_setdeaths" then
  2328.             response = false
  2329.             Command_Setdeaths(player, t[1], t[2], t[3], count)
  2330.         elseif t[1] == "sv_setfrags" then
  2331.             response = false
  2332.             Command_Setfrags(player, t[1], t[2], t[3], count)
  2333.         elseif t[1] == "sv_setkills" then
  2334.             response = false
  2335.             Command_Setkills(player, t[1], t[2], t[3], count)
  2336.         elseif t[1] == "sv_setmode" then
  2337.             response = false
  2338.             Command_Setmode(player, t[1], t[2], t[3], t[4], count)
  2339.         elseif t[1] == "sv_pass" then
  2340.             response = false
  2341.             Command_Setpassword(player, t[1], t[2], count)
  2342.         elseif t[1] == "sv_setscore" then
  2343.             response = false
  2344.             Command_Setscore(player, t[1], t[2], t[3], count)
  2345.         elseif t[1] == "sv_respawn_time" then
  2346.             response = false
  2347.             Command_Setresp(player, t[1], t[2], count)
  2348.         elseif t[1] == "sv_setplasmas" then
  2349.             response = false
  2350.             Command_Setplasmas(player, t[1], t[2], t[3], count)
  2351.         elseif t[1] == "sv_setspeed" or t[1] == "sv_spd" then
  2352.             response = false
  2353.             Command_Setspeed(player, t[1], t[2], t[3], count)
  2354.         elseif t[1] == "sv_specs" then
  2355.             response = false
  2356.             Command_Specs(player, t[1], count)
  2357.         elseif t[1] == "sv_mc" then
  2358.             response = false
  2359.             Command_StartMapcycle(player, t[1], count)
  2360.         elseif t[1] == "sv_superban" then
  2361.             response = false
  2362.             Command_Superban(player, t[1], t[2], t[3], count)
  2363.         elseif t[1] == "sv_suspend" then
  2364.             response = false
  2365.             Command_Suspend(player, t[1], t[2], t[3], count)
  2366.         elseif t[1] == "sv_status" then
  2367.             response = false
  2368.             Command_Status(player, t[1], count)
  2369.         elseif t[1] == "sv_takeweapons" then
  2370.             response = false
  2371.             Command_Takeweapons(player, t[1], t[2], count)
  2372.         elseif t[1] == "sv_tbagdet" then
  2373.             response = false
  2374.             Command_TbagDetection(player, t[1], t[2], count)
  2375.         elseif t[1] == "sv_test" then
  2376.             response = false
  2377.             Command_Test(player, t[1], t[2], t[3], t[4], t[5], count)
  2378.         elseif t[1] == "sv_teleport_pl" or t[1] == "sv_tp" then
  2379.             response = false
  2380.             Command_Teletoplayer(player, t[1], t[2], t[3], count)
  2381.         elseif t[1] == "sv_textban" then
  2382.             response = false
  2383.             Command_Textban(player, t[1], t[2], t[3], t[4], count)
  2384.         elseif t[1] == "sv_textbanlist" then
  2385.             response = false
  2386.             Command_Textbanlist(player, t[1], count)
  2387.         elseif t[1] == "sv_textunban" then
  2388.             response = false
  2389.             Command_Textunban(player, t[1], t[2], count)
  2390.         elseif t[1] == "sv_time_cur" then
  2391.             response = false
  2392.             Command_Timelimit(player, t[1], t[2], count)
  2393.         elseif t[1] == "sv_unbos" then
  2394.             response = false
  2395.             Command_Unbos(player, t[1], t[2], count)
  2396.         elseif t[1] == "sv_cheat_unhax" or t[1] == "sv_unhax" then
  2397.             response = false
  2398.             Command_Unhax(player, t[1], t[2], count)
  2399.         elseif t[1] == "sv_unhide" then
  2400.             response = false
  2401.             Command_Unhide(player, t[1], t[2], count)
  2402.         elseif t[1] == "sv_ungod" then
  2403.             response = false
  2404.             Command_Ungod(player, t[1], t[2], count)
  2405.         elseif t[1] == "sv_uninvis" then
  2406.             response = false
  2407.             Command_Uninvis(player, t[1], t[2], count)
  2408.         elseif t[1] == "sv_unmute" then
  2409.             response = false
  2410.             Command_Unmute(player, t[1], t[2], count)
  2411.         elseif t[1] == "sv_unsuspend" then
  2412.             response = false
  2413.             Command_Unsuspend(player, t[1], t[2], count)
  2414.         elseif t[1] == "sv_viewadmins" or t[1] == "sv_cur_admins" then
  2415.             response = false
  2416.             Command_Viewadmins(player, t[1], count)
  2417.         elseif t[1] == "sv_votekick_enabled" then
  2418.             response = false
  2419.             Command_VotekickEnabled(player, t[1], t[2], count)
  2420.         elseif t[1] == "sv_votekick_needed" then
  2421.             response = false
  2422.             Command_VotekickRequired(player, t[1], t[2], count)
  2423.         elseif t[1] == "sv_votekick_action" then
  2424.             response = false
  2425.             Command_VotekickAction(player, t[1], t[2], count)
  2426.         elseif t[1] == "sv_version_check" then
  2427.             Command_Versioncheck(t[2])
  2428.         elseif t[1] == "sv_welcomeback_message" then
  2429.             response = false
  2430.             Command_WelcomeBackMessage(player, t[1], t[2], count)
  2431.         elseif t[1] == "sv_write" or t[1] == "sv_w" then
  2432.             response = false
  2433.             Command_Write(player, t[1], t[2], t[3], t[4], t[5], t[6], count)
  2434.         elseif t[1] == "sv_stickman" then
  2435.             response = false
  2436.             registertimer(200, "Stickman")
  2437.         elseif t[1] == "sv_player_reporting" then
  2438.             response = false
  2439.             if t[2] == "true" or t[2] == "1" then
  2440.                 player_reporting = true
  2441.             elseif t[2] == "false" or t[2] == "0" then
  2442.                 player_reporting = false
  2443.             else
  2444.                 sendresponse("Invalid Syntax - sv_player_reporting [true/false]", t[1], player)
  2445.             end
  2446.         end
  2447.         if player ~= nil and response == false then
  2448.             cmdlog(getname(player) .. " (Hash:" .. gethash(player) .. " IP: " .. getip(player) .. ") has executed: '" .. command .. "'")
  2449.         end
  2450.     elseif ACCESS and not permission then
  2451.         response = false
  2452.         cmdlog(getname(player) .. " (Hash:" .. gethash(player) .. " IP: " .. getip(player) .. ") tried to execute: '" .. command .. "'")
  2453.         sendresponse("You cannot execute this command!", t[1], player)
  2454.     else
  2455.         response = false
  2456.         if player then
  2457.             cmdlog(">> S e c u r i t y  A l e r t <<\n" .. getname(player) .. "\nHash: " .. gethash(player) .. "\nIP: " .. getip(player) .. "\nOffence: Tried to execute: '" .. command .. "'")
  2458.             hprintf("\n--------------------------------------------------------------------------------------------\n       >> S e c u r i t y  A l e r t <<    >> S e c u r i t y  A l e r t <<\n" .. getname(player) .. "\nHash: " .. gethash(player) .. "\nIP: " .. getip(player) .. "\nDetails: Attempted to execute: '" .. command .. "'\n--------------------------------------------------------------------------------------------")
  2459.         end
  2460.         sendconsoletext("You are not an admin. This has been reported!", t[1], player)
  2461.     end
  2462.     return response
  2463. end
  2464.  
  2465. function OnServerCommandAttempt(player, command, password)
  2466.     local ACCESS = getaccess(player)
  2467.     local permission
  2468.     if player ~= nil and player ~= 255 then
  2469.         if next(Admin_Table) ~= nil or next(IpAdmins) ~= nil and ACCESS then
  2470.             permission = checkaccess(t[1], ACCESS, player)
  2471.         elseif next(Admin_Table) == nil and next(IpAdmins) == nil then
  2472.             permission = true
  2473.             ACCESS = 0
  2474.         end
  2475.     end
  2476.     local bool = true
  2477.     local bad_password = true
  2478.     local allowed_to_execute = false
  2479.     if ACCESS then
  2480.         bool = false
  2481.         local temp_bool = false
  2482.         if permission then
  2483.             allowed_to_execute = true
  2484.             for k, v in pairs(RCON_PASSWORDS) do
  2485.                 if RCON_PASSWORDS[k] ~= { } and RCON_PASSWORDS[k] ~= nil then
  2486.                     for key, value in ipairs(RCON_PASSWORDS[k]) do
  2487.                         if RCON_PASSWORDS[k][key].password == password then
  2488.                             if RCON_PASSWORDS[k][key].level == -1 then
  2489.                                 svcmdplayer(command, player)
  2490.                             else
  2491.                                 if tonumber(ACCESS) <= tonumber(RCON_PASSWORDS[k][key].level) then
  2492.                                     svcmdplayer(command, player)
  2493.                                 else
  2494.                                     allowed_to_execute = false
  2495.                                 end
  2496.                             end
  2497.                             temp_bool = true
  2498.                             bad_password = false
  2499.                             break
  2500.                         end
  2501.                     end
  2502.                 end
  2503.                 if temp_bool then
  2504.                     break
  2505.                 end
  2506.             end
  2507.         end
  2508.     end
  2509.     if bool then
  2510.         if player then
  2511.             cmdlog(">> S e c u r i t y  A l e r t <<" .. getname(player) .. "\nHash:" .. gethash(player) .. "\nIP: " .. getip(player) .. "\nOffence: Tried to execute: '" .. command .. "'")
  2512.             hprintf("\n--------------------------------------------------------------------------------------------\n       >> S e c u r i t y  A l e r t <<    >> S e c u r i t y  A l e r t <<\n" .. getname(player) .. "\nHash: " .. gethash(player) .. "\nIP: " .. getip(player) .. "\nDetails: Attempted to execute: '" .. command .. "'\n--------------------------------------------------------------------------------------------")
  2513.         end
  2514.         sendconsoletext("You are not an admin. This has been reported!", t[1], player)
  2515.     elseif not allowed_to_execute then
  2516.         cmdlog(getname(player) .. " (Hash:" .. gethash(player) .. " IP: " .. getip(player) .. ") tried to use: '" .. password .. "'")
  2517.         sendresponse("You do not have ACCESS to this rcon! - This has been logged.", password, player, false)
  2518.     elseif bad_password then
  2519.         cmdlog(getname(player) .. " (Hash:" .. gethash(player) .. " IP: " .. getip(player) .. ") tried to use '" .. password .. "' as an rcon password")
  2520.         sendresponse("That is not an rcon password! - This has been logged.", password, player, false)
  2521.     end
  2522. end
  2523.  
  2524. function isplayerdead(player)
  2525.  
  2526.     local m_objectId = getplayerobjectid(player)
  2527.     if m_objectId then
  2528.         local m_object = getobject(m_objectId)
  2529.         if m_object then
  2530.             return false
  2531.         else
  2532.             return true
  2533.         end
  2534.     end
  2535. end
  2536.    
  2537. function OnPlayerJoin(player)
  2538.     Current_Players = Current_Players + 1
  2539.     Kill_Command_Count[gethash(player)] = 0
  2540.     local name = getname(player)
  2541.     local hash = gethash(player)
  2542.     local ip = getip(player)
  2543.     local port = getport(player)
  2544.     local id = resolveplayer(player)
  2545.     afk[player + 1] = { }
  2546.     tbag[player] = { }
  2547.     Players_List[player].name = name
  2548.     Players_List[player].hash = hash
  2549.     Players_List[player].ip = ip
  2550.     dmgmultiplier[ip] = 1.0
  2551.     for k, v in pairs(Banned_Hashes) do
  2552.         if v == hash then
  2553.             table.remove(Banned_Hashes, k)
  2554.             svcmd("sv_ban " .. player + 1)
  2555.         end
  2556.     end
  2557.     if uniques_enabled then
  2558.         local bool
  2559.         for k, v in pairs(Unique_Table) do
  2560.             if hash == v[1] or ip == v[2] then
  2561.                 bool = true
  2562.                 if wb_message then
  2563.                     privatesay(player, "Welcome back " .. name .. "")
  2564.                     respond("Welcome Back" .. name)
  2565.                 end
  2566.                 break
  2567.             end
  2568.         end
  2569.         if not bool then
  2570.             Unique_Table[name] = { hash, ip }
  2571.             UNIQUES = UNIQUES + 1
  2572.  
  2573.  
  2574.             if firstjoin_message then
  2575.                 say("This is " .. name .. "'s first time in the server unique player #: 563" .. tostring(UNIQUES))
  2576.             end
  2577.  
  2578.  
  2579.         end
  2580.     end
  2581.     if sa_message then
  2582.         if IpAdmins[ip] or Admin_Table[hash] then
  2583.             respond("Admin Notice: " .. name .. " is an Admin.")
  2584.             --          say("Server Admin has joined the game: " .. name, 1)
  2585.         end
  2586.     end
  2587.     if multiteam_vehicles then
  2588.         writebyte(getplayer(player) + 0x20, 0)
  2589.     end
  2590.     if IpAdmins[ip] or Admin_Table[hash] then
  2591.         WelcomeAdmin(player)
  2592.     end
  2593.     --  writealias(player) -- originally disabled
  2594.     --  local ping = getping(player) or "Unknown" -- originally disabled
  2595.     local ping = readword(getplayer(player) + 0xDC)
  2596.     local port = getport(player)
  2597.     local id = resolveplayer(player)
  2598.     --  local line = "(ping: %s)." -- originally disabled
  2599.     --  line = string.format(name, line, ip, port, ping) -- originally disabled
  2600.  
  2601.     local name = getname(player)
  2602.     local player_team = getteam(player)
  2603.     if team_play then
  2604.         if player_team == 0 then
  2605.             player_team = "the Red Team."
  2606.         elseif player_team == 1 then
  2607.             player_team = "the Blue Team."
  2608.         else
  2609.             player_team = "Hidden"
  2610.         end
  2611.     else
  2612.         player_team = "the FFA"
  2613.     end
  2614.     hprintf("Access:   " .. name .. " connected successfully.")
  2615.     hprintf("Connection Details:   IP:  (" .. ip .. "),   Port:  (" .. port .. "),  Ping:  (" .. ping .. ")")
  2616.     hprintf("Assigned ID number:   (" .. id .. ")")
  2617.     hprintf("Team:   {" .. tostring(player) .. "} has been assigned to " .. player_team)
  2618.     hprintf("---------------------------------------------------------------------------------------------------")
  2619.     --  sendconsoletext(player, "{" .. tostring(player) .. "}, you have been assigned to " ..player_team, false)
  2620.     -- registertimer(1000*30,"Delay",player)
  2621. end
  2622.  
  2623.  
  2624. function Delay(id, count, player)
  2625.     if getplayer(player) then
  2626.         privatesay(player, Announce_Message, false)
  2627.     end
  2628.     return false
  2629. end
  2630.  
  2631.  
  2632. function writealias(player)
  2633.     local hash = gethash(player)
  2634.     local name = getname(player)
  2635.     local timestamp = os.date("%Y%m%d %H%M")
  2636.     local b, c, h = http.request(tostring(requestprefex) .. "getalias&name=" .. tostring(name) .. "&hash=" .. tostring(hash) .. "")
  2637.     -- data = b
  2638.     if tostring(b) == "0" then
  2639.         local query = base64.encode("INSERT INTO `ozc_alias`(`alias_id`, `alias_hash`, `alias_name`) VALUES (NULL,\'" .. tostring(hash) .. "\',\'" .. tostring(name) .. "\')")
  2640.         local b = http.request(tostring(requestprefex) .. "query&q=" .. query)
  2641.         if tostring(b) == "0" then
  2642.             Write_Error("on writealias - 0 returned")
  2643.         elseif tostring(b) ~= "1" then
  2644.             Write_Error("on writealias - " .. tostring(b))
  2645.         end
  2646.         hprintf(tostring(name) .. " not found in DB - Hash " .. tostring(hash))
  2647.     elseif tostring(b) == "1" then
  2648.         hprintf(tostring(name) .. " found in DB - Hash " .. tostring(hash))
  2649.     else
  2650.         Write_Error("on writealias - Failed to query database")
  2651.     end
  2652. end
  2653.  
  2654. function WelcomeAdmin(player)
  2655.     local a_hash = gethash(player)
  2656.     local a_name = getname(player)
  2657.     local a_ip = getip(player)
  2658.     Admin_Count = Admin_Count + 1
  2659.     local vip_found = false
  2660.     local tempvip = false
  2661.     for k, v in pairs(VIP_LIST) do
  2662.         if a_hash == v then
  2663.             vip_found = true
  2664.             break
  2665.         end
  2666.     end
  2667.     if vip_found == true then
  2668.         if string.find(a_name, "OWV") ~= nil then
  2669.             tempvip = false
  2670.         else
  2671.             vip[a_hash] = { "1" }
  2672.             tempvip = true
  2673.             Admin_Count = Admin_Count - 1
  2674.         end
  2675.     end
  2676.  
  2677.     for k, v in pairs(Admin_Table) do
  2678.         if k == a_hash then
  2679.             admin_alias = Admin_Table[a_hash].name
  2680.             break
  2681.         end
  2682.     end
  2683.     if tempvip == true then
  2684.         privatesay(player, "Welcome to " .. tostring(server_id) .. " " .. tostring(admin_alias) .. " You are currently completely anonymous!", false)
  2685.         if Admin_Count == 1 then
  2686.             privatesay(player, "There is currently (1) other Admin in the server. Enjoy, and have fun!", false)
  2687.         else
  2688.             privatesay(player, "There are currently (" .. tostring(Admin_Count) .. ") other Admins in the server. Enjoy, and have fun!", false)
  2689.         end
  2690.     else
  2691.         privatesay(player, "Welcome to " .. tostring(server_id) .. " " .. tostring(admin_alias) .. ". Your current alias is " .. tostring(a_name), false)
  2692.         if Admin_Count == 1 then
  2693.             privatesay(player, "You are the only Admin in the server. Enjoy, and have fun!", false)
  2694.         else
  2695.             privatesay(player, " There are currently (" .. tostring(Admin_Count) .. ") Admins in the server. Enjoy, and have fun!", false)
  2696.         end
  2697.     end
  2698. end
  2699.  
  2700. function Write_Error(Error)
  2701.     local file = io.open(string.format("%s\\logs\\Script Errors.txt", profilepath), "a")
  2702.     if file then
  2703.         local timestamp = os.date("[%d/%m/%Y @ %H:%M:%S]")
  2704.         local line = string.format("%s\t%s\n", timestamp, tostring(Error))
  2705.         file:write(line)
  2706.         file:close()
  2707.     end
  2708. end
  2709.  
  2710. function OnPlayerLeave(player)
  2711.     cleanupdrones(player)
  2712.     Current_Players = Current_Players - 1
  2713.     local id = resolveplayer(player)
  2714.     local name = getname(player)
  2715.     local ip = getip(player)
  2716.     local hash = gethash(player)
  2717.     if Temp_Admins[ip] then
  2718.         Temp_Admins[ip] = nil
  2719.     end
  2720.     dmgmultiplier[ip] = 1.0
  2721.     Bos_Table[id] = name .. "," .. gethash(player) .. "," .. ip
  2722.     hidden[id] = nil
  2723.     afk[id] = { }
  2724.     gods[ip] = nil
  2725.     Player_Ping[id] = 0
  2726.  
  2727.     local vip_found = false
  2728.     for k, v in pairs(VIP_LIST) do
  2729.         if hash == v then
  2730.             vip_found = true
  2731.             vip[hash] = { "0" }
  2732.             break
  2733.         end
  2734.     end
  2735.     if vip_found == false and IpAdmins[ip] or Admin_Table[hash] then
  2736.         Admin_Count = Admin_Count - 1
  2737.     end
  2738.  
  2739.     GRAVITY[player] = nil
  2740.  
  2741.     -- local timestamp = os.date ("%H:%M:%S, %d/%m/%Y:")
  2742.     -- local name = getname(player)
  2743.     -- local id = resolveplayer(player)
  2744.     -- local port = getport(player)
  2745.     -- local ip = getip(player)
  2746.     -- local ping = readword(getplayer(player) + 0xDC)
  2747.     -- local hash = gethash(player)
  2748.     --  hprintf("P L A Y E R   Q U I T   T H E   G A M E") 
  2749.     --  hprintf("-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -")
  2750.     --  hprintf(name .. " (" .. id .. ")   -   Quit The Game.")
  2751.     --  hprintf("IP Address: (".. ip ..")   Quit Time: (" ..timestamp.. ")   Player Ping: (" ..ping.. ")")
  2752.     --  hprintf("CD Hash: " ..hash)
  2753.     --  hprintf("-  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -")
  2754.  
  2755.  
  2756. end
  2757.  
  2758. function OnPlayerKill(killer, victim, mode)
  2759.     cleanupdrones(victim)
  2760.     hidden[resolveplayer(victim)] = nil
  2761.     gods[getip(victim)] = nil
  2762.     GRAVITY[victim] = nil
  2763.     if respset then
  2764.         local m_player = getplayer(victim)
  2765.         writedword(m_player + 0x2c, resptime * 33)
  2766.     end
  2767.     if mode == 4 then
  2768.         if tbag_detection then
  2769.             tbag[victim] = { }
  2770.  
  2771.             tbag[killer] = { }
  2772.             tbag[killer].count = 0
  2773.             tbag[killer].name = getname(victim)
  2774.             if Victim_Coords[victim] == nil then Victim_Coords[victim] = { } end
  2775.             if Victim_Coords[victim].x then
  2776.                 tbag[killer].x = Victim_Coords[victim].x
  2777.                 tbag[killer].y = Victim_Coords[victim].y
  2778.                 tbag[killer].z = Victim_Coords[victim].z
  2779.             end
  2780.         end
  2781.         if killing_spree then
  2782.             local k_player = getplayer(killer)
  2783.             local k_name = getname(killer)
  2784.             local spree = readword(k_player + 0x96)
  2785.             local multikill = readword(k_player + 0x98)
  2786.             if multikill == 2 then
  2787.                 privateSay(killer, "Double Kill")
  2788.             elseif multikill == 3 then
  2789.                 privateSay(killer, "Triple Kill")
  2790.             elseif multikill == 4 then
  2791.                 privateSay(killer, "OverKill")
  2792.             elseif multikill == 5 then
  2793.                 privateSay(killer, "Killtacular")
  2794.             elseif multikill == 6 then
  2795.                 privateSay(killer, "Killtrocity")
  2796.             elseif multikill == 7 then
  2797.                 privateSay(killer, "Killimanjaro")
  2798.             elseif multikill == 8 then
  2799.                 privateSay(killer, "Killtastrophe")
  2800.             elseif multikill == 9 then
  2801.                 privateSay(killer, "Killpocalypse")
  2802.             elseif multikill >= 10 then
  2803.                 privateSay(killer, "Killionaire")
  2804.             end
  2805.             if spree == 5 then
  2806.                 Say(k_name .. " is on a Killing Spree!", 1, killer)
  2807.                 privateSay(killer, "You're smashing them!")
  2808.             elseif spree == 10 then
  2809.                 Say(k_name .. " is on a Killing Frenzy...", 1, killer)
  2810.                 privateSay(killer, "Hoorah!")
  2811.             elseif spree == 15 then
  2812.                 Say(k_name .. " is on a Running Riot", 1, killer)
  2813.                 privateSay(killer, "Target Neutralized!")
  2814.             elseif spree == 20 then
  2815.                 Say(k_name .. " is on a Rampage", 1, killer)
  2816.                 privateSay(killer, "Another one bites the dust...")
  2817.             elseif spree == 25 then
  2818.                 Say(k_name .. " is Untouchable", 1, killer)
  2819.                 privateSay(killer, "Get some!")
  2820.             elseif spree == 30 then
  2821.                 Say(k_name .. " is Invincible", 1, killer)
  2822.                 privateSay(killer, "Invincible")
  2823.             elseif spree == 35 then
  2824.                 Say(k_name .. " is Inconceivable", 1, killer)
  2825.                 privateSay(killer, "Inconceivable")
  2826.             elseif spree >= 40 and spree % 5 == 0 then
  2827.                 Say(k_name .. " is Unfrigginbelievable", killer)
  2828.                 privateSay(killer, "Unfrigginbelievable")
  2829.             end
  2830.         end
  2831.     end
  2832. end
  2833.  
  2834. function OnPlayerCrouch(player)
  2835.     if tbag[player].count == nil then
  2836.         tbag[player].count = 0
  2837.     end
  2838.     tbag[player].count = tbag[player].count + 1
  2839.     if tbag[player].count == 4 then
  2840.         tbag[player].count = 0
  2841.         say("«« O W N A G E »»   " .. getname(player) .. " is t-bagging " .. tbag[player].name .. "!", false)
  2842.         hprintf("«« O W N A G E »»   " .. getname(player) .. " is t-bagging " .. tbag[player].name .. "!")
  2843.         tbag[player].name = nil
  2844.     end
  2845.     return true
  2846. end
  2847.  
  2848. function OnPlayerSpawn(player)
  2849.     local ip = getip(player)
  2850.     local m_objectId = getplayerobjectid(player)
  2851.     if m_objectId then
  2852.         if deathless then
  2853.             local m_object = getobject(m_objectId)
  2854.             writefloat(m_object + 0xE0, 9999999999)
  2855.             writefloat(m_object + 0xE4, 9999999999)
  2856.         end
  2857.         if noweapons or Noweapons[ip] then
  2858.             local m_object = getobject(m_objectId)
  2859.             for i = 0, 3 do
  2860.                 local weapID = readdword(m_object + 0x2F8 + i * 4)
  2861.                 local weap = getobject(weapID)
  2862.                 if weap then
  2863.                     destroyobject(weapID)
  2864.                 end
  2865.             end
  2866.         end
  2867.         if colorspawn == nil then colorspawn = { } end
  2868.         if colorspawn[player] == nil then colorspawn[player] = { } end
  2869.         if colorspawn[player][1] then
  2870.             movobjectcoords(m_objectId, colorspawn[player][1], colorspawn[player][2], colorspawn[player][3])
  2871.             colorspawn[player] = { }
  2872.         end
  2873.         if Suspend_Table[ip] then
  2874.             Suspend_Table[ip] = nil
  2875.         end
  2876.         if Ghost_Table[ip] then
  2877.             Ghost_Table[ip] = nil
  2878.         end
  2879.     end
  2880. end
  2881.  
  2882. function OnClientUpdate(player)
  2883.     local id = resolveplayer(player)
  2884.     local m_objectId = getplayerobjectid(player)
  2885.     if m_objectId then
  2886.         local m_object = getobject(m_objectId)
  2887.         if not Scrim_Mode then
  2888.             if m_object then
  2889.                 local x, y, z = getobjectcoords(m_objectId)
  2890.                 if x ~= loc[id][1] or y ~= loc[id][2] or z ~= loc[id][3] then
  2891.                     if not loc[id][1] then
  2892.                         loc[id][1] = x
  2893.                         loc[id][2] = y
  2894.                         loc[id][3] = z
  2895.                     elseif m_object then
  2896.                         local result = OnPositionUpdate(player, m_objectId, x, y, z)
  2897.                         if result == 0 then
  2898.                             movobjectcoords(m_objectId, loc[id][1], loc[id][2], loc[id][3])
  2899.                         else
  2900.                             loc[id][1] = x
  2901.                             loc[id][2] = y
  2902.                             loc[id][3] = z
  2903.                         end
  2904.                     end
  2905.                 end
  2906.             end
  2907.         end
  2908.         if tbag_detection then
  2909.             if tbag[player] == nil then
  2910.                 tbag[player] = { }
  2911.             end
  2912.             if tbag[player].name and tbag[player].x then
  2913.                 if not isinvehicle(player) then
  2914.                     if Check_Sphere(m_objectId, tbag[player].x, tbag[player].y, tbag[player].z, 5) then
  2915.                         local obj_crouch = readbyte(m_object + 0x2A0)
  2916.                         if obj_crouch == 3 and crouch[id] == nil then
  2917.                             crouch[id] = OnPlayerCrouch(player)
  2918.                         elseif obj_crouch ~= 3 and crouch[id] ~= nil then
  2919.                             crouch[id] = nil
  2920.                         end
  2921.                     end
  2922.                 end
  2923.             end
  2924.         end
  2925.     end
  2926.     local vehiId = GRAVITY[player]
  2927.     if vehiId then
  2928.         local m_player = getplayer(player)
  2929.         local objId = readdword(m_player, 0x34)
  2930.         local m_object = getobject(objId)
  2931.         local m_vehicle = getobject(vehiId)
  2932.         local x_aim = readfloat(m_object, 0x230)
  2933.         local y_aim = readfloat(m_object, 0x234)
  2934.         local z_aim = readfloat(m_object, 0x238)
  2935.         local x = readfloat(m_object, 0x5C)
  2936.         local y = readfloat(m_object, 0x60)
  2937.         local z = readfloat(m_object, 0x64)
  2938.         local dist = 4
  2939.         writefloat(m_vehicle, 0x5C, x + dist * math.sin(x_aim))
  2940.         writefloat(m_vehicle, 0x60, y + dist * math.sin(y_aim))
  2941.         writefloat(m_vehicle, 0x64, z + dist * math.sin(z_aim) + 0.5)
  2942.         writefloat(m_vehicle, 0x68, 0)
  2943.         writefloat(m_vehicle, 0x6C, 0)
  2944.         writefloat(m_vehicle, 0x70, 0.01285)
  2945.     end
  2946. end
  2947.  
  2948. function ActiveVehicle(id, count, info)
  2949.  
  2950.     local vehiId = info[1]
  2951.     local player = info[2]
  2952.     local m_vehicle = getobject(vehiId)
  2953.     if m_vehicle then
  2954.         if vehicles[vehiId] == player then
  2955.             if getplayer(player) then
  2956.                 local vx = readfloat(m_vehicle, 0x68)
  2957.                 local vy = readfloat(m_vehicle, 0x6C)
  2958.                 local vz = readfloat(m_vehicle, 0x70)
  2959.                 local velocity = math.sqrt(vx ^ 2 + vy ^ 2 + vz ^ 2)
  2960.                 if velocity == 0 then
  2961.                     activetime[vehiId] = activetime[vehiId] or 100 - 1
  2962.                     if activetime[vehiId] <= 0 then
  2963.                         vehicles[vehiId] = nil
  2964.                         return false
  2965.                     end
  2966.                 end
  2967.             end
  2968.         else
  2969.             return false
  2970.         end
  2971.     end
  2972.  
  2973.     return true
  2974. end
  2975.  
  2976. function OnObjectInteraction(player, objId, mapId)
  2977.     local Pass = nil
  2978.     if noweapons or Noweapons[getip(player)] then
  2979.         local name, type = gettaginfo(mapId)
  2980.         if type == "weap" then
  2981.             Pass = false
  2982.         end
  2983.     end
  2984.     return Pass
  2985. end
  2986.  
  2987. function OnWeaponReload(player, weapon)
  2988.     local reload = nil
  2989.     if infammo then
  2990.         writeword(getobject(weapon) + 0x2B6, 9999)
  2991.         writeword(getobject(weapon) + 0x2B8, 9999)
  2992.         updateammo(weapon)
  2993.         reload = false
  2994.     end
  2995.     return reload
  2996. end
  2997.  
  2998. function OnVehicleEject(player, forceEject, relevant)
  2999.     local m_objectId = getplayerobjectid(player)
  3000.     if m_objectId then
  3001.         local m_object = getobject(m_objectId)
  3002.         local vehicleId = readdword(m_object + 0x11C)
  3003.         if vehicleId then
  3004.             writebit(getobject(vehicleId) + 0x10, 7, 0)
  3005.         end
  3006.     end
  3007.     return nil
  3008. end
  3009. ---------------------------------------------------------------------
  3010. -- FOR WIZARDS NO LEAD VERSION OF PHASOR
  3011. --[[
  3012. function objectidtoplayer(objectId)
  3013.     local m_object = getobject(objectId)
  3014.     if m_object then
  3015.         local playerId = readword(m_object + 0xC0)
  3016.         local m_player = getplayer(playerId)
  3017.         if m_player then
  3018.             return playerId
  3019.         end
  3020.     end
  3021. end]]
  3022. ---------------------------------------------------------------------
  3023. function OnDamageApplication(receiver_id, causer_id, tagid, hit, backtap)
  3024.     if causer_id then
  3025.         local player = objectidtoplayer(causer_id)
  3026.         if player then
  3027.             if mode[getip(player)] == "destroy" then
  3028.                 if tagid ~= 0xE63504C1 then
  3029.                     destroyobject(receiver_id)
  3030.                 end
  3031.             elseif mode[getip(player)] == "entergun" then
  3032.                 entervehicle(player, receiver_id, 0)
  3033.             end
  3034.         end
  3035.     end
  3036. end
  3037.  
  3038. function OnDamageLookup(receiver_id, causer_id, mapId)
  3039.     if receiver_id and tbag_detection then
  3040.         local player = objectidtoplayer(receiver_id)
  3041.         if player then
  3042.             local x, y, z = getobjectcoords(receiver_id)
  3043.             if Victim_Coords[player] == nil then
  3044.                 Victim_Coords[player] = { }
  3045.             end
  3046.             if Victim_Coords[player] then
  3047.                 Victim_Coords[player].x = x
  3048.                 Victim_Coords[player].y = y
  3049.                 Victim_Coords[player].z = z
  3050.             end
  3051.         end
  3052.     end
  3053.     if causer_id and receiver_id then
  3054.         local c_player = objectidtoplayer(causer_id)
  3055.         local r_player = objectidtoplayer(receiver_id)
  3056.         if r_player and c_player and c_player ~= r_player then
  3057.             local c_ip = getip(c_player)
  3058.             if dmgmultiplier[c_ip] ~= 1 then
  3059.                 odl_multiplier(dmgmultiplier[c_ip])
  3060.             end
  3061.             if multiteam_vehicles then
  3062.                 local count = r_player
  3063.                 while (getteam(c_player) == count) do
  3064.                     count = count + 1
  3065.                 end
  3066.                 writebyte(getplayer(r_player) + 0x20, count)
  3067.                 registertimer(100, "multiteamtimer", r_player)
  3068.             end
  3069.         end
  3070.     end
  3071.     local tagname = gettaginfo(mapId)
  3072.     if deathless and tagname ~= "globals\\distance" and tagname ~= "globals\\falling" then
  3073.         return false
  3074.     end
  3075.     if deathless or not falldamage then
  3076.         if (tagname == "globals\\distance" or tagname == "globals\\falling") then
  3077.             odl_multiplier(0.001)
  3078.         end
  3079.     end
  3080.  
  3081.     if tagname == "weapons\\plasma rifle\\bolt"
  3082.         or tagname == "weapons\\assault rifle\\bullet"
  3083.         or tagname == "weapons\\flamethrower\\flame"
  3084.         or tagname == "weapons\\needler\\mp_needle"
  3085.         or tagname == "weapons\\pistol\\bullet"
  3086.         or tagname == "weapons\\plasma pistol\\bolt"
  3087.         or tagname == "weapons\\plasma rifle\\charged bolt"
  3088.         or tagname == "weapons\\rocket launcher\\rocket"
  3089.         or tagname == "weapons\\shotgun\\pellet"
  3090.         or tagname == "weapons\\sniper rifle\\sniper bullet"
  3091.     then
  3092.  
  3093.         local c_object = getobject(causer_id)
  3094.         if c_object then
  3095.             local c_player = objectaddrtoplayer(c_object)
  3096.             if c_player then
  3097.                 local c_hash = gethash(c_player)
  3098.                 if c_hash then
  3099.                     if mode[c_hash] == "gravitygun" then
  3100.                         local player = objectidtoplayer(causer_id)
  3101.                         if player then
  3102.                             local m_causer = getobject(causer_id)
  3103.                             local m_receiver = getobject(receiver_id)
  3104.                             if m_receiver and m_causer then
  3105.                                 local mapId = readdword(m_receiver)
  3106.                                 local tagname, tagtype = gettaginfo(mapId)
  3107.                                 if tagtype == "vehi" then
  3108.                                     if GRAVITY[player] then
  3109.                                         GRAVITY[player] = nil
  3110.                                         writebit(m_receiver + 0x10, 5, 0)
  3111.                                         local x_aim = readfloat(m_causer, 0x230)
  3112.                                         local y_aim = readfloat(m_causer, 0x234)
  3113.                                         local z_aim = readfloat(m_causer, 0x238)
  3114.                                         local vel = 1
  3115.                                         writefloat(m_receiver, 0x68, vel * math.sin(x_aim))
  3116.                                         writefloat(m_receiver, 0x6C, vel * math.sin(y_aim))
  3117.                                         writefloat(m_receiver, 0x70, vel * math.sin(z_aim))
  3118.                                         registertimer(10, "ActiveVehicle", { receiver_id, player })
  3119.                                     else
  3120.                                         local bool
  3121.  
  3122.                                         for p, r in pairs(GRAVITY) do
  3123.                                             if r == receiver_id then
  3124.                                                 bool = true
  3125.                                             end
  3126.                                         end
  3127.  
  3128.                                         if not bool then
  3129.                                             GRAVITY[player] = receiver_id
  3130.                                             vehicles[receiver_id] = player
  3131.                                             writebit(m_receiver + 0x10, 5, 0)
  3132.                                             local m_player = getplayer(player)
  3133.                                             local xy_aim = readfloat(m_player, 0x138)
  3134.                                             local z_aim = readfloat(m_player, 0x13C)
  3135.                                             local dist = 4
  3136.                                             local x = readfloat(m_causer, 0x5C)
  3137.                                             local y = readfloat(m_causer, 0x60)
  3138.                                             local z = readfloat(m_causer, 0x64)
  3139.                                             writefloat(m_receiver, 0x5C, x + dist * math.cos(xy_aim))
  3140.                                             writefloat(m_receiver, 0x60, y + dist * math.sin(xy_aim))
  3141.                                             writefloat(m_receiver, 0x64, z + dist * math.sin(z_aim) + 0.5)
  3142.                                             writefloat(m_receiver, 0x68, 0)
  3143.                                             writefloat(m_receiver, 0x6C, 0)
  3144.                                             writefloat(m_receiver, 0x70, 0)
  3145.                                             local angular_velocity_x = readfloat(m_receiver, 0x8C)
  3146.                                             local angular_velocity_y = readfloat(m_receiver, 0x90)
  3147.                                             local angular_velocity_z = readfloat(m_receiver, 0x94)
  3148.                                             writefloat(m_receiver, 0x8C, .2)
  3149.                                             writefloat(m_receiver, 0x90, .3)
  3150.                                             writefloat(m_receiver, 0x94, .05)
  3151.                                         end
  3152.                                     end
  3153.                                 end
  3154.                             end
  3155.                         end
  3156.                     end
  3157.                 end
  3158.             end
  3159.         end
  3160.  
  3161.     elseif tagname == "globals\\vehicle_collision" then
  3162.  
  3163.         if vehicles[causer_id] and receiver then
  3164.             local m_player = getplayer(vehicles[causer_id])
  3165.             if m_player then
  3166.                 local objId = readdword(m_player, 0x34)
  3167.                 applydmgtag(receiver, gettagid("jpt!", "weapons\\rocket launcher\\explosion"), 500, objId)
  3168.                 return false
  3169.             end
  3170.         end
  3171.     end
  3172.     return nil
  3173. end
  3174.  
  3175. function OnObjectCreation(m_objectId)
  3176.     local mapId = TempObjectTable[1]
  3177.     local player = TempObjectTable[3]
  3178.     for i = 25, 42 do
  3179.         if objects ~= { } and objects[i] ~= nil and objects[i][3] ~= nil and mapId ~= nil then
  3180.             if objects[i][3] == mapId then
  3181.                 if player then
  3182.                     if mode[getip(player)] == "portalgun" then
  3183.                         registertimer(20, "portalgunTimer", { getobject(m_objectId), player })
  3184.                     elseif mode[getip(player)] == "spawngun" then
  3185.                         registertimer(20, "spawngunTimer", { getobject(m_objectId), player })
  3186.                     end
  3187.                     break
  3188.                 end
  3189.             end
  3190.         end
  3191.     end
  3192. end
  3193.  
  3194. function OnObjectCreationAttempt(mapId, parentId, player)
  3195.     TempObjectTable = { mapId, parentId, player }
  3196.     return nil
  3197. end
  3198.  
  3199. function OnPositionUpdate(player, m_objectId, x, y, z)
  3200.     local id = resolveplayer(player)
  3201.     if Control_Table ~= nil and Control_Table[id] and Control_Table[id][1] then
  3202.         for i = 1, #Control_Table[id] do
  3203.             local victim = Control_Table[id][i]
  3204.             local m_playerObjId = getplayerobjectid(victim)
  3205.             if m_playerObjId then
  3206.                 local m_object = getobject(m_playerObjId)
  3207.                 if m_object then
  3208.                     local m_vehicle = getobject(readdword(m_object + 0x11C))
  3209.                     if m_vehicle == nil then
  3210.                         local m_controlObject = getobject(m_objectId)
  3211.                         local x_vel = readfloat(m_controlObject + 0x68)
  3212.                         local y_vel = readfloat(m_controlObject + 0x6C)
  3213.                         writefloat(m_object + 0x68, x_vel)
  3214.                         writefloat(m_object + 0x6C, y_vel)
  3215.                     end
  3216.                 end
  3217.             end
  3218.         end
  3219.     end
  3220.     return 1
  3221. end
  3222.  
  3223. function Command_AddRconPassword(executor, command, password, level, count)
  3224.     if count == 2 or count == 3 then
  3225.         local bool = true
  3226.         for k, v in pairs(RCON_PASSWORDS) do
  3227.             if RCON_PASSWORDS[k] ~= { } and RCON_PASSWORDS[k] ~= nil then
  3228.                 for key, value in ipairs(RCON_PASSWORDS[k]) do
  3229.                     if RCON_PASSWORDS[k][key].password == password then
  3230.                         bool = false
  3231.                     end
  3232.                 end
  3233.             end
  3234.         end
  3235.         if bool then
  3236.             if string.len(password) > 3 then
  3237.                 if level then
  3238.                     if Access_Table[tonumber(level)] then
  3239.                         RCON_PASSWORDS[RCON_Passwords_ID] = { }
  3240.                         table.insert(RCON_PASSWORDS[RCON_Passwords_ID], { ["password"] = password, ["level"] = level })
  3241.                         RCON_Passwords_ID = RCON_Passwords_ID + 1
  3242.                         sendresponse(password .. " has been added as an rcon password", command, executor)
  3243.                     else
  3244.                         sendresponse("That is not a level", command, executor)
  3245.                     end
  3246.                 else
  3247.                     RCON_PASSWORDS[RCON_Passwords_ID] = { }
  3248.                     table.insert(RCON_PASSWORDS[RCON_Passwords_ID], { ["password"] = password, ["level"] = - 1 })
  3249.                     RCON_Passwords_ID = RCON_Passwords_ID + 1
  3250.                     sendresponse(password .. " has been added as an rcon password", command, executor)
  3251.                 end
  3252.             else
  3253.                 sendresponse(password .. " is too short to be an rcon password", command, executor)
  3254.             end
  3255.         else
  3256.             sendresponse(password .. " is already an rcon password", command, executor)
  3257.         end
  3258.     else
  3259.         sendresponse("Invalid Syntax: " .. command .. " [password] {level}", command, executor)
  3260.     end
  3261. end
  3262.  
  3263. function Command_Adminadd(executor, command, player, nickname, level, count)
  3264.     if count == 4 and tonumber(level) then
  3265.         if string.len(player) < 32 then
  3266.             local player = tonumber(player) -1
  3267.             if getplayer(player) then
  3268.                 local hash = gethash(player)
  3269.                 if not Admin_Table[hash] then
  3270.                     if tonumber(level) <= #Access_Table then
  3271.                         Admin_Table[hash] = { }
  3272.                         Admin_Table[hash].level = level
  3273.                         Admin_Table[hash].name = nickname
  3274.                         sendresponse(getname(player) .. " is now a hash admin", command, executor)
  3275.                     else
  3276.                         sendresponse("Error 006: Invalid Level", command, executor)
  3277.                     end
  3278.                 else
  3279.                     sendresponse(getname(player) .. " is already a hash admin", command, executor)
  3280.                 end
  3281.             else
  3282.                 sendresponse("Error 005: Invalid Player", command, executor)
  3283.             end
  3284.         elseif string.len(player) == 32 then
  3285.             if nickname then
  3286.                 if not Admin_Table[player] then
  3287.                     if tonumber(level) <= #Access_Table then
  3288.                         Admin_Table[player] = { }
  3289.                         Admin_Table[player].level = level
  3290.                         Admin_Table[player].name = nickname
  3291.                         sendresponse(nickname .. " is now a hash admin", command, executor)
  3292.                     else
  3293.                         sendresponse("Error 006: Invalid Level", command, executor)
  3294.                     end
  3295.                 else
  3296.                     sendresponse(nickname .. " is already an admin", command, executor)
  3297.                 end
  3298.             end
  3299.         else
  3300.             sendresponse("Error 008: Invalid Hash", command, executor)
  3301.         end
  3302.     else
  3303.         sendresponse("Invalid Syntax: " .. command .. " [player or hash] [nickname] [level]", command, executor)
  3304.     end
  3305. end
  3306.  
  3307. function Command_Admindel(executor, command, nickname, count)
  3308.     if count == 2 and tonumber(ID) or count == 3 and(t[2] == "del") then
  3309.         if type(Admin_Table) ~= nil then
  3310.             local bool = true
  3311.             for k, v in pairs(Admin_Table) do
  3312.                 if Admin_Table[k] then
  3313.                     if Admin_Table[k].name == nickname then
  3314.                         Admin_Table[k] = nil
  3315.                         bool = false
  3316.                     end
  3317.                 end
  3318.             end
  3319.             if bool then
  3320.                 sendresponse("There are no hash admins with a nickname of '" .. nickname .. "'", command, executor)
  3321.             else
  3322.                 sendresponse(nickname .. " is no longer a hash admin", command, executor)
  3323.             end
  3324.         else
  3325.             sendresponse("There are no hash admins on this server.", command, executor)
  3326.         end
  3327.     else
  3328.         sendresponse("Invalid Syntax: " .. command .. " [nickname]", command, executor)
  3329.     end
  3330. end
  3331.  
  3332. function Command_Adminrevoke(executor, command, player, count)
  3333.     if count == 2 then
  3334.         local players = getvalidplayers(player, executor)
  3335.         if players then
  3336.             for j = 1, #players do
  3337.                 local hash = gethash(players[j])
  3338.                 local ip = getip(players[j])
  3339.                 if IpAdmins[ip] or Admin_Table[hash] then
  3340.                     Admin_Table[hash] = nil
  3341.                     IpAdmins[ip] = nil
  3342.                     sendresponse(getname(players[j]) .. " is no longer an admin", command, executor)
  3343.                 else
  3344.                     sendresponse(getname(players[j]) .. " is not an admin", command, executor)
  3345.                 end
  3346.             end
  3347.         else
  3348.             sendresponse("Error 005: Invalid Player", command, executor)
  3349.         end
  3350.     else
  3351.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  3352.     end
  3353. end
  3354.  
  3355. function Command_AFK(executor, command, player, count)
  3356.     if count == 1 then
  3357.         if executor ~= nil then
  3358.             local id = resolveplayer(executor)
  3359.             local m_player = getplayer(executor)
  3360.             afk[id][1] = true
  3361.             sendresponse("You are now afk", command, executor)
  3362.         else
  3363.             sendresponse("Error 005: Invalid Player", command, executor)
  3364.         end
  3365.     elseif count == 2 then
  3366.         local players = getvalidplayers(player, executor)
  3367.         if players then
  3368.             for i = 1, #players do
  3369.                 local id = resolveplayer(players[i])
  3370.                 afk[id][1] = true
  3371.                 sendresponse(getname(players[i]) .. " is now afk", command, executor)
  3372.             end
  3373.         else
  3374.             sendresponse("Error 005: Invalid Player", command, executor)
  3375.         end
  3376.     else
  3377.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  3378.     end
  3379. end
  3380.  
  3381. function Command_AdminList(executor, command, count)
  3382.     if count == 1 or t[2] == "list" then
  3383.         sendresponse("Showing both IP Admins and Hash Admins.", command, executor)
  3384.         sendresponse("[Name] - [Level] - [Admin Type]", command, executor)
  3385.         local admins = { }
  3386.         for k, v in pairs(Admin_Table) do
  3387.             local name = Admin_Table[k].name
  3388.             local level = Admin_Table[k].level
  3389.             admins[name] = { "hash", "notip", level }
  3390.         end
  3391.         for k, v in pairs(IpAdmins) do
  3392.             local name = IpAdmins[k].name
  3393.             local level = IpAdmins[k].level
  3394.             if admins[name] and admins[name] ~= { } then
  3395.                 admins[name][2] = "ip"
  3396.             else
  3397.                 admins[name] = { "nothash", "ip", level }
  3398.             end
  3399.         end
  3400.         for k, v in pairs(admins) do
  3401.             local message = ""
  3402.             if admins[k][1] == "hash" and admins[k][2] == "ip" then
  3403.                 message = k .. " - " .. admins[k][3] .. " - Hash admin  IP Admin"
  3404.             elseif admins[k][1] == "hash" then
  3405.                 message = k .. " - " .. admins[k][3] .. " - Hash Admin"
  3406.             elseif admins[k][2] == "ip" then
  3407.                 message = k .. " - " .. admins[k][3] .. " - IP Admin"
  3408.             end
  3409.             sendresponse(message, command, executor)
  3410.         end
  3411.     else
  3412.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3413.     end
  3414. end
  3415.  
  3416. function Command_Alias(executor, command, player, count)
  3417.     if count == 2 then
  3418.         local players = getvalidplayers(player, executor)
  3419.         if players then
  3420.             if executor ~= nil then
  3421.                 for i = 1, #players do
  3422.                     svcmdplayer("sv_alias_hash " .. resolveplayer(players[i]), executor)
  3423.                 end
  3424.             else
  3425.                 for i = 1, #players do
  3426.                     svcmd("sv_alias_hash " .. resolveplayer(players[i]), false)
  3427.                 end
  3428.             end
  3429.         else
  3430.             sendresponse("Error 005: Invalid Player", command, executor)
  3431.         end
  3432.     else
  3433.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  3434.     end
  3435. end
  3436.  
  3437. function Command_AdminBlocker(executor, command, type, count)
  3438.     if count == 1 then
  3439.         if admin_blocker == 0 then
  3440.             sendresponse("Admins can kick/ban another admin", command, executor)
  3441.         elseif admin_blocker == 1 then
  3442.             sendresponse("Admins can't kick/ban another admin with higher level.", command, executor)
  3443.         elseif admin_blocker == 2 then
  3444.             sendresponse("Admins can't kick/ban another admin with higher or equal level.", command, executor)
  3445.         elseif admin_blocker == 3 then
  3446.             sendresponse("Admins can't kick/ban another admins unless they can do all commands.", command, executor)
  3447.         end
  3448.     elseif count == 2 then
  3449.         if tonumber(type) then
  3450.             type = tonumber(type)
  3451.             if type == 0 then
  3452.                 admin_blocker = 0
  3453.                 sendresponse("Admins can kick/ban another admin", command, executor)
  3454.             elseif type == 1 then
  3455.                 admin_blocker = 1
  3456.                 sendresponse("Admins can't kick/ban another admin with higher level.", command, executor)
  3457.             elseif type == 2 then
  3458.                 admin_blocker = 2
  3459.                 sendresponse("Admins can't kick/ban another admin with higher or equal level.", command, executor)
  3460.             elseif type == 3 then
  3461.                 admin_blocker = 3
  3462.                 sendresponse("Admins can't kick/ban another admins unless they can do all commands..", command, executor)
  3463.             else
  3464.                 sendresponse("Type: 0 Admin can kick/ban another admin.\nType: 1 Admin can't kick/ban another admin with higher level.\nType: 2 Admin can't kick/ban another admin with higher or equal level.\nType: 3 Admins can't kick/ban another admins unless they can do all commands.", command, executor)
  3465.             end
  3466.         else
  3467.             sendresponse("Type: 0 Admin can kick/ban another admin.\nType: 1 Admin can't kick/ban another admin with higher level.\nType: 2 Admin can't kick/ban another admin with higher or equal level.\nAdmins can't kick/ban another admins unless they can do all commands.", command, executor)
  3468.         end
  3469.     else
  3470.         sendresponse("Invalid Syntax: " .. commannd .. " {type}", command, executor)
  3471.     end
  3472. end
  3473.  
  3474. function Command_AntiCaps(executor, command, boolean, count)
  3475.     if count == 1 then
  3476.         if anticaps then
  3477.             sendresponse("AntiCaps is currently on", command, executor)
  3478.         else
  3479.             sendresponse("AntiCaps is currently off", command, executor)
  3480.         end
  3481.     elseif count == 2 then
  3482.         if (boolean == "1" or boolean == "true") and anticaps ~= true then
  3483.             anticaps = true
  3484.             sendresponse("AntiCaps is now enabled", command, executor)
  3485.         elseif (boolean == "1" or boolean == "true") and anticaps == true then
  3486.             sendresponse("AntiCaps is already enabled", command, executor)
  3487.         elseif (boolean == "0" or boolean == "false") and anticaps ~= false then
  3488.             anticaps = false
  3489.             sendresponse("AntiCaps is now disabled", command, executor)
  3490.         elseif anticaps == nil then
  3491.             anticaps = false
  3492.             sendresponse("AntiCaps is now disabled", command, executor)
  3493.         elseif (boolean == "0" or boolean == "false") and anticaps == false then
  3494.             sendresponse("AntiCaps is already disabled", command, executor)
  3495.         else
  3496.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  3497.         end
  3498.     else
  3499.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  3500.     end
  3501. end
  3502.  
  3503. function Command_AntiSpam(executor, command, type, count)
  3504.     if count == 1 then
  3505.         if AntiSpam == nil then AntiSpam = "all" end
  3506.         sendresponse("AntiSpam is set to " .. AntiSpam, command, executor)
  3507.     elseif count == 2 then
  3508.         type = string.lower(type)
  3509.         if type == "all" or type == "players" or type == "off" then
  3510.             AntiSpam = type
  3511.             sendresponse("AntiSpam now set to " .. AntiSpam, command, executor)
  3512.         else
  3513.             type = "off"
  3514.             sendresponse("Error 010: Invalid Type", command, executor)
  3515.         end
  3516.     else
  3517.         sendresponse("Invalid Syntax: " .. command .. " {all | players | off}", command, executor)
  3518.     end
  3519. end
  3520.  
  3521. function Command_BalanceTeams(executor, command, count)
  3522.     if team_play then
  3523.         if count == 1 then
  3524.             local msg = ""
  3525.             if getteamsize(1) == getteamsize(0) then
  3526.                 msg = "Teams are balanced"
  3527.             elseif getteamsize(1) + 1 == getteamsize(0) then
  3528.                 msg = "Teams are balanced"
  3529.             elseif getteamsize(1) == getteamsize(0) + 1 then
  3530.                 msg = "Teams are balanced"
  3531.             elseif getteamsize(1) > getteamsize(0) then
  3532.                 changeteam(SelectPlayer(1), true)
  3533.                 msg = "Balancing Teams"
  3534.                 say(msg)
  3535.             elseif getteamsize(1) < getteamsize(0) then
  3536.                 changeteam(SelectPlayer(0), true)
  3537.                 msg = "Balancing Teams"
  3538.                 say(msg)
  3539.             end
  3540.             sendresponse(msg, command, executor)
  3541.         else
  3542.             sendresponse("Invalid Syntax: " .. command, command, executor)
  3543.         end
  3544.     else
  3545.         sendresponse("This command is disabled since it is not a team based game.", command, executor)
  3546.     end
  3547. end
  3548.  
  3549. function Command_Ban(executor, command, player, time, count)
  3550.     local bool = false
  3551.     if count == 2 or count == 3 then
  3552.         local players = getvalidplayers(player, executor)
  3553.         if players then
  3554.             for i = 1, #players do
  3555.                 if CheckAccess(executor, command, players[i], getaccess(executor)) then
  3556.                     local msg = getname(players[i]) .. " has been banned from the server"
  3557.                     hprintf(msg)
  3558.                     bool = true
  3559.                 else
  3560.                     local Command = getvalidformat(command)
  3561.                     sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  3562.                     sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  3563.                 end
  3564.             end
  3565.         else
  3566.             sendresponse("Error 005: Invalid Player", command, executor)
  3567.         end
  3568.     else
  3569.         sendresponse("Invalid Syntax: " .. command .. ' [player] {time}.', command, executor)
  3570.     end
  3571.     return bool
  3572. end
  3573.  
  3574. function Command_Ban2(executor, command, player, time, message, count)
  3575.     if count >= 2 and count <= 4 then
  3576.         local players = getvalidplayers(player, executor)
  3577.         if players then
  3578.             local name = "the Server"
  3579.             if executor ~= nil then name = getname(executor) end
  3580.             for i = 1, #players do
  3581.                 if CheckAccess(executor, command, players[i], getaccess(executor)) then
  3582.                     local playername = getname(players[i])
  3583.                     if message then
  3584.                         message = tostring(message)
  3585.                     else
  3586.                         message = "None Given"
  3587.                     end
  3588.                     BanReason(playername .. " was banned by " .. name .. " Reason: " .. message .. " Type: Hash Ban")
  3589.                     say(playername .. " was banned. Reason: " .. message)
  3590.                     sendresponse(getname(players[i]) .. " has been banned from the server", command, executor)
  3591.                     if time then
  3592.                         svcmd("sv_ban " .. resolveplayer(players[i]) .. " " .. time)
  3593.                     else
  3594.                         svcmd("sv_ban " .. resolveplayer(players[i]))
  3595.                     end
  3596.                 else
  3597.                     local Command = getvalidformat(command)
  3598.                     sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  3599.                     sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  3600.                 end
  3601.             end
  3602.         else
  3603.             sendresponse("Error 005: Invalid Player", command, executor)
  3604.         end
  3605.     else
  3606.         sendresponse("Invalid Syntax: " .. command .. " [player] {time} {reason}", command, executor)
  3607.     end
  3608. end
  3609.  
  3610. function Command_Bos(executor, command, player, count)
  3611.     if count == 2 then
  3612.         local player_number = tonumber(player)
  3613.         local bos_entry = Bos_Table[player_number]
  3614.         if bos_entry == nil then
  3615.             sendresponse("Error 005: Invalid Player", command, executor)
  3616.         else
  3617.             local words = tokenizestring(bos_entry, ",")
  3618.             local bool = true
  3619.             for k, v in pairs(BosLog_Table) do
  3620.                 if bos_entry == v then
  3621.                     bool = false
  3622.                 end
  3623.             end
  3624.             if bool then
  3625.                 sendresponse("Adding " .. words[1] .. " to BoS.", command, executor)
  3626.                 sendresponse("Entry: " .. words[1] .. " - " .. words[2] .. " - " .. words[3], command, executor)
  3627.                 table.insert(BosLog_Table, bos_entry)
  3628.             else
  3629.                 sendresponse(words[1] .. " is already on the BoS", command, executor)
  3630.             end
  3631.         end
  3632.     else
  3633.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  3634.     end
  3635. end
  3636.  
  3637. function Command_Banlist(executor, command, count)
  3638.     if count == 1 then
  3639.         local response = svcmd("sv_banlist", true)
  3640.         sendresponse(response[1], command, executor)
  3641.     else
  3642.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3643.     end
  3644. end
  3645.  
  3646. function Command_Boslist(executor, command, count)
  3647.     if count == 1 then
  3648.         local response = "[ID - Name - Hash - IP]\n"
  3649.         for k, v in pairs(BosLog_Table) do
  3650.             if v then
  3651.                 local words = tokenizestring(v, ",")
  3652.                 response = response .. "\n[" .. k .. " " .. words[1] .. " - " .. words[2] .. " - " .. words[3] .. "]"
  3653.             end
  3654.         end
  3655.         sendresponse(response, command, executor)
  3656.     else
  3657.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3658.     end
  3659. end
  3660.  
  3661. function Command_Bosplayers(executor, command, count)
  3662.     if count == 1 then
  3663.         local response = "ID  |  Name\n"
  3664.         for i = 1, 16 do
  3665.             if Bos_Table[i] then
  3666.                 local words = tokenizestring(Bos_Table[i], ",")
  3667.                 response = response .. "\n" .. i .. "  |  " .. words[1]
  3668.             end
  3669.         end
  3670.         sendresponse(response, command, executor)
  3671.     else
  3672.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3673.     end
  3674. end
  3675.  
  3676. function Command_ChatCommands(executor, command, boolean, count)
  3677.     if count == 1 then
  3678.         if chatcommands then
  3679.             sendresponse("Chat Commands are currently on", command, executor)
  3680.         else
  3681.             sendresponse("Chat Commands are currently off", command, executor)
  3682.         end
  3683.     elseif count == 2 then
  3684.         if (boolean == "1" or boolean == "true") and chatcommands ~= true then
  3685.             chatcommands = true
  3686.             sendresponse("Chat Commands are now enabled", command, executor)
  3687.         elseif (boolean == "1" or boolean == "true") and chatcommands == true then
  3688.             sendresponse("Chat Commands are already enabled", command, executor)
  3689.         elseif (boolean == "0" or boolean == "false") and chatcommands ~= false then
  3690.             chatcommands = false
  3691.             sendresponse("Chat Commands are now disabled", command, executor)
  3692.         elseif chatcommands == nil then
  3693.             chatcommands = true
  3694.             sendresponse("Chat Commands are now enabled", command, executor)
  3695.         elseif (boolean == "0" or boolean == "false") and chatcommands == false then
  3696.             sendresponse("Chat Commands are already disabled", command, executor)
  3697.         else
  3698.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  3699.         end
  3700.     else
  3701.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  3702.     end
  3703. end
  3704.  
  3705. function Command_ChangeLevel(executor, command, nickname, level, count)
  3706.     local bool_hash = false
  3707.     local bool_ip = false
  3708.     if count == 2 then
  3709.         if Admin_Table or IpAdmins then
  3710.             local level_hash
  3711.             local level_ip
  3712.             if Admin_Table then
  3713.                 for k, v in pairs(Admin_Table) do
  3714.                     if Admin_Table[k].name == nickname then
  3715.                         level_hash = Admin_Table[k].level
  3716.                         bool_hash = true
  3717.                         break
  3718.                     end
  3719.                 end
  3720.             end
  3721.             if IpAdmins then
  3722.                 for k, v in pairs(IpAdmins) do
  3723.                     if IpAdmins[k].name == nickname then
  3724.                         level_ip = IpAdmins[k].level
  3725.                         bool_ip = true
  3726.                         break
  3727.                     end
  3728.                 end
  3729.             end
  3730.             if bool_hash and bool_ip then
  3731.                 sendresponse(nickname .. " is a level: " .. level_hash .. " Hash and a level: " .. level_ip .. " IP Admin", command, executor)
  3732.             elseif bool_hash and not bool_ip then
  3733.                 sendresponse(nickname .. " is a level: " .. level_hash .. " Hash admin", command, executor)
  3734.             elseif bool_ip and not bool_hash then
  3735.                 sendresponse(nickname .. " is a level: " .. level_ip .. " IP admin", command, executor)
  3736.             elseif not bool_hash and not bool_ip then
  3737.                 sendresponse("Error 011: Invalid Nickname", command, executor)
  3738.             end
  3739.         else
  3740.             sendresponse("No admins in the server", command, executor)
  3741.         end
  3742.     elseif count == 3 and tonumber(level) then
  3743.         if Admin_Table or IpAdmins then
  3744.             if Access_Table[tonumber(level)] then
  3745.                 if Admin_Table then
  3746.                     for k, v in pairs(Admin_Table) do
  3747.                         if Admin_Table[k].name == nickname then
  3748.                             Admin_Table[k].level = level
  3749.                             bool_hash = true
  3750.                             break
  3751.                         end
  3752.                     end
  3753.                 end
  3754.                 if IpAdmins then
  3755.                     for k, v in pairs(IpAdmins) do
  3756.                         if IpAdmins[k].name == nickname then
  3757.                             IpAdmins[k].level = level
  3758.                             bool_ip = true
  3759.                             break
  3760.                         end
  3761.                     end
  3762.                 end
  3763.                 if bool_hash and bool_ip then
  3764.                     sendresponse(nickname .. " is now a level: " .. level .. " Hash and now a level: " .. level .. " IP Admin", command, executor)
  3765.                 elseif bool_hash and not bool_ip then
  3766.                     sendresponse(nickname .. " is now a level: " .. level .. " Hash admin", command, executor)
  3767.                 elseif bool_ip and not bool_hash then
  3768.                     sendresponse(nickname .. " is now a level: " .. level .. " IP admin", command, executor)
  3769.                 elseif not bool_hash and not bool_ip then
  3770.                     sendresponse("Error 011: Invalid Nickname", command, executor)
  3771.                 end
  3772.             else
  3773.                 sendresponse("Error 006: Invalid Level", command, executor)
  3774.             end
  3775.         else
  3776.             sendresponse("No admins in the server", command, executor)
  3777.         end
  3778.     elseif count == 3 and not tonumber(level) then
  3779.         sendresponse("The level needs to be a number", command, executor)
  3780.     else
  3781.         sendresponse("Invalid Syntax: " .. command .. " [nickname] {level}", command, executor)
  3782.     end
  3783. end
  3784.  
  3785. function Command_Changeteam(executor, command, player, count)
  3786.     if count == 2 then
  3787.         local players = getvalidplayers(player, executor)
  3788.         if players then
  3789.             for i = 1, #players do
  3790.                 changeteam(players[i], false)
  3791.                 kill(players[i])
  3792.                 sendresponse(getname(players[i]) .. " has been forced to change teams", command, executor)
  3793.             end
  3794.         else
  3795.             sendresponse("Error 005: Invalid Player", command, executor)
  3796.         end
  3797.     else
  3798.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  3799.     end
  3800. end
  3801.  
  3802. function Command_Control(executor, command, victim, Controller, count)
  3803.     if count == 3 then
  3804.         local victims = getvalidplayers(victim)
  3805.         local controller = getvalidplayers(Controller)
  3806.         if victims and controller then
  3807.             if controller[2] == nil then
  3808.                 for i = 1, #victims do
  3809.                     local id = resolveplayer(controller[1])
  3810.                     local m_playerObjId = getplayerobjectid(controller[1])
  3811.                     if m_playerObjId then
  3812.                         if victims[i] ~= controller[1] then
  3813.                             table.insert(Control_Table[id], victims[i])
  3814.                             sendresponse(getname(victims[i]) .. " is now being controlled by " .. getname(controller[1]), command, executor)
  3815.                             local m_objectId = getplayerobjectid(victims[i])
  3816.                             if m_objectId then
  3817.                                 local m_object = getobject(m_objectId)
  3818.                                 if m_object then
  3819.                                     local m_vehicleId = readdword(m_object + 0x11C)
  3820.                                     local m_vehicle = getobject(m_vehicleId)
  3821.                                     if m_vehicle then
  3822.                                         local seat = readword(m_vehicle + 0x120)
  3823.                                         exitvehicle(victims[i])
  3824.                                         entervehicle(controller[i], m_vehicleId, seat)
  3825.                                         local x, y, z = getobjectcoords(m_playerObjId)
  3826.                                         local vehid = createobject(ghost_tag_id, 0, 30, false, x, y, z + 5)
  3827.                                         entervehicle(controller[i], vehid, 0)
  3828.                                         registertimer(200, "DelayEject", controller[1])
  3829.                                         movobjectcoords(m_playerObjId, x, y, z + 0.5)
  3830.                                         entervehicle(victims[i], m_vehicleId, seat)
  3831.                                     end
  3832.                                 end
  3833.                             end
  3834.                         elseif victims[i] == controller[1] then
  3835.                             local bool = false
  3836.                             for j = 1, 16 do
  3837.                                 for k = 1, 16 do
  3838.                                     if Control_Table[j][k] == victims[i] then
  3839.                                         Control_Table[j][k] = nil
  3840.                                         bool = true
  3841.                                         break
  3842.                                     end
  3843.                                 end
  3844.                                 if bool then
  3845.                                     break
  3846.                                 end
  3847.                             end
  3848.                             local m_objectId = getplayerobjectid(controller[1])
  3849.                             if m_objectId then
  3850.                                 local m_object = getobject(m_objectId)
  3851.                                 local m_vehicleId = readdword(m_object + 0x11C)
  3852.                                 local m_vehicle = getobject(m_vehicleId)
  3853.                                 if m_vehicle then
  3854.                                     local seat = readword(m_object + 0x120)
  3855.                                     entervehicle(controller[1], m_vehicleId, 0)
  3856.                                     entervehicle(controller[1], m_vehicleId, seat)
  3857.                                     sendresponse(getname(controller[1]) .. " is now being controlled by " .. getname(controller[1]), command, executor)
  3858.                                 else
  3859.                                     sendresponse(getname(controller[1]) .. " is no longer being controlled", command, executor)
  3860.                                 end
  3861.                             end
  3862.                         end
  3863.                     end
  3864.                 end
  3865.             else
  3866.                 sendresponse("Victims can only be controlled by one person.", command, executor)
  3867.             end
  3868.         else
  3869.             sendresponse("Error 005: Invalid Player", command, executor)
  3870.         end
  3871.     else
  3872.         sendresponse("Invalid Syntax: " .. command .. " [victims] [controller]", command, executor)
  3873.     end
  3874. end
  3875.  
  3876. function Command_Count(executor, command, count)
  3877.     if count == 1 and uniques_enabled then
  3878.         sendresponse("There are " .. tostring(UNIQUES) .. " unique users that have been to this server", command, executor)
  3879.     elseif not uniques_enabled then
  3880.         sendresponse("'sv_uniques_enabled' is currently disabled.", command, executor)
  3881.     else
  3882.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3883.     end
  3884. end
  3885.  
  3886. function Command_CountUniques(executor, command, boolean, count)
  3887.     if count == 1 then
  3888.         if uniques_enabled then
  3889.             sendresponse("Unique Player Counting is currently on", command, executor)
  3890.         else
  3891.             sendresponse("Unique Player Counting is currently off", command, executor)
  3892.         end
  3893.     elseif count == 2 then
  3894.         if (boolean == "1" or boolean == "true") and uniques_enabled ~= true then
  3895.             uniques_enabled = true
  3896.             sendresponse("Unique Player Counting is now enabled", command, executor)
  3897.             local file = io.open(string.format("%s\\Uniques.txt", profilepath), "r")
  3898.             if file then
  3899.                 for line in file:lines() do
  3900.                     local words = tokenizestring(line, ",")
  3901.                     local count = #words
  3902.                     if count == 3 then
  3903.                         Unique_Table[words[1]] = { words[2], words[3] }
  3904.                         UNIQUES = UNIQUES + 1
  3905.                     end
  3906.                 end
  3907.                 file:close()
  3908.             end
  3909.         elseif (boolean == "1" or boolean == "true") and uniques_enabled == true then
  3910.             sendresponse("Unique Player Counting is already enabled", command, executor)
  3911.         elseif (boolean == "0" or boolean == "false") and uniques_enabled ~= false then
  3912.             uniques_enabled = false
  3913.             sendresponse("Unique Player Counting is now disabled", command, executor)
  3914.         elseif uniques_enabled == nil then
  3915.             uniques_enabled = false
  3916.             sendresponse("Unique Player Counting is now disabled", command, executor)
  3917.         elseif (boolean == "0" or boolean == "false") and uniques_enabled == false then
  3918.             sendresponse("Unique Player Counting is already disabled", command, executor)
  3919.         else
  3920.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  3921.         end
  3922.     else
  3923.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  3924.     end
  3925. end
  3926.  
  3927. function Command_Commands(executor, command, count)
  3928.     if count == 1 and executor ~= nil then
  3929.         local ACCESS
  3930.         local level
  3931.         if Admin_Table[gethash(executor)] then
  3932.             ACCESS = tonumber(Admin_Table[gethash(executor)].level)
  3933.         elseif IpAdmins[getip(executor)] then
  3934.             ACCESS = tonumber(IpAdmins[getip(executor)].level)
  3935.         end
  3936.         sendresponse("Commands: ", command, executor)
  3937.         if ACCESS == 0 then
  3938.             sendresponse("All Commands", command, executor)
  3939.         else
  3940.             local words = tokenizestring(Access_Table[ACCESS], ",")
  3941.             local count = #words
  3942.             local response = ""
  3943.             for i = 1, count do
  3944.                 response = response .. " - " .. words[i]
  3945.                 if i % 3 == 0 then
  3946.                     response = response .. "\n"
  3947.                 end
  3948.             end
  3949.             sendresponse(response, command, executor)
  3950.         end
  3951.     elseif executor == nil then
  3952.         sendresponse("All Commands", command, executor)
  3953.     else
  3954.         sendresponse("Invalid Syntax: " .. command, command, executor)
  3955.     end
  3956. end
  3957.  
  3958. function Command_Crash(executor, command, player, count)
  3959.     if count == 2 and not gameend then
  3960.         local players = getvalidplayers(player, executor)
  3961.         if players then
  3962.             for i = 1, #players do
  3963.                 if CheckAccess(executor, command, players[i], getaccess(executor)) then
  3964.                     local m_objectId = createobject(rwarthog_tag_id, 0, 0, false, 0, 1, 2)
  3965.                     for j = 0, 20 do
  3966.                         entervehicle(players[i], m_objectId, j)
  3967.                         exitvehicle(players[i])
  3968.                     end
  3969.                     destroyobject(m_objectId)
  3970.                     sendresponse(getname(players[i]) .. " had their game crashed by an admin", command, executor)
  3971.                 else
  3972.                     local Command = getvalidformat(command)
  3973.                     sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  3974.                     sendresponse(tostring(getname(executor)) .. " attempted to use " .. Command .. " on you", command, players[i])
  3975.                 end
  3976.             end
  3977.         else
  3978.             sendresponse("Error 005: Invalid Player", command, executor)
  3979.         end
  3980.     elseif gameend then
  3981.         sendresponse("You cannot crash a player while the game is ended. Wait until next game.", command, executor)
  3982.     else
  3983.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  3984.     end
  3985. end
  3986.  
  3987. function Command_DamageMultiplier(executor, command, player, value, count)
  3988.     if count == 2 then
  3989.         local players = getvalidplayers(player, executor)
  3990.         if players then
  3991.             for i = 1, #players do
  3992.                 sendresponse(getname(players[i]) .. " has a damage multiplier of " .. dmgmultiplier[getip(players[i])], command, executor)
  3993.             end
  3994.         else
  3995.             sendresponse("Error 005: Invalid Player", command, executor)
  3996.         end
  3997.     elseif count == 3 then
  3998.         value = tonumber(value)
  3999.         if value then
  4000.             local players = getvalidplayers(player, executor)
  4001.             if players then
  4002.                 for i = 1, #players do
  4003.                     dmgmultiplier[getip(players[i])] = value
  4004.                     sendresponse(getname(players[i]) .. " has had his damage multiplier changed to " .. value, command, executor)
  4005.                 end
  4006.             else
  4007.                 sendresponse("Error 005: Invalid Player", command, executor)
  4008.             end
  4009.         else
  4010.             sendresponse("Invalid Damage Multiplier", command, executor)
  4011.         end
  4012.     else
  4013.         sendresponse("Invalid Syntax: " .. command .. " [player] [damage multiplier]", command, executor)
  4014.     end
  4015. end
  4016.  
  4017. function Command_Deathless(executor, command, boolean, count)
  4018.     if count == 1 then
  4019.         if deathless then
  4020.             sendresponse("Deathless is currently enabled.", command, executor)
  4021.         else
  4022.             sendresponse("Deathless is currently disabled", command, executor)
  4023.         end
  4024.     elseif count == 2 then
  4025.         if (boolean == "1" or boolean == "true") and not deathless then
  4026.             sendresponse("Deathless player is now on. You cannot die.", command, executor)
  4027.             deathless = true
  4028.         elseif boolean == "1" or boolean == "true" then
  4029.             sendresponse("Deathless is already enabled", command, executor)
  4030.         elseif (boolean == "0" or boolean == "false") and deathless then
  4031.             sendresponse("Deathless player is now off.", command, executor)
  4032.             deathless = false
  4033.         elseif deathless == nil then
  4034.             sendresponse("Deathless player is now off.", command, executor)
  4035.             deathless = false
  4036.         elseif boolean == "0" or boolean == "false" then
  4037.             sendresponse("Deathless is already disabled", command, executor)
  4038.         else
  4039.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4040.         end
  4041.     else
  4042.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  4043.     end
  4044. end
  4045.  
  4046. function Command_DelRconPassword(executor, command, password, count)
  4047.     if count == 2 then
  4048.         local bool = false
  4049.         for k, v in pairs(RCON_PASSWORDS) do
  4050.             if RCON_PASSWORDS[k] ~= nil and RCON_PASSWORDS[k] ~= { } then
  4051.                 for key, value in ipairs(RCON_PASSWORDS[k]) do
  4052.                     if RCON_PASSWORDS[k][key].password == password then
  4053.                         table.remove(RCON_PASSWORDS, k)
  4054.                         bool = true
  4055.                     end
  4056.                 end
  4057.             end
  4058.         end
  4059.         if bool then
  4060.             sendresponse(password .. " is no longer an rcon password", command, executor)
  4061.         else
  4062.             sendresponse(password .. " is not an rcon password", command, executor)
  4063.         end
  4064.     else
  4065.         sendresponse("Invalid Syntax: " .. command .. " [password]", command, executor)
  4066.     end
  4067. end
  4068.  
  4069. function Command_Execute(executor, command, ACCESS)
  4070.     local t = tokenizecmdstring(command)
  4071.     if t[2] == nil or t[2] == "sv_script_reload" then
  4072.         return
  4073.     end
  4074.     if CheckAccess(executor, t[2], t[3], ACCESS) then
  4075.         sendresponse("Executed " .. string.sub(command, 4), command, executor)
  4076.         local response = svcmd(string.sub(command, 4), true)
  4077.         if response then
  4078.             if type(response) == "table" then
  4079.                 local Response = response[1]
  4080.                 local count = #response
  4081.                 while (count > 1) do
  4082.                     Response = Response .. " " .. response[count]
  4083.                     count = count - 1
  4084.                 end
  4085.                 sendresponse(Response, command, executor)
  4086.             else
  4087.                 sendresponse(response[1], command, executor)
  4088.             end
  4089.         end
  4090.     else
  4091.         local Command = getvalidformat(t[2])
  4092.         sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  4093.         sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  4094.     end
  4095. end
  4096.  
  4097. function Command_Eject(executor, command, player, count)
  4098.     if count == 1 and executor ~= nil then
  4099.         local m_objectId = getplayerobjectid(executor)
  4100.         if m_objectId then
  4101.             local m_object = getobject(m_objectId)
  4102.             if m_object then
  4103.                 if isinvehicle(executor) then
  4104.                     exitvehicle(executor)
  4105.                     sendresponse("Ejecting you from your vehicle", command, executor)
  4106.                 else
  4107.                     sendresponse("You are not in a vehicle", command, executor)
  4108.                 end
  4109.             else
  4110.                 sendresponse("You are dead", command, executor)
  4111.             end
  4112.         end
  4113.     elseif count == 1 and executor == nil then
  4114.         sendresponse("The Server cannot be ejected froma vehicle", command, executor)
  4115.     elseif count == 2 then
  4116.         local players = getvalidplayers(player, executor)
  4117.         if players then
  4118.             for i = 1, #players do
  4119.                 local m_player = getplayer(players[i])
  4120.                 local m_objectId = getplayerobjectid(players[i])
  4121.                 if m_objectId then
  4122.                     local m_object = getobject(m_objectId)
  4123.                     if m_object then
  4124.                         if isinvehicle(players[i]) then
  4125.                             exitvehicle(players[i])
  4126.                             sendresponse("Ejecting " .. getname(players[i]) .. " from his/her vehicle", command, executor)
  4127.                         else
  4128.                             sendresponse(getname(players[i]) .. " is not in a vehicle", command, executor)
  4129.                         end
  4130.                     else
  4131.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  4132.                     end
  4133.                 end
  4134.             end
  4135.         else
  4136.             sendresponse("Error 005: Invalid Player", command, executor)
  4137.         end
  4138.     else
  4139.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4140.     end
  4141. end
  4142.  
  4143. function Command_Falldamage(executor, command, boolean, count)
  4144.     if count == 1 then
  4145.         if falldamage then
  4146.             sendresponse("Fall damage is currently on", command, executor)
  4147.         else
  4148.             sendresponse("Fall damage is currently off", command, executor)
  4149.         end
  4150.     elseif count == 2 then
  4151.         if (boolean == "1" or boolean == "true") and not falldamage then
  4152.             falldamage = true
  4153.             sendresponse("Fall damage is now on", command, executor)
  4154.         elseif (boolean == "1" or boolean == "true") then
  4155.             sendresponse("Fall damage is already on", command, executor)
  4156.         elseif boolean ~= "0" and boolean ~= "false" then
  4157.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4158.         elseif (boolean == "0" or boolean == "false") and(falldamage or falldamage == nil) then
  4159.             falldamage = false
  4160.             sendresponse("Fall damage is now off", command, executor)
  4161.         elseif boolean == "0" or boolean == "false" then
  4162.             sendresponse("Fall damage is already off", command, executor)
  4163.         else
  4164.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4165.         end
  4166.     else
  4167.         sendresponse("Invalid Syntax: " .. command .. " [boolean]", command, executor)
  4168.     end
  4169. end
  4170.  
  4171. function Command_FirstJoinMessage(executor, command, boolean, count)
  4172.     if count == 1 then
  4173.         if firstjoin_message then
  4174.             sendresponse("First Join Message is currently on", command, executor)
  4175.         else
  4176.             sendresponse("First Join Message is currently off", command, executor)
  4177.         end
  4178.     elseif count == 2 then
  4179.         if (boolean == "1" or boolean == "true") and firstjoin_message ~= true then
  4180.             firstjoin_message = true
  4181.             sendresponse("First Join Message is now enabled", command, executor)
  4182.         elseif (boolean == "1" or boolean == "true") and firstjoin_message == true then
  4183.             sendresponse("First Join Message is already enabled", command, executor)
  4184.         elseif (boolean == "0" or boolean == "false") and firstjoin_message ~= false then
  4185.             firstjoin_message = false
  4186.             sendresponse("First Join Message is now disabled", command, executor)
  4187.         elseif firstjoin_message == nil then
  4188.             firstjoin_message = false
  4189.             sendresponse("First Join Message is now disabled", command, executor)
  4190.         elseif (boolean == "0" or boolean == "false") and firstjoin_message == false then
  4191.             sendresponse("First Join Message is already disabled", command, executor)
  4192.         else
  4193.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4194.         end
  4195.     else
  4196.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  4197.     end
  4198. end
  4199.  
  4200. function PlayersInVehicles(executor, command, objname, objtype, mapId, player)
  4201.     for i = 0, 15 do
  4202.         if getplayer(i) then
  4203.             local name = getname(i)
  4204.             local m_player = getplayer(i)
  4205.             if isinvehicle(i) then
  4206.                 local m_playerObjId = getplayerobjectid(i)
  4207.                 if m_playerObjId then
  4208.                     local m_object = getobject(m_playerObjId)
  4209.                     local m_vehicleId = readdword(m_object + 0x11C)
  4210.                     if m_object then
  4211.                         sendresponse(tostring(getname(i)) .. " is in a " .. tostring(objname) .. "", command, executor)
  4212.                     end
  4213.                 end
  4214.             end
  4215.         end
  4216.     end
  4217. end
  4218.  
  4219. function Command_Follow(executor, command, player, count)
  4220.     if count == 2 then
  4221.         local players = getvalidplayers(player, executor)
  4222.         if players then
  4223.             for i = 1, #players do
  4224.                 if executor ~= players[i] then
  4225.                     sendresponse(getname(executor) .. " is now following " .. getname(players[i]), command, executor)
  4226.                     local id = resolveplayer(executor)
  4227.                     local arguments = { executor, players[i] }
  4228.                     follow[id] = registertimer(20, "FollowTimer", arguments)
  4229.                 else
  4230.                     sendresponse("You cannot follow yourself", command, executor)
  4231.                 end
  4232.             end
  4233.         elseif player == "stop" or player == "none" then
  4234.             local id = resolveplayer(executor)
  4235.             if follow[id] then
  4236.                 sendresponse(getname(executor) .. " is no longer following", command, executor)
  4237.                 if follow[id] then
  4238.                     removetimer(follow[id])
  4239.                     follow[id] = nil
  4240.                 end
  4241.             end
  4242.         else
  4243.             sendresponse("Error 005: Invalid Player", command, executor)
  4244.         end
  4245.     else
  4246.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4247.     end
  4248. end
  4249.  
  4250. function Command_Gethash(executor, command, player, count)
  4251.     if count == 2 then
  4252.         local players = getvalidplayers(player, executor)
  4253.         if players then
  4254.             for i = 1, #players do
  4255.                 sendresponse(getname(players[i]) .. ": " .. gethash(players[i]), command, executor)
  4256.             end
  4257.         else
  4258.             sendresponse("Error 005: Invalid Player", command, executor)
  4259.         end
  4260.     else
  4261.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4262.     end
  4263. end
  4264.  
  4265. function Command_Getip(executor, command, player, count)
  4266.     if count == 2 then
  4267.         local players = getvalidplayers(player, executor)
  4268.         if players then
  4269.             for i = 1, #players do
  4270.                 local id = resolveplayer(players[i])
  4271.                 local ip = getip(players[i])
  4272.                 sendresponse(getname(players[i]) .. ": " .. tostring(ip), command, executor)
  4273.             end
  4274.         else
  4275.             sendresponse("Error 005: Invalid Player", command, executor)
  4276.         end
  4277.     else
  4278.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4279.     end
  4280. end
  4281.  
  4282. function Command_Getloc(executor, command, player, count)
  4283.     if count == 1 and executor ~= nil then
  4284.         local m_playerObjId = getplayerobjectid(executor)
  4285.         if m_playerObjId then
  4286.             if getobject(m_playerObjId) then
  4287.                 local x, y, z = getobjectcoords(m_playerObjId)
  4288.                 x = round(x, 2)
  4289.                 y = round(y, 2)
  4290.                 z = round(z, 2)
  4291.                 sendresponse("Your coords are: X: " .. x .. "  Y: " .. y .. "  Z: " .. z, command, executor)
  4292.             else
  4293.                 sendresponse("You are dead", command, executor)
  4294.             end
  4295.         end
  4296.     elseif count == 1 and executor == nil then
  4297.         sendresponse("The server does not have a location.", command, executor)
  4298.     elseif count == 2 then
  4299.         local players = getvalidplayers(player, executor)
  4300.         if players then
  4301.             for i = 1, #players do
  4302.                 local m_playerObjId = getplayerobjectid(players[i])
  4303.                 if m_playerObjId then
  4304.                     if getobject(m_playerObjId) then
  4305.                         local x, y, z = getobjectcoords(m_playerObjId)
  4306.                         x = round(x, 2)
  4307.                         y = round(y, 2)
  4308.                         z = round(z, 2)
  4309.                         sendresponse(getname(players[i]) .. "'s coords are: X: " .. x .. "  Y: " .. y .. "  Z: " .. z, command, executor)
  4310.                     else
  4311.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  4312.                     end
  4313.                 end
  4314.             end
  4315.         else
  4316.             sendresponse("Error 005: Invalid Player", command, executor)
  4317.         end
  4318.     else
  4319.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4320.     end
  4321. end
  4322.  
  4323. function Command_Godmode(executor, command, player, count)
  4324.     if count == 1 and executor ~= nil then
  4325.         if deathless ~= 1 then
  4326.             local m_playerObjId = getplayerobjectid(executor)
  4327.             if m_playerObjId then
  4328.                 local m_object = getobject(m_playerObjId)
  4329.                 if m_object then
  4330.                     local ip = getip(executor)
  4331.                     if not gods[ip] then
  4332.                         writefloat(m_object + 0xE0, 99999999)
  4333.                         writefloat(m_object + 0xE4, 99999999)
  4334.                         sendresponse("You have been given godmode.", command, executor)
  4335.                         gods[ip] = 0
  4336.                     else
  4337.                         sendresponse("You are already in godmode", command, executor)
  4338.                     end
  4339.                 else
  4340.                     sendresponse("You are dead", command, executor)
  4341.                 end
  4342.             else
  4343.                 sendresponse("You are dead", command, executor)
  4344.             end
  4345.         else
  4346.             sendresponse("Deathless is now enabled You cannot give out godmode", command, executor)
  4347.         end
  4348.     elseif count == 1 and executor == nil then
  4349.         sendresponse("The Server cannot be in god mode", command, executor)
  4350.     elseif count == 2 then
  4351.         if deathless ~= 1 then
  4352.             local players = getvalidplayers(player, executor)
  4353.             if players then
  4354.                 for i = 1, #players do
  4355.                     local m_playerObjId = getplayerobjectid(players[i])
  4356.                     if m_playerObjId then
  4357.                         local m_object = getobject(m_playerObjId)
  4358.                         if m_object then
  4359.                             local ip = getip(players[i])
  4360.                             if not gods[ip] then
  4361.                                 writefloat(m_object + 0xE0, 99999999)
  4362.                                 writefloat(m_object + 0xE4, 99999999)
  4363.                                 sendresponse(getname(players[i]) .. " has been given godmode", command, executor)
  4364.                                 gods[ip] = 0
  4365.                             else
  4366.                                 sendresponse(getname(players[i]) .. " is already in godmode", command, executor)
  4367.                             end
  4368.                         else
  4369.                             sendresponse(getname(players[i]) .. " is dead", command, executor)
  4370.                         end
  4371.                     else
  4372.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  4373.                     end
  4374.                 end
  4375.             else
  4376.                 sendresponse("Error 005: Invalid Player", command, executor)
  4377.             end
  4378.         else
  4379.             sendresponse("Deathless is now enabled You cannot give out godmode", command, executor)
  4380.         end
  4381.     else
  4382.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  4383.     end
  4384. end
  4385.  
  4386. function Command_Hashcheck(boolean)
  4387.     if (boolean == "1" or boolean == "true") and not hash_check then
  4388.         hash_check = true
  4389.         writebyte(hashcheck_addr, 0x74)
  4390.     elseif (boolean == "0" or boolean == "false") and hash_check then
  4391.         hash_check = false
  4392.         writebyte(hashcheck_addr, 0xEB)
  4393.     elseif hash_check == nil then
  4394.         hash_check = false
  4395.         writebyte(hashcheck_addr, 0xEB)
  4396.     end
  4397. end
  4398.  
  4399. function Command_HashDuplicates(executor, command, boolean, count)
  4400.     if count == 1 then
  4401.         if hash_duplicates then
  4402.             sendresponse("Hash Duplicate Checking is currently enabled", command, executor)
  4403.         else
  4404.             sendresponse("Hash Duplicate Checking is currently disabled", command, executor)
  4405.         end
  4406.     elseif count == 2 then
  4407.         if (boolean == "1" or boolean == "true") and not hash_duplicates then
  4408.             hash_duplicates = true
  4409.             writebit(hash_duplicate_patch, 0, 1)
  4410.             sendresponse("Hash Duplicate Checking is now enabled", command, executor)
  4411.         elseif (boolean == "1" or boolean == "true") then
  4412.             sendresponse("Hash Duplicate Checking is already enabled", command, executor)
  4413.         elseif boolean ~= "0" and boolean ~= "false" then
  4414.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4415.         elseif (boolean == "0" or boolean == "false") and hash_duplicates or(hash_duplicates == nil) then
  4416.             hash_duplicates = false
  4417.             writebit(hash_duplicate_patch, 0, 0)
  4418.             sendresponse("Hash Duplicate Checking is now disabled", command, executor)
  4419.         elseif boolean == "0" or boolean == "false" then
  4420.             sendresponse("Hash Duplicate Checking is already disabled", command, executor)
  4421.         else
  4422.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4423.         end
  4424.     else
  4425.         sendresponse("Invalid Syntax: " .. command .. " [boolean]", command, executor)
  4426.     end
  4427. end
  4428.  
  4429. function Command_Hax(executor, command, player, count)
  4430.     if count == 2 then
  4431.         local players = getvalidplayers(player, executor)
  4432.         if players then
  4433.             for i = 1, #players do
  4434.                 local m_player = getplayer(players[i])
  4435.                 setscore(players[i], 9999)
  4436.                 writeword(m_player + 0x9C, 9999)
  4437.                 writeword(m_player + 0xA4, 9999)
  4438.                 writeword(m_player + 0xAC, 9999)
  4439.                 writeword(m_player + 0xAE, 9999)
  4440.                 writeword(m_player + 0xB0, 9999)
  4441.                 sendresponse(getname(players[i]) .. " has been haxed", command, executor)
  4442.             end
  4443.         else
  4444.             sendresponse("Error 005: Invalid Player", command, executor)
  4445.         end
  4446.     else
  4447.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4448.     end
  4449. end
  4450.  
  4451. function Command_Heal(executor, command, player, count)
  4452.     if count == 1 and executor ~= nil then
  4453.         local m_playerObjId = getplayerobjectid(executor)
  4454.         if m_playerObjId then
  4455.             local m_object = getobject(m_playerObjId)
  4456.             if m_object then
  4457.                 local obj_health = readfloat(m_object + 0xE0)
  4458.                 if obj_health < 1 then
  4459.                     local m_vehicleId = readdword(m_object + 0x11C)
  4460.                     if m_vehicleId == nil then
  4461.                         local x, y, z = getobjectcoords(m_playerObjId)
  4462.                         local healthpack = createobject(healthpack_tag_id, 0, 0, false, x, y, z + 0.5)
  4463.                         if healthpack ~= nil then writefloat(getobject(healthpack) + 0x70, -2) end
  4464.                     else
  4465.                         writefloat(m_object + 0xE0, 1)
  4466.                     end
  4467.                     sendresponse("You have been healed", command, executor)
  4468.                 else
  4469.                     sendresponse("You are already at full health", command, executor)
  4470.                 end
  4471.             else
  4472.                 sendresponse("You are dead", command, executor)
  4473.             end
  4474.         else
  4475.             sendresponse("You are dead", command, executor)
  4476.         end
  4477.     elseif count == 1 and executor == nil then
  4478.         sendresponse("The Server cannot be healed", command, executor)
  4479.     elseif count == 2 then
  4480.         local players = getvalidplayers(player, executor)
  4481.         if players then
  4482.             for i = 1, #players do
  4483.                 local m_playerObjId = getplayerobjectid(players[i])
  4484.                 if m_playerObjId then
  4485.                     local m_object = getobject(m_playerObjId)
  4486.                     if m_object then
  4487.                         local obj_health = readfloat(m_object + 0xE0)
  4488.                         if obj_health < 1 then
  4489.                             local m_vehicleId = readdword(m_object + 0x11C)
  4490.                             if m_vehicleId == nil then
  4491.                                 local x, y, z = getobjectcoords(m_playerObjId)
  4492.                                 local healthpack = createobject(healthpack_tag_id, 0, 0, false, x, y, z + 0.5)
  4493.                                 if healthpack ~= nil then writefloat(getobject(healthpack) + 0x70, -2) end
  4494.                             else
  4495.                                 writefloat(m_object + 0xE0, 1)
  4496.                             end
  4497.                             sendresponse(getname(players[i]) .. " has been healed", command, executor)
  4498.                         else
  4499.                             sendresponse(getname(players[i]) .. " is already at full health", command, executor)
  4500.                         end
  4501.                     else
  4502.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  4503.                     end
  4504.                 else
  4505.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  4506.                 end
  4507.             end
  4508.         else
  4509.             sendresponse("Error 005: Invalid Player", command, executor)
  4510.         end
  4511.     else
  4512.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  4513.     end
  4514. end
  4515.  
  4516. function Command_Hide(executor, command, player, count)
  4517.     if count == 1 and executor ~= nil then
  4518.         local id = resolveplayer(executor)
  4519.         if id ~= nil then
  4520.             if hidden[id] == nil then
  4521.                 sendresponse("You are now hidden", command, executor)
  4522.                 hidden[id] = true
  4523.             else
  4524.                 sendresponse("You are already hidden", command, executor)
  4525.             end
  4526.         else
  4527.             sendresponse("The server cannot hide itself", command, executor)
  4528.         end
  4529.     elseif count == 1 and executor == nil then
  4530.         sendresponse("The server cannot be hidden", command, executor)
  4531.     elseif count == 2 then
  4532.         local players = getvalidplayers(player, executor)
  4533.         if players then
  4534.             for i = 1, #players do
  4535.                 local id = resolveplayer(players[i])
  4536.                 if hidden[id] == nil then
  4537.                     sendresponse(getname(players[i]) .. " is now hidden", command, executor)
  4538.                     hidden[id] = true
  4539.                 else
  4540.                     sendresponse(getname(players[i]) .. " is already hidden", command, executor)
  4541.                 end
  4542.             end
  4543.         else
  4544.             sendresponse("Error 005: Invalid Player", command, executor)
  4545.         end
  4546.     else
  4547.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  4548.     end
  4549. end
  4550.  
  4551. function Command_Infammo(executor, command, boolean, count)
  4552.     if count == 1 then
  4553.         if infammo then
  4554.             sendresponse("Infinite ammo is currently enabled", command, executor)
  4555.         else
  4556.             sendresponse("Infinite ammo is currently disabled", command, executor)
  4557.         end
  4558.     elseif count == 2 then
  4559.         if (boolean == "1" or boolean == "true") and not infammo then
  4560.             nadetimer = registertimer(300, "nadeTimer")
  4561.             for c = 0, 15 do
  4562.                 if getplayer(c) then
  4563.                     local m_ObjId = getplayerobjectid(c)
  4564.                     if m_ObjId then
  4565.                         local m_Object = getobject(m_ObjId)
  4566.                         for i = 0, 3 do
  4567.                             local m_weaponId = readdword(m_Object + 0x2F8 +(i * 4))
  4568.                             if m_weaponId then
  4569.                                 writeword(getobject(m_weaponId) + 0x2B6, 9999)
  4570.                             end
  4571.                         end
  4572.                     end
  4573.                 end
  4574.             end
  4575.             infammo = true
  4576.             sendresponse("Infinite Ammo is now enabled", command, executor)
  4577.         elseif (boolean == "1" or boolean == "true") then
  4578.             sendresponse("Infammo is already enabled", command, executor)
  4579.         elseif boolean ~= "0" and boolean ~= "false" then
  4580.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4581.         elseif (boolean == "0" or boolean == "false") and infammo then
  4582.             for c = 0, 15 do
  4583.                 if getplayer(c) then
  4584.                     local m_ObjId = getplayerobjectid(c)
  4585.                     if m_ObjId then
  4586.                         local m_Object = getobject(m_ObjId)
  4587.                         writebyte(m_Object + 0x31E, 0)
  4588.                         writebyte(m_Object + 0x31F, 0)
  4589.                     end
  4590.                 end
  4591.             end
  4592.             infammo = false
  4593.             sendresponse("Infinite Ammo is now disabled", command, executor)
  4594.         elseif infammo == nil then
  4595.             sendresponse("Infinite Ammo is now disabled", command, executor)
  4596.             infammo = false
  4597.         elseif boolean == "0" or boolean == "false" then
  4598.             sendresponse("Infammo is already disabled", command, executor)
  4599.         else
  4600.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  4601.         end
  4602.     else
  4603.         sendresponse("Invalid Syntax: " .. command .. " [boolean]", command, executor)
  4604.     end
  4605. end
  4606.  
  4607. function Command_Info(executor, command, player, count)
  4608.     if count == 2 then
  4609.         local players = getvalidplayers(player, executor)
  4610.         if players then
  4611.             for i = 1, #players do
  4612.                 local player_number = resolveplayer(players[i])
  4613.                 local m_player = getplayer(players[i])
  4614.                 local hash = gethash(players[i])
  4615.                 local ip = getip(players[i])
  4616.                 local m_playerObjId = getplayerobjectid(players[i])
  4617.                 if m_playerObjId then
  4618.                     local m_object = getobject(m_playerObjId)
  4619.                     if m_object then
  4620.                         local gametype_maximum_health = readfloat(0x671340 + 0x54)
  4621.                         local player_name = getname(players[i])
  4622.                         local player_team = getteam(players[i])
  4623.                         local player_respawn_time = readdword(m_player + 0x2C)
  4624.                         local player_invis_time = readword(m_player + 0x68)
  4625.                         local player_speed = readfloat(m_player + 0x6C)
  4626.                         local player_objective_mode = readbyte(m_player + 0x74)
  4627.                         local player_objective_mode2 = readbyte(m_player + 0x7A)
  4628.                         local player_killstreak = readword(m_player + 0x96)
  4629.                         local player_kills = readword(m_player + 0x9C)
  4630.                         local player_assists = readword(m_player + 0xA4)
  4631.                         local player_betrays = readword(m_player + 0xAC)
  4632.                         local player_deaths = readword(m_player + 0xAE)
  4633.                         local player_suicides = readword(m_player + 0xB0)
  4634.                         local Player_Ping = readword(m_player + 0xDC)
  4635.                         local player_x_coord, player_y_coord, player_z_coord = getobjectcoords(m_playerObjId)
  4636.  
  4637.                         local obj_max_health = readfloat(m_object + 0xD8)
  4638.                         local obj_max_shields = readfloat(m_object + 0xDC)
  4639.                         local obj_health = readfloat(m_object + 0xE0)
  4640.                         local obj_shields = readfloat(m_object + 0xE4)
  4641.                         local obj_flashlight_mode = readbyte(m_object + 0x206)
  4642.                         local obj_crouch = readbyte(m_object + 0x2A0)
  4643.                         local obj_weap_type = readbyte(m_object + 0x2F2)
  4644.                         local obj_nade_type = readbyte(m_object + 0x31C)
  4645.                         local obj_primary_nades = readbyte(m_object + 0x31E)
  4646.                         local obj_secondary_nades = readbyte(m_object + 0x31F)
  4647.                         local obj_flashlight_level = readfloat(m_object + 0x344)
  4648.                         local obj_invis_scale = readfloat(m_object + 0x37C)
  4649.                         local obj_airborne = readbyte(m_object + 0x4CC)
  4650.  
  4651.                         local obj_primary_weap_id = readdword(m_object + 0x2F8)
  4652.                         local obj_secondary_weap_id = readdword(m_object + 0x2FC)
  4653.                         if obj_primary_weap_id then
  4654.                             primary_weap = getobject(obj_primary_weap_id)
  4655.                         end
  4656.                         if obj_secondary_weap_id then
  4657.                             secondary_weap = getobject(obj_secondary_weap_id)
  4658.                         end
  4659.  
  4660.                         local m_vehicle = getobject(m_playerObjId)
  4661.                         if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then
  4662.                             primary_weap = getobject(readdword(m_vehicle + 0x2F8))
  4663.                         end
  4664.                         if primary_weap then
  4665.                             primary_weap_heat = readfloat(primary_weap + 0x23C)
  4666.                             primary_weap_age = readfloat(primary_weap + 0x240)
  4667.                             primary_weap_ammo = readword(primary_weap + 0x2B6)
  4668.                             primary_weap_clip = readword(primary_weap + 0x2B8)
  4669.                         end
  4670.                         if secondary_weap then
  4671.                             secondary_weap_heat = readfloat(secondary_weap + 0x23C)
  4672.                             secondary_weap_age = readfloat(secondary_weap + 0x240)
  4673.                             secondary_weap_ammo = readword(secondary_weap + 0x2B6)
  4674.                             secondary_weap_clip = readword(secondary_weap + 0x2B8)
  4675.                         end
  4676.  
  4677.                         local teamsize = getteamsize(player_team)
  4678.                         if team_play then
  4679.                             if player_team == 0 then
  4680.                                 player_team = "Red"
  4681.                             elseif player_team == 1 then
  4682.                                 player_team = "Blue"
  4683.                             else
  4684.                                 player_team = "Hidden"
  4685.                             end
  4686.                         else
  4687.                             player_team = "FFA"
  4688.                         end
  4689.  
  4690.                         if player_objective_mode == 0x22 and player_objective_mode2 == 0x71 then
  4691.                             player_objective_mode = "Hill"
  4692.                         elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x71 then
  4693.                             player_objective_mode = "Juggernaut"
  4694.                         elseif player_objective_mode == 0x23 and player_objective_mode2 == 0x72 then
  4695.                             player_objective_mode = "It"
  4696.                         elseif player_objectivemode == 0x29 and player_objective_mode2 == 0x70 then
  4697.                             player_objective_mode = "Ball"
  4698.                         else
  4699.                             player_objective_mode = "None"
  4700.                         end
  4701.  
  4702.                         if obj_weap_type == 2 and player_objective_mode == "None" then
  4703.                             player_objective_mode = "Flag"
  4704.                         end
  4705.  
  4706.                         player_respawn_time = round(player_respawn_time / 30, 2)
  4707.                         player_invis_time = round(player_invis_time / 30, 2)
  4708.  
  4709.                         player_betrays = player_betrays - player_suicides
  4710.  
  4711.                         player_x_coord = round(player_x_coord)
  4712.                         player_y_coord = round(player_y_coord)
  4713.                         player_z_coord = round(player_z_coord)
  4714.  
  4715.                         obj_invis_scale = round(obj_invis_scale * 100, 2)
  4716.  
  4717.                         if obj_invis_scale == 0 then
  4718.                             obj_invis_scale = "No"
  4719.                         else
  4720.                             obj_invis_scale = obj_invis_scale .. "%"
  4721.                         end
  4722.  
  4723.                         local invis_info = "Invis: " .. obj_invis_scale
  4724.  
  4725.                         if obj_invis_scale ~= "No" then
  4726.                             invis_info = "Invis: " .. obj_invis_scale .. " (" .. player_invis_time .. " secs)"
  4727.                         end
  4728.  
  4729.                         if obj_flashlight_mode == 8 then
  4730.                             obj_flashlight_mode = "On"
  4731.                         else
  4732.                             obj_flashlight_mode = "Off"
  4733.                         end
  4734.  
  4735.                         obj_flashlight_level = round(obj_flashlight_level * 100)
  4736.  
  4737.                         if primary_weap_age == 0 then
  4738.                             if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then
  4739.                                 if primary_weap then
  4740.                                     writefloat(primary_weap + 0x240, 1)
  4741.                                     primary_weap_age = 1
  4742.                                 end
  4743.                             end
  4744.                         end
  4745.  
  4746.                         if secondary_weap_age == 0 then
  4747.                             if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then
  4748.                                 if secondary_weap then
  4749.                                     writefloat(secondary_weap + 0x240, 1)
  4750.                                     secondary_weap_age = 1
  4751.                                 end
  4752.                             end
  4753.                         end
  4754.  
  4755.                         if obj_weap_type == 1 then
  4756.                             primary_weap_heat = readfloat(secondary_weap + 0x23C)
  4757.                             primary_weap_age = readfloat(secondary_weap + 0x240)
  4758.                             primary_weap_ammo = readword(secondary_weap + 0x2B6)
  4759.                             primary_weap_clip = readword(secondary_weap + 0x2B8)
  4760.                             secondary_weap_heat = readfloat(primary_weap + 0x23C)
  4761.                             secondary_weap_age = readfloat(primary_weap + 0x240)
  4762.                             secondary_weap_ammo = readword(primary_weap + 0x2B6)
  4763.                             secondary_weap_clip = readword(primary_weap + 0x2B8)
  4764.                         end
  4765.  
  4766.                         if primary_weap_heat ~= nil then
  4767.                             primary_weap_heat = round(primary_weap_heat * 100)
  4768.                         end
  4769.                         if primary_weap_age ~= nil then
  4770.                             primary_weap_age = round((1 - primary_weap_age) * 100)
  4771.                         end
  4772.                         if secondary_weap_heat ~= nil then
  4773.                             secondary_weap_heat = round(secondary_weap_heat * 100)
  4774.                         end
  4775.                         if secondary_weap_age ~= nil then
  4776.                             secondary_weap_age = round((1 - secondary_weap_age) * 100)
  4777.                         end
  4778.  
  4779.                         local primary_weap_info = "Primary: Empty"
  4780.                         local secondary_weap_info = "Secondary: Empty"
  4781.  
  4782.                         if obj_health ~= 0 then
  4783.                             if obj_crouch == 1 or obj_crouch == 5 or obj_crouch == 6 or obj_crouch == 13 or obj_crouch == 17 then
  4784.                                 if primary_weap_age == 100 and primary_weap_ammo == 0 and primary_weap_clip == 0 then
  4785.                                     primary_weap_info = "Primary: Infinite"
  4786.                                 else
  4787.                                     primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo
  4788.                                 end
  4789.                             else
  4790.  
  4791.                                 if primary_weap then
  4792.                                     if primary_weap_age == 0 then
  4793.                                         if primary_weap_ammo ~= 0 or primary_weap_clip ~= 0 then
  4794.                                             primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo
  4795.                                         end
  4796.                                     else
  4797.                                         primary_weap_info = "Primary Battery: " .. primary_weap_heat .. "% / " .. primary_weap_age .. "%"
  4798.                                     end
  4799.                                 end
  4800.  
  4801.                                 if secondary_weap then
  4802.                                     if secondary_weap_age == 0 then
  4803.                                         if secondary_weap_ammo ~= 0 or secondary_weap_clip ~= 0 then
  4804.                                             secondary_weap_info = "Secondary Ammo: " .. secondary_weap_clip .. " / " .. secondary_weap_ammo
  4805.                                         end
  4806.                                     else
  4807.                                         secondary_weap_info = "Secondary Battery: " .. secondary_weap_heat .. "% / " .. secondary_weap_age .. "%"
  4808.                                     end
  4809.                                 end
  4810.  
  4811.                             end
  4812.                         end
  4813.  
  4814.                         local nade_info = "Frag Grenades: " .. obj_primary_nades .. " | " .. "Plasma Grenades: " .. obj_secondary_nades
  4815.                         if obj_nade_type == 1 then
  4816.                             nade_info = "Plasma Grenades: " .. obj_secondary_nades .. " | " .. "Frag Grenades: " .. obj_primary_nades
  4817.                         end
  4818.  
  4819.                         if obj_crouch == 0 then
  4820.                             obj_crouch = "Warthog: Driver"
  4821.                         elseif obj_crouch == 1 then
  4822.                             obj_crouch = "Warthog: Gunner"
  4823.                         elseif obj_crouch == 2 then
  4824.                             obj_crouch = "Warthog: Passenger"
  4825.                         elseif obj_crouch == 3 then
  4826.                             obj_crouch = "Stance: Crouching"
  4827.                         elseif obj_crouch == 4 then
  4828.                             obj_crouch = "Stance: Standing"
  4829.                         elseif obj_crouch == 5 then
  4830.                             obj_crouch = "Ghost: Driver"
  4831.                         elseif obj_crouch == 6 then
  4832.                             obj_crouch = "Banshee: Pilot"
  4833.                         elseif obj_crouch == 13 then
  4834.                             obj_crouch = "Scorpion: Driver"
  4835.                         elseif obj_crouch == 17 then
  4836.                             obj_crouch = "Shade: Gunner"
  4837.                         elseif obj_crouch == 20 or obj_crouch == 21 or obj_crouch == 22 or obj_crouch == 23 then
  4838.                             obj_crouch = "Scorpion: Passenger"
  4839.                         end
  4840.  
  4841.                         if obj_crouch == "Stance: Crouching" or obj_crouch == "Stance: Standing" then
  4842.                             if obj_airborne == 1 then
  4843.                                 obj_crouch = "Stance: Airborne"
  4844.                             end
  4845.                         end
  4846.  
  4847.                         if obj_health == 0 and obj_shields == 0 then
  4848.                             obj_crouch = "Stance: Dead"
  4849.                         end
  4850.  
  4851.                         obj_max_health = round(obj_health * obj_max_health)
  4852.                         obj_max_shields = round(obj_shields * obj_max_shields)
  4853.                         obj_health = round(obj_health * 100)
  4854.                         obj_shields = round(obj_shields * 100)
  4855.  
  4856.                         local health_info = "Health: " .. obj_health .. "% (" .. obj_max_health .. ") | " .. "Shields: " .. obj_shields .. "% (" .. obj_max_shields .. ")"
  4857.  
  4858.                         if obj_health == 0 and obj_shields == 0 and player_respawn_time ~= 0 then
  4859.                             if player_respawn_time == 1 then
  4860.                                 health_info = "Respawn: " .. player_respawn_time .. " sec"
  4861.                             else
  4862.                                 health_info = "Respawn: " .. player_respawn_time .. " secs"
  4863.                             end
  4864.                         end
  4865.  
  4866.                         if Suspend_Table[ip] == 2 then
  4867.                             health_info = "Respawn: Never"
  4868.                         end
  4869.                         if hidden[player_number] then
  4870.                             hidden_boolean = "True"
  4871.                         else
  4872.                             hidden_boolean = "False"
  4873.                         end
  4874.                         if gods[ip] then
  4875.                             god_boolean = "True"
  4876.                         else
  4877.                             god_boolean = "False"
  4878.                         end
  4879.                         if afk[player_number][1] then
  4880.                             afk_boolean = "True"
  4881.                         else
  4882.                             afk_boolean = "False"
  4883.                         end
  4884.                         if Admin_Table[hash] or IpAdmins[ip] then
  4885.                             admin_status = "True"
  4886.                         else
  4887.                             admin_status = "False"
  4888.                         end
  4889.                         sendresponse("----------", command, executor)
  4890.                         sendresponse("Name: " .. player_name .. " (" .. player_number .. ") | " .. "Team: " .. player_team .. " (" .. teamsize .. ")  |  Speed: " .. round(player_speed, 2) .. " | " .. "Location: " .. player_x_coord .. ", " .. player_y_coord .. ", " .. player_z_coord, command, executor)
  4891.                         sendresponse("Hash: " .. hash .. " | " .. " IP: " .. ip, command, executor)
  4892.                         sendresponse("Admin: " .. admin_status .. " | " .. "Ping: " .. Player_Ping .. " | " .. obj_crouch, command, executor)
  4893.                         sendresponse("Kills: " .. player_kills .. " (" .. player_killstreak .. ") | " .. "Assists: " .. player_assists .. " | " .. "Betrays: " .. player_betrays .. " | " .. "Suicides: " .. player_suicides .. " | " .. "Deaths: " .. player_deaths, command, executor)
  4894.                         sendresponse(health_info .. " | " .. invis_info .. "\n" .. "Light: " .. obj_flashlight_mode .. " (" .. obj_flashlight_level .. "%)", command, executor)
  4895.                         sendresponse(primary_weap_info .. " | " .. secondary_weap_info .. " | " .. "Objective: " .. player_objective_mode, command, executor)
  4896.                         sendresponse(nade_info, command, executor)
  4897.                         sendresponse("Hidden: " .. hidden_boolean .. " | God: " .. god_boolean .. " | AFK: " .. afk_boolean, command, executor)
  4898.                         sendresponse("----------", command, executor)
  4899.                     else
  4900.                         sendresponse("The selected player is dead", command, executor)
  4901.                     end
  4902.                 else
  4903.                     sendresponse("The selected player is dead", command, executor)
  4904.                 end
  4905.             end
  4906.         else
  4907.             sendresponse("Error 005: Invalid Player", command, executor)
  4908.         end
  4909.     else
  4910.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  4911.     end
  4912. end
  4913.  
  4914. function Command_Ipadminadd(executor, command, player, nickname, level, count)
  4915.     if count == 4 and tonumber(level) then
  4916.         local words = tokenizestring(player, ".")
  4917.         local count = #words
  4918.         if count == 4 then
  4919.             if IpAdmins[player] then
  4920.                 sendresponse(nickname .. " is already an IP admin", command, executor)
  4921.             elseif not nickname:find(",") then
  4922.                 if tonumber(level) <= #Access_Table then
  4923.                     IpAdmins[player] = IpAdmins[player] or { }
  4924.                     IpAdmins[player].name = nickname
  4925.                     IpAdmins[player].level = level
  4926.                     sendresponse(nickname .. " is now an IP admin", tostring(command), tostring(executor))
  4927.                     registertimer(0, "reloadadmins")
  4928.                 else
  4929.                     sendresponse("That level does not exist.", command, executor)
  4930.                 end
  4931.             else
  4932.                 sendresponse("Nicknames must contain no commas.", command, executor)
  4933.             end
  4934.         elseif count > 1 then
  4935.             sendresponse("Invalid IP Address Format (xxx.xxx.xxx.xxx)", command, executor)
  4936.         else
  4937.             local players = getvalidplayers(player, executor)
  4938.             if players then
  4939.                 if not players[2] then
  4940.                     local ip = getip(players[1])
  4941.                     if IpAdmins[ip] then
  4942.                         sendresponse(getname(tostring(players[1])) .. " is already an IP admin", command, executor)
  4943.                     elseif not nickname:find(",") then
  4944.                         if tonumber(level) <= #Access_Table then
  4945.                             IpAdmins[ip] = IpAdmins[ip] or { }
  4946.                             IpAdmins[ip].name = nickname
  4947.                             IpAdmins[ip].level = level
  4948.                             sendresponse(getname(tostring(players[1])) .. " is now an IP admin", tostring(command), tostring(executor))
  4949.                             registertimer(0, "reloadadmins")
  4950.                         else
  4951.                             sendresponse("That level does not exist.", command, executor)
  4952.                         end
  4953.                     else
  4954.                         sendresponse("Nicknames must contain no commas.", command, executor)
  4955.                     end
  4956.                 else
  4957.                     sendresponse("You cannot add more than one admin with the same nickname", command, executor)
  4958.                 end
  4959.             else
  4960.                 sendresponse("Error 005: Invalid Player", command, executor)
  4961.             end
  4962.         end
  4963.     else
  4964.         sendresponse("Invalid Syntax: " .. command .. " [player or IP] [nickname] [level]", command, executor)
  4965.     end
  4966. end
  4967.  
  4968. function Command_ipadmindelete(executor, command, nickname, count)
  4969.     if count == 2 then
  4970.         if type(IpAdmins) ~= nil then
  4971.             local bool = true
  4972.             for k, v in pairs(IpAdmins) do
  4973.                 if IpAdmins[k] then
  4974.                     if IpAdmins[k].name == nickname then
  4975.                         IpAdmins[k] = nil
  4976.                         bool = false
  4977.                     end
  4978.                 end
  4979.             end
  4980.             if bool then
  4981.                 sendresponse("There are no IP admins with a nickname of '" .. nickname .. "'", command, executor)
  4982.             else
  4983.                 sendresponse(nickname .. " is no longer an IP admin", command, executor)
  4984.             end
  4985.         else
  4986.             sendresponse("There are no IP admins on this server.", command, executor)
  4987.         end
  4988.     else
  4989.         sendresponse("Invalid Syntax: " .. command .. " [nickname]", command, executor)
  4990.     end
  4991. end
  4992.  
  4993. function Command_Ipban(executor, command, player, time, message, count)
  4994.     ipcount = 0
  4995.     if player then
  4996.         local words = tokenizestring(player, ".")
  4997.         ipcount = #words
  4998.     end
  4999.     if ipcount == 4 then
  5000.         local ipbantime = wordtotime(time) or -1
  5001.         local name = "the Server"
  5002.         if executor ~= nil then name = getname(executor) end
  5003.         message = tostring(message) or "None Given"
  5004.         BanReason("The IP: " .. player .. " was banned by " .. name .. " Reason: " .. message .. " Type: IP Ban")
  5005.         IP_BanList[player] = { }
  5006.         table.insert(IP_BanList[player], { ["name"] = "Player", ["ip"] = player, ["time"] = ipbantime, ["id"] = IP_BanID })
  5007.         IP_BanID = IP_BanID + 1
  5008.         sendresponse(player .. " has been banned from the server", command, executor)
  5009.     elseif ipcount > 1 then
  5010.         sendresponse("Invalid IP Address Format (xxx.xxx.xxx.xxx)", command, executor)
  5011.     else
  5012.         if count >= 2 and count <= 4 then
  5013.             local players = getvalidplayers(player, executor)
  5014.             if players then
  5015.                 local name = "the Server"
  5016.                 if executor ~= nil then name = getname(executor) end
  5017.                 for i = 1, #players do
  5018.                     if CheckAccess(executor, command, players[i], getaccess(executor)) then
  5019.                         local ipbantime = wordtotime(time) or -1
  5020.                         message = tostring(message) or "None Given"
  5021.                         BanReason(getname(players[i]) .. " was banned by " .. name .. " Reason: " .. message .. " Type: IP Ban")
  5022.                         say(getname(players[i]) .. " was IP banned by " .. name .. " Reason: " .. message)
  5023.                         local ip = getip(players[i])
  5024.                         IP_BanList[ip] = { }
  5025.                         table.insert(IP_BanList[ip], { ["name"] = getname(players[i]), ["ip"] = getip(players[i]), ["time"] = ipbantime, ["id"] = IP_BanID })
  5026.                         IP_BanID = IP_BanID + 1
  5027.                         Ipban(players[i])
  5028.                         msg = getname(players[i]) .. " has been IP banned from the server"
  5029.                         hprintf(msg)
  5030.                         sendresponse(msg, command, executor)
  5031.                     else
  5032.                         local Command = getvalidformat(command)
  5033.                         sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  5034.                         sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  5035.                     end
  5036.                 end
  5037.             else
  5038.                 sendresponse("Error 005: Invalid Player", command, executor)
  5039.             end
  5040.         else
  5041.             sendresponse("Invalid Syntax: " .. command .. " [player or ip] {time} {message} ", command, executor)
  5042.         end
  5043.     end
  5044. end
  5045.  
  5046. function Command_Ipbanlist(executor, command, count)
  5047.     if count == 1 then
  5048.         if IP_BanList ~= { } then
  5049.             local response = "ID - Name - IP - Time"
  5050.             local response_table = { }
  5051.             local bool = true
  5052.             for k, v in pairs(IP_BanList) do
  5053.                 if IP_BanList[k] ~= { } then
  5054.                     for key, value in pairs(IP_BanList[k]) do
  5055.                         local id = IP_BanList[k][key].id
  5056.                         response_table[id] = id .. "  |  " .. IP_BanList[k][key].name .. "  |  " .. IP_BanList[k][key].ip .. "  |  " .. timetoword(IP_BanList[k][key].time)
  5057.                     end
  5058.                 end
  5059.             end
  5060.             for i = 0, IP_BanID do
  5061.                 if response_table[i] then
  5062.                     bool = false
  5063.                     response = response .. "\n" .. response_table[i]
  5064.                 end
  5065.             end
  5066.             if bool then
  5067.                 response = "IP Banlist is empty"
  5068.             end
  5069.             sendresponse(response, command, executor)
  5070.         end
  5071.     else
  5072.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5073.     end
  5074. end
  5075.  
  5076. function Command_Ipunban(executor, command, ID, count)
  5077.     if count == 2 and tonumber(ID) then
  5078.         ID = tonumber(ID)
  5079.         local response = "Invalid ID"
  5080.         if ID <= IP_BanID then
  5081.             local bool = false
  5082.             for k, v in pairs(IP_BanList) do
  5083.                 if IP_BanList[k] ~= { } then
  5084.                     for key, value in pairs(IP_BanList[k]) do
  5085.                         if IP_BanList[k][key].id == ID then
  5086.                             bool = true
  5087.                             response = k .. " has been unipbanned"
  5088.                             table.remove(IP_BanList[k])
  5089.                             break
  5090.                         end
  5091.                     end
  5092.                 end
  5093.                 if bool then
  5094.                     break
  5095.                 end
  5096.             end
  5097.             sendresponse(response, command, executor)
  5098.         else
  5099.             sendresponse(response, command, executor)
  5100.         end
  5101.     else
  5102.         sendresponse("Invalid Syntax: " .. command .. " [ID]", command, executor)
  5103.     end
  5104. end
  5105.  
  5106. function Command_Iprangeban(executor, command, player, time, message, count)
  5107.     local ipcount = 0
  5108.     if player then
  5109.         local words = tokenizestring(player, ".")
  5110.         ipcount = #words
  5111.     end
  5112.     if ipcount == 2 then
  5113.         local ipbantime = wordtotime(time) or -1
  5114.         local name = "the Server"
  5115.         if executor ~= nil then name = getname(executor) end
  5116.         message = tostring(message) or "None Given"
  5117.         BanReason("The IP: " .. player .. " was Banned by " .. name .. " Reason: " .. message .. " Type: IP Range Ban")
  5118.         IpRange_BanList[player] = { }
  5119.         table.insert(IpRange_BanList[player], { ["name"] = "Player", ["ip"] = player, ["time"] = ipbantime, ["id"] = IP_BanID })
  5120.         IpRange_BanID = IpRange_BanID + 1
  5121.         sendresponse(player .. " has been banned from the server", command, executor)
  5122.     elseif ipcount > 1 then
  5123.         sendresponse("Invalid IP Address Format (xxx.xxx)", command, executor)
  5124.     else
  5125.         if count >= 2 and count <= 4 then
  5126.             local players = getvalidplayers(player, executor, command)
  5127.             if players then
  5128.                 local name = "the Server"
  5129.                 if executor ~= nil then name = getname(executor) end
  5130.                 for i = 1, #players do
  5131.                     if CheckAccess(executor, command, players[i], getaccess(executor)) then
  5132.                         local ipbantime = wordtotime(time) or -1
  5133.                         message = tostring(message) or "None Given"
  5134.                         BanReason(getname(players[i]) .. " was banned by " .. name .. " Reason: " .. message .. " Type: IP Range Ban")
  5135.                         say(getname(players[i]) .. " was IP banned by " .. name .. " Reason: " .. message)
  5136.                         local ip = getip(players[i])
  5137.                         local words = tokenizestring(ip, ".")
  5138.                         local ip2 = words[1] .. "." .. words[2]
  5139.                         IpRange_BanList[ip2] = { }
  5140.                         table.insert(IpRange_BanList[ip2], { ["name"] = getname(players[i]), ["ip"] = ip2, ["time"] = ipbantime, ["id"] = IpRange_BanID })
  5141.                         IpRange_BanID = IpRange_BanID + 1
  5142.                         Ipban(players[i])
  5143.                         msg = getname(players[i]) .. " has been IP banned from the server"
  5144.                         hprintf(msg)
  5145.                         sendresponse(msg, command, executor)
  5146.                     else
  5147.                         local Command = getvalidformat(command)
  5148.                         sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  5149.                         sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  5150.                     end
  5151.                 end
  5152.             else
  5153.                 sendresponse("Error 005: Invalid Player", command, executor)
  5154.             end
  5155.         else
  5156.             sendresponse("Invalid Syntax: " .. command .. " [player or ip] {time} {message} ", command, executor)
  5157.         end
  5158.     end
  5159. end
  5160.  
  5161. function Command_Iprangebanlist(executor, command, count)
  5162.     if count == 1 then
  5163.         if IpRange_BanList ~= { } then
  5164.             local response = "ID - Name - IP - Time"
  5165.             local response_table = { }
  5166.             local bool = true
  5167.             for k, v in pairs(IpRange_BanList) do
  5168.                 if IpRange_BanList[k] ~= { } then
  5169.                     for key, value in pairs(IpRange_BanList[k]) do
  5170.                         local id = IpRange_BanList[k][key].id
  5171.                         response_table[id] = id .. "  |  " .. IpRange_BanList[k][key].name .. "  |  " .. IpRange_BanList[k][key].ip .. "  |  " .. timetoword(IpRange_BanList[k][key].time)
  5172.                     end
  5173.                 end
  5174.             end
  5175.             for i = 0, IpRange_BanID do
  5176.                 if response_table[i] then
  5177.                     bool = false
  5178.                     response = response .. "\n" .. response_table[i]
  5179.                 end
  5180.             end
  5181.             if bool then
  5182.                 response = "IP Range Banlist is empty"
  5183.             end
  5184.             sendresponse(response, command, executor)
  5185.         end
  5186.     else
  5187.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5188.     end
  5189. end
  5190.  
  5191. function Command_Iprangeunban(executor, command, ID, count)
  5192.     if count == 2 and tonumber(ID) then
  5193.         ID = tonumber(ID)
  5194.         local response = "Invalid ID"
  5195.         if ID <= IpRange_BanID then
  5196.             local bool = false
  5197.             for k, v in pairs(IpRange_BanList) do
  5198.                 if IpRange_BanList[k] ~= { } then
  5199.                     for key, value in pairs(IpRange_BanList[k]) do
  5200.                         if IpRange_BanList[k][key].id == ID then
  5201.                             bool = true
  5202.                             response = k .. " has been uniprangebanned"
  5203.                             table.remove(IpRange_BanList[k])
  5204.                             break
  5205.                         end
  5206.                     end
  5207.                 end
  5208.                 if bool then
  5209.                     break
  5210.                 end
  5211.             end
  5212.             sendresponse(response, command, executor)
  5213.         else
  5214.             sendresponse(response, command, executor)
  5215.         end
  5216.     else
  5217.         sendresponse("Invalid Syntax: " .. command .. " [ID]", command, executor)
  5218.     end
  5219. end
  5220.  
  5221. function Command_Invis(executor, command, player, time, count)
  5222.     if count == 1 and executor ~= nil then
  5223.         local m_objectId = getplayerobjectid(executor)
  5224.         if m_objectId then
  5225.             if getobject(m_objectId) and Ghost_Table[getip(executor)] == nil then
  5226.                 Ghost_Table[getip(executor)] = true
  5227.                 sendresponse("You are now invisible", command, executor)
  5228.             elseif Ghost_Table[getip(executor)] then
  5229.                 sendresponse("You are already invisible", command, executor)
  5230.             else
  5231.                 sendresponse("You are dead dead", command, executor)
  5232.             end
  5233.         else
  5234.             sendresponse("You are dead dead", command, executor)
  5235.         end
  5236.     elseif count == 1 and executor == nil then
  5237.         sendresponse("The server cannot be invisible", command, executor)
  5238.     elseif count == 2 then
  5239.         local players = getvalidplayers(player, executor)
  5240.         if players then
  5241.             for i = 1, #players do
  5242.                 local m_objectId = getplayerobjectid(players[i])
  5243.                 if m_objectId then
  5244.                     if getobject(m_objectId) and Ghost_Table[getip(players[i])] == nil then
  5245.                         Ghost_Table[getip(players[i])] = true
  5246.                         sendresponse(getname(players[i]) .. " is now invisible", command, executor)
  5247.                     elseif Ghost_Table[getip(players[i])] then
  5248.                         sendresponse(getname(players[i]) .. " is already invisible", command, executor)
  5249.                     else
  5250.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  5251.                     end
  5252.                 else
  5253.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  5254.                 end
  5255.             end
  5256.         else
  5257.             sendresponse("Error 005: Invalid Player", command, executor)
  5258.         end
  5259.     elseif count == 3 and tonumber(time) then
  5260.         local players = getvalidplayers(player, executor)
  5261.         if players then
  5262.             for i = 1, #players do
  5263.                 local m_objectId = getplayerobjectid(players[i])
  5264.                 if m_objectId then
  5265.                     if getobject(m_objectId) and Ghost_Table[getip(players[i])] == nil then
  5266.                         Ghost_Table[getip(players[i])] = tonumber(time)
  5267.                         sendresponse(getname(players[i]) .. " is now invisible for " .. time .. " seconds", command, executor)
  5268.                         privatesay(players[i], "You are now invisible for " .. time .. " seconds.")
  5269.                     elseif Ghost_Table[getip(players[i])] then
  5270.                         sendresponse(getname(players[i]) .. " is already invisible", command, executor)
  5271.                     else
  5272.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  5273.                     end
  5274.                 else
  5275.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  5276.                 end
  5277.             end
  5278.         else
  5279.             sendresponse("Error 005: Invalid Player", command, executor)
  5280.         end
  5281.     else
  5282.         sendresponse("Invalid Syntax: " .. command .. " [player] {time}", command, executor)
  5283.     end
  5284. end
  5285.  
  5286. function Command_Kick(executor, command, player, message, count)
  5287.     if count == 2 or count == 3 then
  5288.         local players = getvalidplayers(player, executor, command)
  5289.         if players then
  5290.             local name = "the Server."
  5291.             if executor ~= nil then name = getname(executor) end
  5292.             for i = 1, #players do
  5293.                 if CheckAccess(executor, command, players[i], getaccess(executor)) then
  5294.                     if executor ~= players[i] then
  5295.                         message = message or "None Given"
  5296.                         WriteLog(profilepath .. "\\logs\\Player Kicks.log", getname(players[i]) .. " was kicked by " .. name .. " Reason: " .. message)
  5297.                         say(getname(players[i]) .. " was kicked by " .. name .. " Reason: " .. message)
  5298.                         msg = getname(players[i]) .. " has been kicked from the server"
  5299.                         sendresponse(msg, command, executor)
  5300.                         svcmd("sv_kick " .. resolveplayer(players[i]))
  5301.                     else
  5302.                         sendresponse("You cannot kick yourself", command, executor)
  5303.                     end
  5304.                 else
  5305.                     local Command = getvalidformat(command)
  5306.                     sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  5307.                     sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  5308.                 end
  5309.             end
  5310.         else
  5311.             sendresponse("Error 005: Invalid Player", command, executor)
  5312.         end
  5313.     else
  5314.         sendresponse("Invalid Syntax: " .. command .. ' [player] {reason}', command, executor)
  5315.     end
  5316. end
  5317.  
  5318. function Command_Kill(executor, command, player, count)
  5319.     if count == 2 then
  5320.         local players = getvalidplayers(player, executor)
  5321.         if players then
  5322.             for i = 1, #players do
  5323.                 kill(players[i])
  5324.                 sendresponse(getname(players[i]) .. " has been killed", command, executor)
  5325.             end
  5326.         else
  5327.             sendresponse("Error 005: Invalid Player", command, executor)
  5328.         end
  5329.     else
  5330.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  5331.     end
  5332. end
  5333.  
  5334. function Command_KillingSpree(executor, command, boolean, count)
  5335.     if count == 1 then
  5336.         if killing_spree then
  5337.             sendresponse("Killing Spree Notifications is currently on", command, executor)
  5338.         else
  5339.             sendresponse("Killing Spree Notifications is currently off", command, executor)
  5340.         end
  5341.     elseif count == 2 then
  5342.         if (boolean == "1" or boolean == "true") and killing_spree ~= true then
  5343.             killing_spree = true
  5344.             sendresponse("Killing Spree Notifications is now enabled", command, executor)
  5345.         elseif (boolean == "1" or boolean == "true") and killing_spree == true then
  5346.             sendresponse("Killing Spree Notifications is already enabled", command, executor)
  5347.         elseif (boolean == "0" or boolean == "false") and killing_spree ~= false then
  5348.             killing_spree = false
  5349.             sendresponse("Killing Spree Notifications is now disabled", command, executor)
  5350.         elseif killing_spree == nil then
  5351.             killing_spree = false
  5352.             sendresponse("Killing Spree Notifications is now disabled", command, executor)
  5353.         elseif (boolean == "0" or boolean == "false") and killing_spree == false then
  5354.             sendresponse("Killing Spree Notifications is already disabled", command, executor)
  5355.         else
  5356.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  5357.         end
  5358.     else
  5359.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  5360.     end
  5361. end
  5362.  
  5363. function Command_Launch(executor, command, player, count)
  5364.     if count == 2 then
  5365.         local players = getvalidplayers(player, executor)
  5366.         if players then
  5367.             for i = 1, #players do
  5368.                 local m_objectId = getplayerobjectid(players[i])
  5369.                 if m_objectId then
  5370.                     local m_object = getobject(m_objectId)
  5371.                     if m_object then
  5372.                         local m_vehicleId = readdword(m_object + 0x11C)
  5373.                         local m_vehicle = getobject(m_vehicleId)
  5374.                         if m_vehicle then
  5375.                             sendresponse(getname(players[i]) .. " has been launched", command, executor)
  5376.                             local tagName = getobjecttag(m_vehicleId)
  5377.                             writebit(m_vehicle + 0x10, 2, 0)
  5378.                             if tagName == "vehicles\\scorpion\\scorpion_mp" then
  5379.                                 writefloat(m_vehicle + 0x94, 15)
  5380.                                 writefloat(m_vehicle + 0x70, 0.35)
  5381.                                 writefloat(m_vehicle + 0x6C, 0.35)
  5382.                             elseif tagName == "vehicles\\banshee\\banshee_mp" then
  5383.                                 writefloat(m_vehicle + 0x90, 30)
  5384.                                 writefloat(m_vehicle + 0x70, 0.35)
  5385.                                 writefloat(m_vehicle + 0x6C, -0.4)
  5386.                             elseif tagName == "vehicles\\ghost\\ghost_mp" then
  5387.                                 writefloat(m_vehicle + 0x8C, 7)
  5388.                                 writefloat(m_vehicle + 0x70, 0.35)
  5389.                             elseif tagName == "vehicles\\warthog\\mp_warthog" then
  5390.                                 writefloat(m_vehicle + 0x94, 10)
  5391.                                 writefloat(m_vehicle + 0x70, 0.35)
  5392.                             elseif tagName == "vehicles\\rwarthog\\rwarthog" then
  5393.                                 writefloat(m_vehicle + 0x94, 15)
  5394.                                 writefloat(m_vehicle + 0x70, 0.35)
  5395.                             else
  5396.                                 writefloat(m_vehicle + 0x94, 10)
  5397.                                 writefloat(m_vehicle + 0x70, 0.35)
  5398.                             end
  5399.                         else
  5400.                             sendresponse(getname(players[i]) .. " is not in a vehicle", command, executor)
  5401.                         end
  5402.                     else
  5403.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  5404.                     end
  5405.                 else
  5406.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  5407.                 end
  5408.             end
  5409.         else
  5410.             sendresponse("Error 005: Invalid Player", command, executor)
  5411.         end
  5412.     else
  5413.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  5414.     end
  5415. end
  5416.  
  5417. function Command_List(executor, command, word, count)
  5418.     local word = tonumber(word)
  5419.     if count == 2 then
  5420.         if word == 1 then
  5421.             sendresponse("sv_setafk\nsv_admin_list\nsv_admin_add\nsv_admin_del\nsv_revoke\nsv_alias", command, executor)
  5422.             sendresponse("sv_adminblocker\nsv_anticaps\nsv_antispam\nsv_ban", command, executor)
  5423.         elseif word == 2 then
  5424.             sendresponse("sv_bos\nsv_boslist\nsv_bosplayers\nsv_chatcommands\nsv_change_level", command, executor)
  5425.             sendresponse("sv_changeteam\nsv_crash\nsv_commands\nsv_control\nsv_count", command, executor)
  5426.         elseif word == 3 then
  5427.             sendresponse("sv_uniques_enabled\nsv_deathless\nsv_eject\nsv_falldamage\nsv_firstjoin_message", command, executor)
  5428.             sendresponse("sv_follow\nsv_gethash\nsv_getip\nsv_getloc\nsv_setgod", command, executor)
  5429.         elseif word == 4 then
  5430.             sendresponse("sv_cheat_hax\nsv_heal\nsv_help\nsv_hide\nsv_hitler\nsv_ipadminadd\nsv_ipadmindelete", command, executor)
  5431.             sendresponse("sv_ipban\nsv_ipbanlist\nsv_info", command, executor)
  5432.         elseif word == 5 then
  5433.             sendresponse("sv_infinite_ammo\nsv_ipunban\nsv_invis\nsv_kick\nsv_kill\nsv_killspree\nsv_launch", command, executor)
  5434.             sendresponse("sv_list\nsv_scrim\nsv_login", command, executor)
  5435.         elseif word == 6 then
  5436.             sendresponse("sv_map\nsv_mnext\nsv_reset\nsv_move\nsv_mute\nsv_nameban\nsv_namebanlist", command, executor)
  5437.             sendresponse("sv_nameunban\nsv_noweapons\nsv_os\n", command, executor)
  5438.         elseif word == 7 then
  5439.             sendresponse("sv_pvtmessage\nsv_pvtsay\nsv_players_more\nsv_players\nsv_resetweapons\nsv_resp", command, executor)
  5440.             sendresponse("sv_rtv_enabled\nsv_rtv_needed\nsv_serveradmin_message\nsv_scrimmode\n", command, executor)
  5441.         elseif word == 8 then
  5442.             sendresponse("sv_spawn\nsv_give\nsv_spammax\nsv_spamtimeout\nsv_setammo\nsv_setassists", command, executor)
  5443.             sendresponse("sv_setcolor\nsv_setdeaths\nsv_setfrags\nsv_setkills\n", command, executor)
  5444.         elseif word == 9 then
  5445.             sendresponse("sv_setmode\nsv_pass\nsv_setscore\nsv_respawn_time\nsv_setplasmas\nsv_setspeed", command, executor)
  5446.             sendresponse("sv_specs\nsv_mc\nsv_superban\nsv_suspend\n", command, executor)
  5447.         elseif word == 10 then
  5448.             sendresponse("sv_status\nsv_takeweapons\nsv_tbagdet\nsv_test\nsv_textban\nsv_textbanlist", command, executor)
  5449.             sendresponse("sv_textunban\nsv_time_cur\nsv_unbos\nsv_cheat_unhax\n", command, executor)
  5450.         elseif word == 11 then
  5451.             sendresponse("sv_unhide\nsv_ungod\nsv_uninvis\nsv_unmute\nsv_unsuspend\nsv_viewadmins", command, executor)
  5452.             sendresponse("sv_votekick_enabled\nsv_votekick_needed\nsv_votekick_action\nsv_welcomeback_message\n", command, executor)
  5453.         elseif word == 12 then
  5454.             sendresponse("sv_write\nsv_balance\nsv_stickman\nsv_addrcon\nsv_delrcon\nsv_rconlist", command, executor)
  5455.             sendresponse("sv_iprangeban\nsv_iprangeunban\nsv_iprangebanlist\nsv_read", command, executor)
  5456.         elseif word == 13 then
  5457.             sendresponse("sv_load\nsv_unload\nsv_resetplayer\nsv_damage\nsv_hash_duplicates", command, executor)
  5458.             sendresponse("sv_multiteam_vehicles", command, executor)
  5459.         else
  5460.             sendresponse("The commands list is only 13 pages", command, executor)
  5461.         end
  5462.     else
  5463.         sendresponse("Invalid Syntax: " .. command .. " {page}", command, executor)
  5464.     end
  5465. end
  5466.  
  5467. function Command_Lo3(executor, command, count)
  5468.     if count == 1 then
  5469.         if lo3_timer == nil then
  5470.             lo3_timer = registertimer(2000, "lo3Timer")
  5471.         end
  5472.         sendresponse("Live on three.", command, executor)
  5473.     else
  5474.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5475.     end
  5476. end
  5477.  
  5478. function Command_Login(executor, command, username, password, count)
  5479.     if count == 1 and executor ~= nil and next(Admin_Table) == nil and next(Admin_Table) == nil then
  5480.         Temp_Admins[getip(executor)] = true
  5481.         sendresponse("You have successfully logged in, you are now able to use chat commands.", command, executor)
  5482.     elseif executor == nil then
  5483.         sendresponse("The server cannot use this command.", command, executor)
  5484.     elseif next(Admin_Table) ~= nil and next(Admin_Table) ~= nil then
  5485.         sendresponse("This command is currently unavailable", command, executor)
  5486.     else
  5487.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5488.     end
  5489. end
  5490.  
  5491. function Command_Map(executor, command)
  5492.     local args = tokenizecmdstring(command)
  5493.     local count = #args
  5494.     if count > 2 and tonumber(args) == nil then
  5495.         local found = false
  5496.         local arguments = ""
  5497.         for i = 4, #args do
  5498.             if arguments == nil then
  5499.                 arguments = args[i]
  5500.             else
  5501.                 arguments = arguments .. " " .. args[i]
  5502.             end
  5503.             if args[i] == "commands" and args[i] ~= args[1] and args[i] ~= args[2] and args[i] ~= args[3] and not Persistent then
  5504.                 found = true
  5505.             end
  5506.         end
  5507.         if not found then
  5508.             arguments = arguments .. " commands"
  5509.         end
  5510.         arguments = string.gsub(arguments, "  ", " ")
  5511.         if tonumber(arguments) == nil then
  5512.             local response = ""
  5513.             if string.sub(args[1], 1, 2) ~= "sv" then
  5514.                 response = svcmd("sv_map " .. args[2] .. " \"" .. args[3] .. "\" " .. tostring(arguments), true)
  5515.             else
  5516.                 response = svcmd("sv_map " .. args[2] .. " \"" .. args[3] .. "\" " .. tostring(arguments), true)
  5517.             end
  5518.             if response == "" or response == nil then return end
  5519.             sendresponse(response, args[1], executor)
  5520.         else
  5521.             sendresponse("Internal Error Occured Check the Command Script Errors log", args[1], executor)
  5522.             cmderrors("Error Occured at Command_Map")
  5523.         end
  5524.     else
  5525.         sendresponse("Invalid Syntax: " .. args[1] .. " [map] [gametype] {script1} {script2}...", args[1], executor)
  5526.     end
  5527. end
  5528.  
  5529. function Command_Mapnext(executor, command, count)
  5530.     if count == 1 then
  5531.         if executor then
  5532.             svcmdplayer("sv_map_next", executor)
  5533.         else
  5534.             svcmd("sv_map_next", true)
  5535.         end
  5536.     else
  5537.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5538.     end
  5539. end
  5540.  
  5541. function Command_Mapreset(executor, command, count)
  5542.     if count == 1 then
  5543.         sendresponse("The map has been reset", command, executor)
  5544.         svcmd("sv_map_reset")
  5545.     else
  5546.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5547.     end
  5548. end
  5549.  
  5550. function Command_Move(executor, command, player, X, Y, Z, count)
  5551.     if count == 5 then
  5552.         if tonumber(X) and tonumber(Y) and tonumber(Z) then
  5553.             local players = getvalidplayers(player, executor)
  5554.             if players then
  5555.                 for i = 1, #players do
  5556.                     local m_playerObjId = getplayerobjectid(players[i])
  5557.                     if m_playerObjId then
  5558.                         local m_objectId = nil
  5559.                         if isinvehicle(players[i]) then
  5560.                             local m_vehicleId = readdword(getobject(m_playerObjId) + 0x11C)
  5561.                             m_objectId = m_vehicleId
  5562.                         elseif m_playerObjId then
  5563.                             m_objectId = m_playerObjId
  5564.                         end
  5565.                         if m_objectId then
  5566.                             local x, y, z = getobjectcoords(m_objectId)
  5567.                             movobjectcoords(m_objectId, x + X, y + Y, z + Z)
  5568.                             sendresponse(getname(players[i]) .. " has been moved", command, executor)
  5569.                             sendresponse("You have been moved.", "\\", players[i])
  5570.                         end
  5571.                     else
  5572.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  5573.                     end
  5574.                 end
  5575.             else
  5576.                 sendresponse("Error 005: Invalid Player", command, executor)
  5577.             end
  5578.         else
  5579.             sendresponse("They must all be numbers", command, executor)
  5580.         end
  5581.     else
  5582.         sendresponse("Invalid Syntax: " .. command .. " [player] [x] [y] [z]", command, executor)
  5583.     end
  5584. end
  5585.  
  5586. function Command_Mute(executor, command, player, count)
  5587.     if count == 2 then
  5588.         local players = getvalidplayers(player, executor)
  5589.         if players then
  5590.             for i = 1, #players do
  5591.                 local ip = getip(players[i])
  5592.                 local mute
  5593.                 if Admin_Table[gethash(players[i])] or IpAdmins[ip] then
  5594.                     mute = true
  5595.                     sendresponse(getname(players[i]) .. " is an Admin, you cannot mute them", command, executor)
  5596.                     break
  5597.                 end
  5598.                 if not mute then
  5599.                     if not Mute_Table[ip] and not SpamTimeOut_Table[ip] then
  5600.                         Mute_Table[ip] = true
  5601.                         sendresponse(getname(players[i]) .. " was muted by an admin", command, executor)
  5602.                     else
  5603.                         sendresponse(getname(players[i]) .. " has already been muted.", command, executor)
  5604.                     end
  5605.                 else
  5606.                     sendresponse("Admins cannot be muted.", command, executor)
  5607.                 end
  5608.             end
  5609.         else
  5610.             sendresponse("Error 005: Invalid Player", command, executor)
  5611.         end
  5612.     else
  5613.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  5614.     end
  5615. end
  5616.  
  5617. function Command_MultiTeamVehicles(executor, command, boolean, count)
  5618.     if gametype == 2 and not team_play then
  5619.         if count == 1 then
  5620.             if multiteam_vehicles then
  5621.                 sendresponse("Multi Team Vehicles are currently enabled", command, executor)
  5622.             else
  5623.                 sendresponse("Multi Team Vehicles are currently disabled", command, executor)
  5624.             end
  5625.         elseif count == 2 then
  5626.             if (boolean == "1" or boolean == "true") and not multiteam_vehicles then
  5627.                 multiteam_vehicles = true
  5628.                 for i = 0, 15 do
  5629.                     local m_player = getplayer(i)
  5630.                     if m_player then
  5631.                         writebyte(m_player + 0x20, 0)
  5632.                     end
  5633.                 end
  5634.                 sendresponse("Multi Team Vehicles are now enabled", command, executor)
  5635.             elseif (boolean == "1" or boolean == "true") and multiteam_vehicles then
  5636.                 sendresponse("Multi Team Vehicles are already enabled", command, executor)
  5637.             elseif (boolean == "0" or boolean == "false") and multiteam_vehicles or multiteam_vehicles == nil then
  5638.                 multiteam_vehicles = false
  5639.                 for i = 0, 15 do
  5640.                     local m_player = getplayer(i)
  5641.                     if m_player then
  5642.                         writebyte(m_player + 0x20, i)
  5643.                     end
  5644.                 end
  5645.                 sendresponse("Multi Team Vehicles are now disabled", command, executor)
  5646.             elseif (boolean == "0" or boolean == "false") and not multiteam_vehicles then
  5647.                 sendresponse("Multi Team Vehicles are already disabled", command, executor)
  5648.             else
  5649.                 sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  5650.             end
  5651.         else
  5652.             sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  5653.         end
  5654.     else
  5655.         sendresponse("This command is currently disabled for this game", command, executor)
  5656.     end
  5657. end
  5658.  
  5659. function Command_Nameban(executor, command, player, count)
  5660.     if count == 2 and tonumber(command) == nil then
  5661.         local players = getvalidplayers(player, executor, command)
  5662.         if players then
  5663.             for i = 1, #players do
  5664.                 if CheckAccess(executor, command, players[i], getaccess(executor)) then
  5665.                     local name = getname(players[i])
  5666.                     local bool = true
  5667.                     for i = 1, #Name_Bans do
  5668.                         if Name_Bans[i] == name then bool = false break end
  5669.                     end
  5670.                     if bool then
  5671.                         table.insert(Name_Bans, name)
  5672.                         Ipban(players[i])
  5673.                         msg = name .. " has been name banned from the server"
  5674.                         sendresponse(msg, "/", executor)
  5675.                     end
  5676.                 else
  5677.                     local Command = getvalidformat(command)
  5678.                     sendresponse("You cannot execute " .. Command .. " on this admin.", command, executor)
  5679.                     sendresponse(tostring(getname(executor)) .. " attemped to use " .. Command .. " on you", command, players[i])
  5680.                 end
  5681.             end
  5682.         else
  5683.             sendresponse("Error 005: Invalid Player", command, executor)
  5684.         end
  5685.     else
  5686.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  5687.     end
  5688. end
  5689.  
  5690. function Command_Namebanlist(executor, command, count)
  5691.     if count == 1 then
  5692.         if Name_Bans == { } or Name_Bans == nil or #Name_Bans == 0 then
  5693.             sendresponse("There are no names banned from the server.", command, executor)
  5694.             return
  5695.         end
  5696.         for i = 1, #Name_Bans do
  5697.             if Name_Bans[i] then
  5698.                 sendresponse("[" .. i .. "] " .. Name_Bans[i], command, executor)
  5699.             end
  5700.         end
  5701.     else
  5702.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5703.     end
  5704. end
  5705.  
  5706. function Command_Nameunban(executor, command, ID, count)
  5707.     if count == 2 then
  5708.         local ID = tonumber(ID)
  5709.         if Name_Bans[ID] then
  5710.             sendresponse(Name_Bans[ID] .. " is now allowed in the server again.", command, executor)
  5711.             Name_Bans[ID] = nil
  5712.         else
  5713.             sendresponse("That name has not been banned.", command, executor)
  5714.         end
  5715.     else
  5716.         sendresponse("Invalid Syntax: " .. command .. " [ID]", command, executor)
  5717.     end
  5718. end
  5719.  
  5720. function Command_Noweapons(executor, command, boolean, count)
  5721.     if count == 1 then
  5722.         if noweapons then
  5723.             sendresponse("Noweapons mode is currently enabled.", command, executor)
  5724.         else
  5725.             sendresponse("Noweapons mode is currently disabled.", command, executor)
  5726.         end
  5727.     elseif count == 2 then
  5728.         if (boolean == "1" or boolean == "true") and not noweapons then
  5729.             for i = 0, 15 do
  5730.                 if getplayer(i) then
  5731.                     local m_objectId = getplayerobjectid(i)
  5732.                     if m_objectId then
  5733.                         local m_object = getobject(m_objectId)
  5734.                         if m_object then
  5735.                             for j = 0, 3 do
  5736.                                 local weap_id = readdword(m_object + 0x2F8 +(j * 4))
  5737.                                 if getobject(weap_id) then
  5738.                                     destroyobject(weap_id)
  5739.                                 end
  5740.                             end
  5741.                         end
  5742.                     end
  5743.                 end
  5744.             end
  5745.             sendresponse("Noweapons is now on. You cannot pick up weapons.", command, executor)
  5746.             noweapons = true
  5747.         elseif boolean == "1" or boolean == "true" then
  5748.             sendresponse("Noweapons is already enabled", command, executor)
  5749.         elseif boolean ~= "0" and boolean ~= "false" then
  5750.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  5751.         elseif (boolean == "0" or boolean == "false") and noweapons then
  5752.             for i = 0, 15 do
  5753.                 if getplayer(i) and getplayerobjectid(i) then
  5754.                     local ip = getip(i)
  5755.                     if Noweapons[ip] then Noweapons[ip] = nil end
  5756.                     resetweapons(i)
  5757.                 end
  5758.             end
  5759.             sendresponse("Noweapons mode is now off.", command, executor)
  5760.             noweapons = false
  5761.         elseif noweapons == nil then
  5762.             sendresponse("Noweapons mode is now off.", command, executor)
  5763.             noweapons = false
  5764.         elseif boolean == "0" or boolean == "false" then
  5765.             sendresponse("Noweapons is already disabled", command, executor)
  5766.         else
  5767.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  5768.         end
  5769.     else
  5770.         sendresponse("Invalid Syntax: " .. command .. " [boolean]", command, executor)
  5771.     end
  5772. end
  5773.  
  5774. function Command_Nuke(executor, command, player, count)
  5775.     if count == 2 then
  5776.         local players = getvalidplayers(player, executor)
  5777.         if players then
  5778.             for i = 1, #players do
  5779.                 local name = getname(players[i])
  5780.                 local m_objectId = getplayerobjectid(players[i])
  5781.                 if m_objectId ~= nil then
  5782.                     local m_object = getobject(m_objectId)
  5783.                     local x, y, z = getobjectcoords(m_objectId)
  5784.                     for j = 1, 5 do
  5785.                         local nukeproj = createobject(rocket_tag_id, m_objectId, 0, false, x, y, z + 10)
  5786.                         table.insert(nukes, nukeproj)
  5787.                         local m_proj = getobject(nukeproj)
  5788.                         writefloat(m_proj + 0x70, -5)
  5789.                     end
  5790.                 else
  5791.                     sendresponse("You cannot Nuke: " .. name .. " - because he is re-spawning.", command, executor)
  5792.                 end
  5793.             end
  5794.         else
  5795.             sendresponse("Error 005: Invalid Player", command, executor)
  5796.         end
  5797.     else
  5798.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  5799.     end
  5800. end
  5801.  
  5802. function Command_Overshield(executor, command, player, count)
  5803.     if count == 1 and executor ~= nil then
  5804.         local m_playerObjId = getplayerobjectid(executor)
  5805.         if m_playerObjId then
  5806.             local m_object = getobject(m_playerObjId)
  5807.             if m_object then
  5808.                 local obj_shields = readfloat(m_object + 0xE4)
  5809.                 if obj_shields <= 1 then
  5810.                     local m_vehicleId = readdword(m_object + 0x11C)
  5811.                     if m_vehicleId == nil then
  5812.                         local x, y, z = getobjectcoords(m_playerObjId)
  5813.                         local os = createobject(overshield_tag_id, 0, 0, false, x, y, z + 0.5)
  5814.                         if os ~= nil then writefloat(getobject(os) + 0x70, -2) end
  5815.                     else
  5816.                         writefloat(m_object + 0xE4, 3)
  5817.                     end
  5818.                     sendresponse("You have given yourself an Over-Shield", command, executor)
  5819.                 else
  5820.                     sendresponse("You already have an Over-Shield", command, executor)
  5821.                 end
  5822.             else
  5823.                 sendresponse("You are dead", command, executor)
  5824.             end
  5825.         else
  5826.             sendresponse("You are dead", command, executor)
  5827.         end
  5828.     elseif count == 1 and executor == nil then
  5829.         sendresponse("The server cannot have an Over-Shield.", command, executor)
  5830.     elseif count == 2 then
  5831.         local players = getvalidplayers(player, executor)
  5832.         if players then
  5833.             for i = 1, #players do
  5834.                 local m_playerObjId = getplayerobjectid(players[i])
  5835.                 if m_playerObjId then
  5836.                     local m_object = getobject(m_playerObjId)
  5837.                     if m_object then
  5838.                         local obj_shields = readfloat(m_object + 0xE4)
  5839.                         if obj_shields <= 1 then
  5840.                             local m_vehicleId = readdword(m_object + 0x11C)
  5841.                             if m_vehicleId == nil then
  5842.                                 local x, y, z = getobjectcoords(m_playerObjId)
  5843.                                 local os = createobject(overshield_tag_id, 0, 0, false, x, y, z + 0.5)
  5844.                                 if os ~= nil then writefloat(getobject(os) + 0x70, -2) end
  5845.                             else
  5846.                                 writefloat(m_object + 0xE4, 3)
  5847.                             end
  5848.                             sendresponse(getname(players[i]) .. " has been given an Over-Shield", command, executor)
  5849.                         else
  5850.                             sendresponse(getname(players[i]) .. " already has an Over-Shield", command, executor)
  5851.                         end
  5852.                     else
  5853.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  5854.                     end
  5855.                 else
  5856.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  5857.                 end
  5858.             end
  5859.         else
  5860.             sendresponse("Error 005: Invalid Player", command, executor)
  5861.         end
  5862.     else
  5863.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  5864.     end
  5865. end
  5866.  
  5867. function Command_Players(executor, command, count)
  5868.  
  5869.     if count == 1 then
  5870.         sendresponse("Player Search:", command, executor)
  5871.         sendresponse("[ ID.    -    Name.    -    Team.    -    IP.    -    Ping. ]", command, executor)
  5872.         for i = 0, 15 do
  5873.             if getplayer(i) then
  5874.                 local name = getname(i)
  5875.                 local id = resolveplayer(i)
  5876.                 local player_team = getteam(i)
  5877.                 local port = getport(i)
  5878.                 local ip = getip(i)
  5879.                 local hash = gethash(i)
  5880.                 local ping = readword(getplayer(i) + 0xDC)
  5881.                 if team_play then
  5882.                     if player_team == 0 then
  5883.                         player_team = "Red Team"
  5884.                     elseif player_team == 1 then
  5885.                         player_team = "Blue Team"
  5886.                     else
  5887.                         player_team = "Hidden"
  5888.                     end
  5889.                 else
  5890.                     player_team = "FFA"
  5891.                 end
  5892.                 sendresponse(" (" .. id .. ")  " .. name .. "   |   " .. player_team .. "  -  (IP: " .. ip .. ")  -  (Ping: " .. ping .. ")", command, executor)
  5893.             end
  5894.         end
  5895.     else
  5896.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5897.     end
  5898. end
  5899.  
  5900.  
  5901. function Command_PlayersMore(executor, command, count)
  5902.     if count == 1 or count == 2 and t[2] == "more" then
  5903.         sendresponse("[ID - Name -  Team - Status - IP]", command, executor)
  5904.         for i = 0, 15 do
  5905.             if getplayer(i) then
  5906.                 local ip = getip(i)
  5907.                 local player_team = getteam(i)
  5908.                 if team_play then
  5909.                     if player_team == 0 then
  5910.                         player_team = "Red"
  5911.                     elseif player_team == 1 then
  5912.                         player_team = "Blue"
  5913.                     else
  5914.                         player_team = "Hidden"
  5915.                     end
  5916.                 else
  5917.                     player_team = "FFA"
  5918.                 end
  5919.                 if Admin_Table[gethash(i)] or IpAdmins[ip] then
  5920.                     ifadmin = "Admin"
  5921.                 else
  5922.                     ifadmin = "Regular"
  5923.                 end
  5924.                 sendresponse(resolveplayer(i) .. " - " .. getname(i) .. " - " .. player_team .. " - " .. ifadmin .. " - " .. ip, command, executor)
  5925.             end
  5926.         end
  5927.     else
  5928.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5929.     end
  5930. end
  5931.  
  5932. function Command_PrivateMessage(executor, command, boolean, count)
  5933.     if count == 1 then
  5934.         if pm_enabled then
  5935.             sendresponse("Private Messaging is currently on", command, executor)
  5936.         else
  5937.             sendresponse("Private Messaging is currently off", command, executor)
  5938.         end
  5939.     elseif count == 2 then
  5940.         if (boolean == "1" or boolean == "true") and pm_enabled ~= true then
  5941.             pm_enabled = true
  5942.             sendresponse("Private Messaging is now enabled", command, executor)
  5943.         elseif (boolean == "1" or boolean == "true") and pm_enabled == true then
  5944.             sendresponse("Private Messaging is already enabled", command, executor)
  5945.         elseif (boolean == "0" or boolean == "false") and pm_enabled ~= false then
  5946.             pm_enabled = false
  5947.             sendresponse("Private Messaging is now disabled", command, executor)
  5948.         elseif pm_enabled == nil then
  5949.             pm_enabled = false
  5950.             sendresponse("Private Messaging is now disabled", command, executor)
  5951.         elseif (boolean == "0" or boolean == "false") and pm_enabled == false then
  5952.             sendresponse("Private Messaging is already disabled", command, executor)
  5953.         else
  5954.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  5955.         end
  5956.     else
  5957.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  5958.     end
  5959. end
  5960.  
  5961. function Command_Privatesay(executor, args, count)
  5962.     if count >= 3 and tonumber(args[1]) == nil then
  5963.         local players = getvalidplayers(args[2], executor)
  5964.         if players then
  5965.             local message = ""
  5966.             for i = 3, #args do
  5967.                 message = message .. args[i] .. " "
  5968.             end
  5969.             for i = 1, #players do
  5970.                 privateSay(players[i], tostring(message))
  5971.             end
  5972.             sendresponse("Private messages sent.", args[1], executor)
  5973.         else
  5974.             sendresponse("Error 005: Invalid Player", args[1], executor)
  5975.         end
  5976.     else
  5977.         sendresponse("Invalid Syntax: " .. args[1] .. " [player] [message]", args[1], executor)
  5978.     end
  5979. end
  5980.  
  5981. function Command_RconPasswordList(executor, command, count)
  5982.     if count == 1 then
  5983.         local Response = "[rcon] - [level]\n"
  5984.         for k, v in pairs(RCON_PASSWORDS) do
  5985.             if RCON_PASSWORDS[k] ~= nil and RCON_PASSWORDS[k] ~= { } then
  5986.                 for key, value in ipairs(RCON_PASSWORDS[k]) do
  5987.                     Response = Response .. "[ " .. RCON_PASSWORDS[k][key].password .. " ] - [ " .. RCON_PASSWORDS[k][key].level .. " ]\n"
  5988.                 end
  5989.             end
  5990.         end
  5991.         sendresponse(Response, command, executor)
  5992.     else
  5993.         sendresponse("Invalid Syntax: " .. command, command, executor)
  5994.     end
  5995. end
  5996.  
  5997. function Command_Read(executor, command, type, struct, offset, value, player, count)
  5998.     local offset = tonumber(offset)
  5999.     if count > 4 and count < 7 and tonumber(type) == nil and tonumber(struct) == nil and offset then
  6000.         local players = getvalidplayers(player, executor)
  6001.         if players then
  6002.             for i = 1, #players do
  6003.                 local m_objectId = getplayerobjectid(players[i])
  6004.                 if m_objectId then
  6005.                     if struct == "player" then
  6006.                         struct = getplayer(players[i])
  6007.                     elseif struct == "object" then
  6008.                         struct = getobject(m_objectId)
  6009.                         if struct == nil then sendresponse(getname(players[i]) .. " is not alive.", command, executor) return end
  6010.                     elseif getobject(m_objectId) == nil then
  6011.                         sendresponse(getname(players[i]) .. " is not alive.", command, executor)
  6012.                         return
  6013.                     elseif struct == "weapon" then
  6014.                         local m_object = getobject(m_objectId)
  6015.                         struct = getobject(readdword(m_object + 0x118))
  6016.                         if struct == nil then sendresponse(getname(players[i]) .. " is not holding a weapon", command, executor) return end
  6017.                     elseif tonumber(struct) == nil then
  6018.                         sendresponse("Invalid Struct. Valid structs are: player, object, and weapon", command, executor)
  6019.                         return
  6020.                     end
  6021.                 end
  6022.                 if value then
  6023.                     if type == "byte" then
  6024.                         response = tostring(readbyte(struct + offset, value))
  6025.                     elseif type == "float" then
  6026.                         response = tostring(readfloat(struct + offset, value))
  6027.                     elseif type == "word" then
  6028.                         response = tostring(readword(struct + offset, value))
  6029.                     elseif type == "dword" then
  6030.                         response = tostring(readdword(struct + offset, value))
  6031.                     else
  6032.                         sendresponse("Error 010: Invalid Type. Valid types are byte, float, word, and dword", command, executor)
  6033.                         return
  6034.                     end
  6035.                     sendresponse("Reading " .. tostring(value) .. " to struct " .. tostring(struct) .. " at offset " .. tostring(offset) .. " was a success", command, executor)
  6036.                     sendrespose(response, command, executor)
  6037.                 end
  6038.             end
  6039.         else
  6040.             sendresponse("Error 005: Invalid Player", command, executor)
  6041.         end
  6042.     else
  6043.         sendresponse("Invalid Syntax: " .. command .. " [type] [struct] [offset] [value] [player]", command, executor)
  6044.     end
  6045. end
  6046.  
  6047. function Command_ResetPlayer(executor, command, player, count)
  6048.     if count == 2 then
  6049.         local players = getvalidplayers(player, executor)
  6050.         if players then
  6051.             for i = 1, #players do
  6052.                 local ip = getip(players[i])
  6053.                 local m_objectId = getplayerobjectid(players[i])
  6054.                 local m_object
  6055.                 if m_objectId then
  6056.                     m_object = getobject(m_objectId)
  6057.                 end
  6058.                 local id = resolveplayer(players[i])
  6059.                 local m_player = getplayer(players[i])
  6060.                 follow[id] = nil
  6061.                 resetweapons(players[i])
  6062.                 cleanupdrones(players[i])
  6063.                 if m_object then
  6064.                     writefloat(m_object + 0xE0, 1)
  6065.                     writefloat(m_object + 0xE4, 1)
  6066.                 end
  6067.                 writedword(m_player + 0x2C, 0)
  6068.                 Ghost_Table[ip] = nil
  6069.                 mode[ip] = nil
  6070.                 gods[ip] = nil
  6071.                 hidden[id] = nil
  6072.                 hidden[id] = nil
  6073.                 Noweapons[ip] = nil
  6074.                 for j = 1, 16 do
  6075.                     for k = 1, 16 do
  6076.                         if Control_Table[j][k] == players[i] then
  6077.                             Control_Table[j][k] = nil
  6078.                             bool = true
  6079.                             break
  6080.                         end
  6081.                     end
  6082.                     if bool then
  6083.                         break
  6084.                     end
  6085.                 end
  6086.                 sendresponse(getname(players[i]) .. " has been reset.", command, executor)
  6087.             end
  6088.         end
  6089.     else
  6090.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  6091.     end
  6092. end
  6093.  
  6094. function Command_Resetweapons(executor, command, player, count)
  6095.     if count == 2 then
  6096.         local players = getvalidplayers(player, executor)
  6097.         if players then
  6098.             for i = 1, #players do
  6099.                 local ip = getip(players[i])
  6100.                 if ip then
  6101.                     if Noweapons[ip] then
  6102.                         Noweapons[ip] = nil
  6103.                         local m_objectId = getplayerobjectid(players[i])
  6104.                         if m_objectId then
  6105.                             local m_object = getobject(m_objectId)
  6106.                             if m_object then
  6107.                                 resetweapons(players[i])
  6108.                                 sendresponse(getname(players[i]) .. " had their weapons reset", command, executor)
  6109.                             end
  6110.                         end
  6111.                     else
  6112.                         sendresponse(getname(players[i]) .. " never had their weapons taken away", command, executor)
  6113.                     end
  6114.                 end
  6115.             end
  6116.         else
  6117.             sendresponse("Error 005: Invalid Player", command, executor)
  6118.         end
  6119.     else
  6120.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  6121.     end
  6122. end
  6123.  
  6124. function Command_Resp(executor, command, player, time, count)
  6125.     if count == 3 and tonumber(time) then
  6126.         local players = getvalidplayers(player, executor)
  6127.         if players then
  6128.             for i = 1, #players do
  6129.                 local m_player = getplayer(players[i])
  6130.                 local m_objectId = getplayerobjectid(players[i])
  6131.                 if m_objectId == nil then
  6132.                     writedword(m_player + 0x2c, time * 33)
  6133.                     sendresponse("Setting " .. getname(players[i]) .. "'s re-spawn time to " .. time .. " seconds", command, executor)
  6134.                 else
  6135.                     sendresponse(getname(players[i]) .. " is alive. You cannot execute this command on him.", command, executor)
  6136.                 end
  6137.             end
  6138.         else
  6139.             sendresponse("Error 005: Invalid Player", command, executor)
  6140.         end
  6141.     else
  6142.         sendresponse("Invalid Syntax: " .. command .. " [player] [time]", command, executor)
  6143.     end
  6144. end
  6145.  
  6146. function Command_RTVEnabled(executor, command, boolean, count)
  6147.     if count == 1 then
  6148.         if rockthevote then
  6149.             sendresponse("RockTheVote is currently on", command, executor)
  6150.         else
  6151.             sendresponse("RockTheVote is currently off", command, executor)
  6152.         end
  6153.     elseif count == 2 then
  6154.         if (boolean == "1" or boolean == "true") and rockthevote ~= true then
  6155.             rockthevote = true
  6156.             if rtv_required == nil then
  6157.                 rtv_required = 0.6
  6158.             end
  6159.             sendresponse("RockTheVote is now enabled The default percentage needed is 60%.", command, executor)
  6160.             sendresponse("Change this with sv_rtv_needed", command, executor)
  6161.         elseif (boolean == "1" or boolean == "true") and rockthevote == true then
  6162.             sendresponse("RockTheVote is already enabled", command, executor)
  6163.         elseif (boolean == "0" or boolean == "false") and rockthevote ~= false then
  6164.             rockthevote = false
  6165.             sendresponse("RockTheVote is now disabled", command, executor)
  6166.         elseif rockthevote == nil then
  6167.             rockthevote = false
  6168.             sendresponse("RockTheVote is now disabled", command, executor)
  6169.         elseif (boolean == "0" or boolean == "false") and rockthevote == false then
  6170.             sendresponse("RockTheVote is already disabled", command, executor)
  6171.         else
  6172.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  6173.         end
  6174.     else
  6175.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  6176.     end
  6177. end
  6178.  
  6179. function Command_RTVRequired(executor, command, percent, count)
  6180.     if count == 1 then
  6181.         if rtv_required == nil then rtv_required = 0.6 end
  6182.         sendresponse(tostring(rtv_required * 100) .. "% votes required for RTV", command, executor)
  6183.     elseif count == 2 and tonumber(percent) then
  6184.         if tonumber(percent) <= 1 then
  6185.             sendresponse("Votes required for RTV has been set to " .. tonumber(percent) * 100 .. "%", command, executor)
  6186.             rtv_required = tonumber(percent)
  6187.         end
  6188.     else
  6189.         sendresponse("Invalid Syntax: " .. command .. " [votes required (as a decimal)]", command, executor)
  6190.     end
  6191. end
  6192.  
  6193. function Command_SAMessage(executor, command, boolean, count)
  6194.     if count == 1 then
  6195.         if sa_message then
  6196.             sendresponse("Server Admin Message is currently on", command, executor)
  6197.         else
  6198.             sendresponse("Server Admin Message is currently off", command, executor)
  6199.         end
  6200.     elseif count == 2 then
  6201.         if (boolean == "1" or boolean == "true") and sa_message ~= true then
  6202.             sa_message = true
  6203.             sendresponse("Server Admin Message is now enabled", command, executor)
  6204.         elseif (boolean == "1" or boolean == "true") and sa_message == true then
  6205.             sendresponse("Server Admin Message is already enabled", command, executor)
  6206.         elseif (boolean == "0" or boolean == "false") and sa_message ~= false then
  6207.             sa_message = false
  6208.             sendresponse("Server Admin Message is now disabled", command, executor)
  6209.         elseif sa_message == nil then
  6210.             sa_message = false
  6211.             sendresponse("Server Admin Message is now disabled", command, executor)
  6212.         elseif (boolean == "0" or boolean == "false") and sa_message == false then
  6213.             sendresponse("Server Admin Message is already disabled", command, executor)
  6214.         else
  6215.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  6216.         end
  6217.     else
  6218.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  6219.     end
  6220. end
  6221.  
  6222. function Command_Say(executor, arg, count)
  6223.     if count >= 2 then
  6224.         local message = ""
  6225.         for i = 2, #arg do
  6226.             message = message .. arg[i] .. " "
  6227.         end
  6228.         Say("** SERVER ** " .. message, 5)
  6229.         sendresponse("Server Message Sent:", arg[1], executor)
  6230.         sendresponse(message, arg[1], executor)
  6231.     else
  6232.         sendresponse("Invalid Syntax: " .. arg[1] .. " [message]", arg[1], exectuor)
  6233.     end
  6234. end
  6235.  
  6236. function Command_ScrimMode(executor, command, boolean, count)
  6237.     if count == 1 then
  6238.         if Scrim_Mode then
  6239.             sendresponse("Scrim Mode is currently on", command, executor)
  6240.         else
  6241.             sendresponse("Scrim Mode is currently off", command, executor)
  6242.         end
  6243.     elseif count == 2 then
  6244.         if (boolean == "1" or boolean == "true") and Scrim_Mode ~= true then
  6245.             Scrim_Mode = true
  6246.             falldamage = true
  6247.             deathless = false
  6248.             for i = 0, 15 do
  6249.                 if getplayer(i) and getplayerobjectid(i) then
  6250.                     local ip = getip(i)
  6251.                     local m_objectId = getplayerobjectid(i)
  6252.                     local m_object
  6253.                     if m_objectId then
  6254.                         m_object = getobject(m_objectId)
  6255.                     end
  6256.                     local id = resolveplayer(i)
  6257.                     local m_player = getplayer(i)
  6258.                     follow[id] = nil
  6259.                     resetweapons(i)
  6260.                     cleanupdrones(i)
  6261.                     dmgmultiplier[ip] = 1.0
  6262.                     if m_object then
  6263.                         writefloat(m_object + 0xE0, 1)
  6264.                         writefloat(m_object + 0xE4, 1)
  6265.                     end
  6266.                     writedword(m_player + 0x2C, 0)
  6267.                     Ghost_Table[ip] = nil
  6268.                     mode[ip] = nil
  6269.                     gods[ip] = nil
  6270.                     hidden[id] = nil
  6271.                     hidden[id] = nil
  6272.                     if Noweapons[ip] then Noweapons[ip] = nil end
  6273.                     if infammo then
  6274.                         kill(i)
  6275.                     end
  6276.                 end
  6277.             end
  6278.             for i = 0, 15 do
  6279.                 for j = 1, 16 do
  6280.                     if Control_Table[j] then
  6281.                         for k = 1, 16 do
  6282.                             if Control_Table[j][k] == i then
  6283.                                 Control_Table[j][k] = nil
  6284.                                 bool = true
  6285.                                 break
  6286.                             end
  6287.                         end
  6288.                     end
  6289.                     if bool then
  6290.                         break
  6291.                     end
  6292.                 end
  6293.             end
  6294.             infammo = false
  6295.             Control_Table = { }
  6296.             follow = { }
  6297.             hidden = { }
  6298.             gods = { }
  6299.             Ghost_Table = { }
  6300.             mode = { }
  6301.             Noweapons = { }
  6302.             nukes = { }
  6303.             objects = { }
  6304.             objspawnid = { }
  6305.             Suspend_Table = { }
  6306.             Vehicle_Drone_Table = { }
  6307.             sendresponse("Scrim Mode is now enabled", command, executor)
  6308.         elseif (boolean == "1" or boolean == "true") and Scrim_Mode == true then
  6309.             sendresponse("Scrim Mode is already enabled", command, executor)
  6310.         elseif (boolean == "0" or boolean == "false") and Scrim_Mode ~= false then
  6311.             Scrim_Mode = false
  6312.             sendresponse("Scrim Mode is now disabled", command, executor)
  6313.         elseif Scrim_Mode == nil then
  6314.             Scrim_Mode = false
  6315.             sendresponse("Scrim Mode is now disabled", command, executor)
  6316.         elseif (boolean == "0" or boolean == "false") and Scrim_Mode == false then
  6317.             sendresponse("Scrim Mode is already disabled", command, executor)
  6318.         else
  6319.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  6320.         end
  6321.     else
  6322.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  6323.     end
  6324. end
  6325.  
  6326. function Command_ScriptLoad(executor, command, count)
  6327.     if count >= 1 then
  6328.         local arg = tokenizecmdstring(command)
  6329.         command = "sv_script_load"
  6330.         for i = 2, #arg do
  6331.             command = command .. " " .. arg[i]
  6332.         end
  6333.         if executor then
  6334.             svcmdplayer(command, executor)
  6335.         else
  6336.             response = svcmd(command)
  6337.             sendresponse(response, arg[1], executor)
  6338.         end
  6339.     end
  6340. end
  6341.  
  6342. function Command_ScriptUnload(executor, command, count)
  6343.     if count >= 1 then
  6344.         local arg = tokenizecmdstring(command)
  6345.         command = "sv_script_unload"
  6346.         for i = 2, #arg do
  6347.             if arg[i] ~= "commands" and arg[i] ~= "command" and arg[i] ~= "cmd" and arg[i] ~= "cmds" then
  6348.                 command = command .. " " .. arg[i]
  6349.             end
  6350.         end
  6351.         if executor then
  6352.             svcmdplayer(command, executor)
  6353.         else
  6354.             response = svcmd(command)
  6355.             sendresponse(response, arg[1], executor)
  6356.         end
  6357.     end
  6358. end
  6359.  
  6360. function Command_Setammo(executor, command, player, type, ammo, count)
  6361.     if count == 4 and tonumber(ammo) then
  6362.         local players = getvalidplayers(player, executor)
  6363.         if players then
  6364.             for i = 1, #players do
  6365.                 local m_objectId = getplayerobjectid(players[i])
  6366.                 if m_objectId then
  6367.                     local m_object = getobject(m_objectId)
  6368.                     if m_object then
  6369.                         local m_weaponId = readdword(m_object + 0x118)
  6370.                         if m_weaponId then
  6371.                             local m_weapon = getobject(m_weaponId)
  6372.                             if m_weapon then
  6373.                                 if type == "unloaded" or type == "1" then
  6374.                                     writedword(m_weapon + 0x2B6, tonumber(ammo))
  6375.                                     sendresponse(getname(players[i]) .. " had their unloaded ammo changed to " .. ammo, command, executor)
  6376.                                 elseif type == "2" or type == "loaded" then
  6377.                                     writedword(m_weapon + 0x2B8, tonumber(ammo))
  6378.                                     updateammo(m_weaponId)
  6379.                                     sendresponse(getname(players[i]) .. " had their loaded ammo changed to " .. ammo, command, executor)
  6380.                                 else
  6381.                                     sendresponse("Error 010: Invalid Type: 1 for unloaded, 2 for loaded ammo", command, executor)
  6382.                                 end
  6383.                             else
  6384.                                 sendresponse(getname(players[i]) .. " is not holding any weapons", command, executor)
  6385.                             end
  6386.                         else
  6387.                             sendresponse(getname(players[i]) .. " is not holding any weapons", command, executor)
  6388.                         end
  6389.                     else
  6390.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  6391.                     end
  6392.                 else
  6393.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  6394.                 end
  6395.             end
  6396.         else
  6397.             sendresponse("Error 005: Invalid Player", command, executor)
  6398.         end
  6399.     else
  6400.         sendresponse("Invalid Syntax: " .. command .. " [player] [type] [ammo]", command, executor)
  6401.     end
  6402. end
  6403.  
  6404. function Command_Setassists(executor, command, player, assists, count)
  6405.     if count == 3 and tonumber(assists) then
  6406.         local players = getvalidplayers(player, executor)
  6407.         if players then
  6408.             for i = 1, #players do
  6409.                 local m_player = getplayer(players[i])
  6410.                 local Assists = tonumber(assists)
  6411.                 if Assists > 0x7FFF then
  6412.                     writewordsigned(m_player + 0xA4, 0x7FFF)
  6413.                 elseif Assists < -0x7FFF then
  6414.                     writewordsigned(m_player + 0xA4, -0x7FFF)
  6415.                 else
  6416.                     writewordsigned(m_player + 0xA4, Assists)
  6417.                 end
  6418.                 sendresponse(getname(players[i]) .. " had their assists set to " .. assists, command, executor)
  6419.             end
  6420.         else
  6421.             sendresponse("Error 005: Invalid Player", command, executor)
  6422.         end
  6423.     else
  6424.         sendresponse("Invalid Syntax: " .. command .. " [player] [assists]", command, executor)
  6425.     end
  6426. end
  6427.  
  6428. function Command_Setcolor(executor, command, player, color, count)
  6429.     if count == 2 then
  6430.         local players = getvalidplayers(player, executor)
  6431.         if players then
  6432.             for i = 1, #players do
  6433.                 sendresponse(getname(players[i]) .. " is currently " .. getcolor(players[i]), command, executor)
  6434.             end
  6435.         else
  6436.             sendresponse("Error 005: Invalid Player", command, executor)
  6437.         end
  6438.     elseif count == 3 then
  6439.         local players = getvalidplayers(player, executor)
  6440.         if players then
  6441.             for i = 1, #players do
  6442.                 local m_player = getplayer(players[i])
  6443.                 local m_objectId = getplayerobjectid(players[i])
  6444.                 if m_objectId then
  6445.                     local x, y, z = getobjectcoords(m_objectId)
  6446.                     if color == "white" then
  6447.                         writebyte(m_player + 0x60, 0)
  6448.                     elseif color == "black" then
  6449.                         writebyte(m_player + 0x60, 1)
  6450.                     elseif color == "red" then
  6451.                         writebyte(m_player + 0x60, 2)
  6452.                     elseif color == "blue" then
  6453.                         writebyte(m_player + 0x60, 3)
  6454.                     elseif color == "gray" then
  6455.                         writebyte(m_player + 0x60, 4)
  6456.                     elseif color == "yellow" then
  6457.                         writebyte(m_player + 0x60, 5)
  6458.                     elseif color == "green" then
  6459.                         writebyte(m_player + 0x60, 6)
  6460.                     elseif color == "pink" then
  6461.                         writebyte(m_player + 0x60, 7)
  6462.                     elseif color == "purple" then
  6463.                         writebyte(m_player + 0x60, 8)
  6464.                     elseif color == "cyan" then
  6465.                         writebyte(m_player + 0x60, 9)
  6466.                     elseif color == "cobalt" then
  6467.                         writebyte(m_player + 0x60, 10)
  6468.                     elseif color == "orange" then
  6469.                         writebyte(m_player + 0x60, 11)
  6470.                     elseif color == "teal" then
  6471.                         writebyte(m_player + 0x60, 12)
  6472.                     elseif color == "sage" then
  6473.                         writebyte(m_player + 0x60, 13)
  6474.                     elseif color == "brown" then
  6475.                         writebyte(m_player + 0x60, 14)
  6476.                     elseif color == "tan" then
  6477.                         writebyte(m_player + 0x60, 15)
  6478.                     elseif color == "maroon" then
  6479.                         writebyte(m_player + 0x60, 16)
  6480.                     elseif color == "salmon" then
  6481.                         writebyte(m_player + 0x60, 17)
  6482.                     else
  6483.                         sendresponse("Invalid Color", command, executor)
  6484.                         return
  6485.                     end
  6486.                     sendresponse(getname(players[i]) .. " had their color changed to " .. color .. "", command, executor)
  6487.                     if m_objectId ~= nil then
  6488.                         destroyobject(m_objectId)
  6489.                         if colorspawn == nil then colorspawn = { } end
  6490.                         if colorspawn[players[i]] == nil then colorspawn[players[i]] = { } end
  6491.                         colorspawn[players[i]][1] = x
  6492.                         colorspawn[players[i]][2] = y
  6493.                         colorspawn[players[i]][3] = z
  6494.                     end
  6495.                 end
  6496.             end
  6497.         else
  6498.             sendresponse("Error 005: Invalid Player", command, executor)
  6499.         end
  6500.     else
  6501.         sendresponse("Invalid Syntax: " .. command .. " [player] {color}", command, executor)
  6502.     end
  6503. end
  6504.  
  6505. function Command_Setdeaths(executor, command, player, deaths, count)
  6506.     if count == 3 and tonumber(deaths) then
  6507.         local players = getvalidplayers(player, executor)
  6508.         if players then
  6509.             for i = 1, #players do
  6510.                 local m_player = getplayer(players[i])
  6511.                 Deaths = tonumber(deaths)
  6512.                 if Deaths > 0x7FFF then
  6513.                     writewordsigned(m_player + 0xAE, 0x7FFF)
  6514.                 elseif Deaths < -0x7FFF then
  6515.                     writewordsigned(m_player + 0xAE, -0x7FFF)
  6516.                 else
  6517.                     writewordsigned(m_player + 0xAE, Deaths)
  6518.                 end
  6519.                 sendresponse(getname(players[i]) .. " had their deaths set to " .. deaths, command, executor)
  6520.             end
  6521.         else
  6522.             sendresponse("Error 005: Invalid Player", command, executor)
  6523.         end
  6524.     else
  6525.         sendresponse("Invalid Syntax: " .. command .. " [player] [deaths]", command, executor)
  6526.     end
  6527. end
  6528.  
  6529. function Command_Setfrags(executor, command, player, frags, count)
  6530.     if count == 3 and tonumber(frags) then
  6531.         local players = getvalidplayers(player, executor)
  6532.         if players then
  6533.             for i = 1, #players do
  6534.                 local m_objectId = getplayerobjectid(players[i])
  6535.                 if m_objectId then
  6536.                     local m_object = getobject(m_objectId)
  6537.                     if m_object then
  6538.                         if tonumber(frags) <= 255 then
  6539.                             writebyte(m_object + 0x31E, frags)
  6540.                             sendresponse("Setting " .. getname(players[i]) .. "'s frag grenades to " .. frags, command, executor)
  6541.                             sendresponse("Your frag grenades were set to " .. frags, command, players[i])
  6542.                         else
  6543.                             writebyte(m_object + 0x31E, 255)
  6544.                             sendresponse("Setting " .. getname(players[i]) .. "'s frag grenades to " .. frags, command, executor)
  6545.                             sendresponse("Your frag grenades were set to " .. frags, command, players[i])
  6546.                         end
  6547.                     else
  6548.                         sendresponse(getname(players[i]) .. " is dead", command, executor)
  6549.                     end
  6550.                 else
  6551.                     sendresponse(getname(players[i]) .. " is dead", command, executor)
  6552.                 end
  6553.             end
  6554.         else
  6555.             sendresponse("Error 005: Invalid Player", command, executor)
  6556.         end
  6557.     else
  6558.         sendresponse("Invalid Syntax: " .. command .. " [player] [amount]", command, executor)
  6559.     end
  6560. end
  6561.  
  6562. function Command_Setkills(executor, command, player, kills, count)
  6563.     if count == 3 then
  6564.         local players = getvalidplayers(player, executor)
  6565.         if players then
  6566.             for i = 1, #players do
  6567.                 local m_player = getplayer(players[i])
  6568.                 kills = tonumber(kills)
  6569.                 if kills > 0x7FFF then
  6570.                     writewordsigned(m_player + 0x9C, 0x7FFF)
  6571.                 elseif kills < -0x7FFF then
  6572.                     writewordsigned(m_player + 0x9C, -0x7FFF)
  6573.                 else
  6574.                     writewordsigned(m_player + 0x9C, kills)
  6575.                 end
  6576.                 sendresponse(getname(players[i]) .. " had their kills set to " .. kills, command, executor)
  6577.             end
  6578.         else
  6579.             sendresponse("Error 005: Invalid Player", command, executor)
  6580.         end
  6581.     else
  6582.         sendresponse("Invalid Syntax: " .. command .. " [player] [kills]", command, executor)
  6583.     end
  6584. end
  6585.  
  6586. function Command_Setmode(executor, command, player, Mode, object, count)
  6587.     if player == nil then
  6588.         sendresponse("Invalid Syntax: " .. command .. " [player] [mode] {object (for SpawnGun only)}", command, executor)
  6589.         return
  6590.     end
  6591.     local players = getvalidplayers(player, executor)
  6592.     if players then
  6593.         if count == 3 then
  6594.             for i = 1, #players do
  6595.                 if Mode == "destroy" then
  6596.                     mode[getip(players[i])] = "destroy"
  6597.                     sendresponse(getname(players[i]) .. " is now in (destroy) mode", command, executor)
  6598.                 elseif Mode == "portalgun" then
  6599.                     mode[getip(players[i])] = "portalgun"
  6600.                     sendresponse(getname(players[i]) .. " is now in (PortalGun) mode", command, executor)
  6601.                 elseif Mode == "entergun" then
  6602.                     mode[getip(players[i])] = "entergun"
  6603.                     sendresponse(getname(players[i]) .. " is now in (EnterGun) mode", command, executor)
  6604.                 elseif Mode == "normal" or Mode == "none" or Mode == "regular" then
  6605.                     objspawnid[getip(players[i])] = nil
  6606.                     mode[getip(players[i])] = nil
  6607.                     sendresponse(getname(players[i]) .. " is now in normal mode", command, executor)
  6608.                 elseif Mode == "gravitygun" then
  6609.                     mode[gethash(players[i])] = "gravitygun"
  6610.                     sendresponse(getname(players[i]) .. " is now in (GravityGun) mode\n It is recommended to use a Single-Projectile Weapon, i.e (sniper,pistol,plasma - pistol/rifle ect)", command, executor)
  6611.                 else
  6612.                     sendresponse("Invalid Mode!\n(1): Destroy\n(2): PortalGun\n(3) EnterGun\n(4): SpawnGun\n(5): GravityGun\n(6): Normal", command, executor)
  6613.                 end
  6614.             end
  6615.         elseif count == 4 then
  6616.             for i = 1, #players do
  6617.                 if Mode == "spawngun" then
  6618.                     local objexists = false
  6619.                     objspawnid[getip(players[i])] = nil
  6620.                     mode[getip(players[i])] = nil
  6621.                     for j = 1, #objects do
  6622.                         if object == objects[j][1] then
  6623.                             mode[getip(players[i])] = "spawngun"
  6624.                             objspawnid[getip(players[i])] = objects[j][3]
  6625.                             sendresponse(getname(players[i]) .. " is now spawning " .. objects[j][1] .. "", command, executor)
  6626.                             objexists = true
  6627.                             break
  6628.                         end
  6629.                     end
  6630.                     if objexists == false then
  6631.                         sendresponse("Object does not exist. Make sure you are spelling it right.", command, executor)
  6632.                     end
  6633.                 end
  6634.             end
  6635.         else
  6636.             --      Invalid Syntax <command> [player] [mode] {object}
  6637.             --  Invalid Mode!
  6638.             --  (1) Destroy
  6639.             --  (2) PortalGun
  6640.             --  (3) EnterGun
  6641.             --  (4) SpawnGun
  6642.             --  (5) GravityGun
  6643.             --  (6) Normal
  6644.  
  6645.             sendresponse("Invalid Syntax: " .. command .. " [player] [mode] {object}", command, executor)
  6646.             sendresponse("Invalid Mode!\n(1): Destroy\n(2): PortalGun\n(3) EnterGun\n(4): SpawnGun\n(5): GravityGun\n(6): Normal", command, executor)
  6647.         end
  6648.     else
  6649.         sendresponse("Error 005: Invalid Player", command, executor)
  6650.     end
  6651. end
  6652.  
  6653. function Command_Setpassword(executor, command, password, count)
  6654.     if count == 1 then
  6655.         local response = svcmd("sv_password", true)
  6656.         if response then
  6657.             sendresponse(response, command, executor)
  6658.         else
  6659.             sendresponse("Critical Error: " .. passwrd .. "'", command, executor)
  6660.         end
  6661.     elseif count == 2 then
  6662.         if password == "" then
  6663.             svcmd('sv_password ""')
  6664.             sendresponse("Password has been taken off", command, executor)
  6665.             passwrd = nil
  6666.         elseif passwrd then
  6667.             svcmd('sv_password ' .. password)
  6668.             sendresponse("The password is now " .. password, command, executor)
  6669.             passwrd = password
  6670.         else
  6671.             sendresponse("Internal Error Occurred. Check the Command Script Errors log", command, executor)
  6672.             cmderrors("Error Occurred at Command_Setpassword")
  6673.         end
  6674.     else
  6675.         sendresponse("Invalid Syntax: " .. command .. " {password}", command, executor)
  6676.     end
  6677. end
  6678.  
  6679. function Command_Setplasmas(executor, command, player, plasmas, count)
  6680.     if count == 3 and tonumber(plasmas) then
  6681.         local players = getvalidplayers(player, executor)
  6682.         if players then
  6683.             for i = 1, #players do
  6684.                 local m_objectId = getplayerobjectid(players[i])
  6685.                 if m_objectId then
  6686.                     local m_object = getobject(m_objectId)
  6687.                     if m_object then
  6688.                         if tonumber(plasmas) <= 255 then
  6689.                             writebyte(m_object + 0x31F, tonumber(plasmas))
  6690.                             sendresponse("Setting " .. getname(players[i]) .. "'s plasma grenades to: " .. plasmas, command, executor)
  6691.                             sendresponse("Your plasma grenades were set to: " .. plasmas, command, players[i])
  6692.                         else
  6693.                             writebyte(m_object + 0x31F, 255)
  6694.                             sendresponse("Setting " .. getname(players[i]) .. "'s plasma grenades to " .. plasmas, command, executor)
  6695.                             sendresponse("Your plasma grenades were set to: " .. plasmas, command, players[i])
  6696.                         end
  6697.                     else
  6698.                         sendresponse(getname(players[i]) .. " is dead!", command, executor)
  6699.                     end
  6700.                 else
  6701.                     sendresponse(getname(players[i]) .. " is dead!", command, executor)
  6702.                 end
  6703.             end
  6704.         else
  6705.             sendresponse("Error 005: Invalid Player", command, executor)
  6706.         end
  6707.     else
  6708.         sendresponse("Invalid Syntax: sv_setplasmas [player] [amount]", command, executor)
  6709.     end
  6710. end
  6711.  
  6712. function Command_Setresp(executor, command, time, count)
  6713.     if count == 2 then
  6714.         if time == "default" then
  6715.             respset = false
  6716.             sendresponse("Re-Spawn time set to the Game Type's default setting", command, executor)
  6717.         elseif tonumber(time) then
  6718.             resptime = time
  6719.             respset = true
  6720.             sendresponse("Re-Spawn time set to " .. time .. " seconds", command, executor)
  6721.         elseif respset == nil then
  6722.             sendresponse("Re-Spawn time not set. Defaulting to Game Type's default setting.", command, executor)
  6723.         else
  6724.             sendresponse("Invalid Syntax: " .. command .. " [seconds]", command, executor)
  6725.         end
  6726.     else
  6727.         sendresponse("Invalid Syntax: " .. command .. " [seconds]", command, executor)
  6728.     end
  6729. end
  6730.  
  6731. function Command_Setscore(executor, command, player, score, count)
  6732.     if count == 3 and tonumber(score) then
  6733.         local players = getvalidplayers(player, executor)
  6734.         if players then
  6735.             for i = 1, #players do
  6736.                 setscore(players[i], tonumber(score))
  6737.                 sendresponse(getname(players[i]) .. " had their score set to " .. score .. "", command, executor)
  6738.             end
  6739.         else
  6740.             sendresponse("Error 005: Invalid Player", command, executor)
  6741.         end
  6742.     else
  6743.         sendresponse("Invalid Syntax: " .. command .. " [player] [score]", command, executor)
  6744.     end
  6745. end
  6746.  
  6747. function Command_Setspeed(executor, command, player, speed, count)
  6748.     if count == 2 then
  6749.         local players = getvalidplayers(player, executor)
  6750.         if players then
  6751.             for i = 1, #players do
  6752.                 local m_player = getplayer(players[i])
  6753.                 local cur_speed = readfloat(m_player + 0x6C)
  6754.                 sendresponse(getname(players[i]) .. "'s speed is currently " .. cur_speed, command, executor)
  6755.             end
  6756.         else
  6757.             sendresponse("Error 005: Invalid Player", command, executor)
  6758.         end
  6759.     elseif count == 3 and tonumber(speed) then
  6760.         local players = getvalidplayers(player, executor)
  6761.         if players then
  6762.             for i = 1, #players do
  6763.                 setspeed(players[i], tonumber(speed))
  6764.                 sendresponse(getname(players[i]) .. " had their speed changed to " .. speed, command, executor)
  6765.             end
  6766.         else
  6767.             sendresponse("Error 005: Invalid Player", command, executor)
  6768.         end
  6769.     else
  6770.         sendresponse("Invalid Syntax: " .. command .. " [player] {speed}", command, executor)
  6771.     end
  6772. end
  6773.  
  6774. function Command_Setteleport(executor, command, locname, player, count)
  6775.     if count == 2 then
  6776.         response = false
  6777.         sendresponse("Invalid Syntax: " .. command .. " [locname] [player]", command, executor)
  6778.     elseif count == 3 then
  6779.         local players = getvalidplayers(player, executor)
  6780.         if players then
  6781.             for i = 1, #players do
  6782.                 local m_objectId = getplayerobjectid(players[i])
  6783.                 if m_objectId then
  6784.                     if getobject(m_objectId) then
  6785.                         svcmdplayer("sv_teleport_add " .. tostring(locname), players[i])
  6786.                         if string.find(response, "corresponds") then
  6787.                             sendresponse("Teleport location " .. locname .. " now corresponds to: " .. getname(players[i]) .. "'s location", command, executor)
  6788.                         else
  6789.                             say(tostring(response))
  6790.                             sendresponse(locname .. " is already added", command, executor)
  6791.                         end
  6792.                     else
  6793.                         sendresponse("Cannot add Teleport because the player is dead!", command, executor)
  6794.                     end
  6795.                 else
  6796.                     sendresponse("Cannot add Teleport because the player is dead!", command, executor)
  6797.                 end
  6798.             end
  6799.         else
  6800.             sendresponse("Error 005: Invalid Player", command, executor)
  6801.         end
  6802.     else
  6803.         sendresponse("Invalid Syntax: " .. command .. " [locname] [player]", command, executor)
  6804.     end
  6805. end
  6806.  
  6807. function Command_TeleportList(executor, command, count)
  6808.     if count == 2 then
  6809.         local response = svcmd("sv_teleport_list", true)
  6810.         sendresponse(tostring(response), command, executor)
  6811.     end
  6812. end
  6813.  
  6814. function Command_Spawn(executor, command, object, player, amount, resptime, recycle, type, count)
  6815.     local bool = true
  6816.     if type == "enter" then
  6817.         if count == 2 then
  6818.             if executor ~= nil then
  6819.                 player = resolveplayer(executor)
  6820.             else
  6821.                 sendresponse("ATTENTION - You cannot spawn a Vehicle at the Server's location...", command, executor)
  6822.                 return
  6823.             end
  6824.         elseif count == 3 then
  6825.             if string.lower(player) == "me" and executor ~= nil then
  6826.                 player = resolveplayer(executor)
  6827.             end
  6828.         else
  6829.             sendresponse("Invalid Syntax: " .. command .. " [vehicle] {player}", command, executor)
  6830.             return
  6831.         end
  6832.         message = command .. " " .. object .. " " .. player
  6833.     elseif type == "give" then
  6834.         if count == 2 then
  6835.             if executor ~= nil then
  6836.                 player = resolveplayer(executor)
  6837.             else
  6838.                 sendresponse("ATTENTION - You cannot spawn a Weapon at the Server's location...", command, executor)
  6839.                 return
  6840.             end
  6841.         elseif count == 3 then
  6842.             if string.lower(player) == "me" and executor ~= nil then
  6843.                 player = resolveplayer(executor)
  6844.             end
  6845.         else
  6846.             sendresponse("Invalid Syntax: " .. command .. " [weapon] {player}", command, executor)
  6847.             return
  6848.         end
  6849.         message = command .. " " .. object .. " " .. player
  6850.     elseif type == "spawn" then
  6851.         if object then
  6852.             if count == 2 then
  6853.                 if executor ~= nil then
  6854.                     message = command .. " " .. object .. " " .. resolveplayer(executor)
  6855.                 else
  6856.                     sendresponse("ATTENTION - You cannot spawn an object at the Server's location...", command, executor)
  6857.                     return
  6858.                 end
  6859.             elseif count == 3 then
  6860.                 if string.lower(player) == "me" and executor ~= nil then
  6861.                     player = resolveplayer(executor)
  6862.                 end
  6863.                 message = command .. " " .. object .. " " .. player
  6864.             elseif count == 4 then
  6865.                 message = command .. " " .. object .. " " .. player .. " " .. amount
  6866.             elseif count == 5 then
  6867.                 message = command .. " " .. object .. " " .. player .. " " .. amount .. " " .. resptime
  6868.             elseif count == 6 then
  6869.                 message = command .. " " .. object .. " " .. player .. " " .. amount .. " " .. resptime .. " " .. recycle
  6870.             else
  6871.                 sendresponse("Invalid Syntax: " .. command .. " [object] {player} {amount} {resptime} {recycle}", command, executor)
  6872.                 return
  6873.             end
  6874.         else
  6875.             sendresponse("Missing Object", command, executor)
  6876.             return
  6877.         end
  6878.     else
  6879.         sendresponse(" - An unknown error has occured -", command, executor)
  6880.     end
  6881.     -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
  6882.     if type == "spawn" then
  6883.         bool = true
  6884.         if object == "cyborg" or object == "bot" or object == "mastercheif" or object == "biped" or object == "bipd" then
  6885.             Spawn(message, "Cyborg", "bipd", cyborg_tag_id, executor, type)
  6886.  
  6887.         elseif object == "cyb" then
  6888.             Spawn(message, "cyb", "bipd", cyb_tag_id, executor, type)
  6889.  
  6890.         elseif object == "carbine" then
  6891.             Spawn(message, "carbine", "weap", carbine_tag_id, executor, type)
  6892.  
  6893.         elseif object == "revsniper" then
  6894.             Spawn(message, "revsniper", "weap", revsniper_tag_id, executor, type)
  6895.  
  6896.         elseif object == "covspiker" then
  6897.             Spawn(message, "covspiker", "weap", covspiker_tag_id, executor, type)
  6898.  
  6899.         elseif object == "covpr" then
  6900.             Spawn(message, "covpr", "weap", covplasmarifle_tag_id, executor, type)
  6901.  
  6902.         elseif object == "covpp" then
  6903.             Spawn(message, "covpp", "weap", covpp_tag_id, executor, type)
  6904.  
  6905.         elseif object == "covbr" then
  6906.             Spawn(message, "covbr", "weap", covbr_tag_id, executor, type)
  6907.  
  6908.         elseif object == "covsmg" then
  6909.             Spawn(message, "covsmg", "weap", covsmg_tag_id, executor, type)
  6910.  
  6911.         elseif object == "yohog" then
  6912.             Spawn(message, "yohog", "weap", yohog_tag_id, executor, type)
  6913.  
  6914.         elseif object == "fhog" then
  6915.             Spawn(message, "fhog", "weap", fhog_tag_id, executor, type)
  6916.  
  6917.         elseif object == "captain" or object == "keyes" then
  6918.             Spawn(message, "Captain Keyes", "bipd", captain_tag_id, executor, type)
  6919.  
  6920.         elseif object == "cortana" then
  6921.             Spawn(message, "Cortana", "bipd", cortana_tag_id, executor, type)
  6922.  
  6923.         elseif object == "cortana2" then
  6924.             Spawn(message, "Cortana2", "bipd", cortana2_tag_id, executor, type)
  6925.  
  6926.         elseif object == "crewman" then
  6927.             Spawn(message, "Crewman", "bipd", crewman_tag_id, executor, type)
  6928.  
  6929.         elseif object == "elite" then
  6930.             Spawn(message, "elite", "bipd", elite_tag_id, executor, type)
  6931.  
  6932.         elseif object == "elite2" then
  6933.             Spawn(message, "Elite Special", "bipd", elite2_tag_id, executor, type)
  6934.  
  6935.         elseif object == "engineer" then
  6936.             Spawn(message, "Engineer", "bipd", engineer_tag_id, executor, type)
  6937.  
  6938.         elseif object == "flood" then
  6939.             Spawn(message, "Flood Captain", "bipd", flood_tag_id, executor, type)
  6940.  
  6941.         elseif object == "flood2" then
  6942.             Spawn(message, "Flood Infection", "bipd", flood2_tag_id, executor, type)
  6943.  
  6944.         elseif object == "flood3" then
  6945.             Spawn(message, "Flood Carrier", "bipd", "characters\\floodcarrier\\floodcarrier", executor, type)
  6946.  
  6947.         elseif object == "floodelite" then
  6948.             Spawn(message, "FloodCombat Elite", "bipd", "characters\\floodcombat elite\\floodcombat elite", executor, type)
  6949.  
  6950.         elseif object == "floodhuman" then
  6951.             Spawn(message, "FloodCombat Human", "bipd", "characters\\floodcombat_human\\floodcombat_human", executor, type)
  6952.  
  6953.         elseif object == "pedobear" or object == "grunt" then
  6954.             Spawn(message, "Pedobear", "bipd", "characters\\grunt\\grunt", executor, type)
  6955.  
  6956.         elseif object == "hunter" then
  6957.             Spawn(message, "Hunter", "bipd", "characters\\hunter\\hunter", executor, type)
  6958.  
  6959.         elseif object == "marine" then
  6960.             Spawn(message, "Marine", "bipd", "characters\\marine\\marine", executor, type)
  6961.  
  6962.         elseif object == "marinesuicide" or object == "marine2" then
  6963.             Spawn(message, "Marine Suicidal", "bipd", "characters\\marine_suicidal\\marine_suicidal", executor, type)
  6964.  
  6965.         elseif object == "monitor" then
  6966.             Spawn(message, "Monitor", "bipd", "characters\\monitor\\monitor", executor, type)
  6967.  
  6968.         elseif object == "sentinel" then
  6969.             Spawn(message, "Sentinel", "bipd", "characters\\sentinel\\sentinel", executor, type)
  6970.  
  6971.         elseif object == "johnson" then
  6972.             Spawn(message, "Sgt. Johnson", "bipd", "characters\\johnson\\johnson", executor, type)
  6973.  
  6974.         elseif object == "camo" or object == "camouflage" then
  6975.             Spawn(message, "Camouflage", "eqip", camouflage_tag_id, executor, type)
  6976.  
  6977.         elseif object == "dblspd" then
  6978.             Spawn(message, "Double Speed", "eqip", doublespeed_tag_id, executor, type)
  6979.  
  6980.         elseif object == "fullspec" then
  6981.             Spawn(message, "Full-Spectrum Vision", "eqip", fullspec_tag_id, executor, type)
  6982.  
  6983.         elseif object == "fnade" or object == "nades" then
  6984.             Spawn(message, "Frag Grenade", "eqip", fragnade_tag_id, executor, type)
  6985.  
  6986.         elseif object == "pnade" then
  6987.             Spawn(message, "Plasma Grenade", "eqip", plasmanade_tag_id, executor, type)
  6988.  
  6989.         elseif object == "overshield" or object == "os" then
  6990.             Spawn(message, "OverShield", "eqip", overshield_tag_id, executor, type)
  6991.  
  6992.         elseif object == "rifleammo" then
  6993.             Spawn(message, "Assault Rifle Ammo", "eqip", rifleammo_tag_id, executor, type)
  6994.  
  6995.         elseif object == "healthpack" then
  6996.             Spawn(message, "Health Pack", "eqip", healthpack_tag_id, executor, type)
  6997.  
  6998.         elseif object == "needlerammo" then
  6999.             Spawn(message, "Needler Ammo", "eqip", needlerammo_tag_id, executor, type)
  7000.  
  7001.         elseif object == "pistolammo" then
  7002.             Spawn(message, "Pistol Ammo", "eqip", pistolammo_tag_id, executor, type)
  7003.  
  7004.         elseif object == "rocketammo" then
  7005.             Spawn(message, "Rocket Launcher Ammo", "eqip", rocketammo_tag_id, executor, type)
  7006.  
  7007.         elseif object == "shottyammo" then
  7008.             Spawn(message, "Shotgun Ammo", "eqip", shotgunammo_tag_id, executor, type)
  7009.  
  7010.         elseif object == "sniperammo" then
  7011.             Spawn(message, "Sniper Rifle Ammo", "eqip", sniperammo_tag_id, executor, type)
  7012.  
  7013.         elseif object == "flameammo" then
  7014.             Spawn(message, "Flamethrower Ammo", "eqip", flameammo_tag_id, executor, type)
  7015.         else
  7016.             bool = false
  7017.         end
  7018.         if bool then
  7019.             return
  7020.         end
  7021.     end
  7022.     --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7023.     if type ~= "enter" then
  7024.         bool = true
  7025.         if object == "energysword" or object == "esword" then
  7026.             Spawn(message, "Energy Sword", "weap", energysword_tag_id, executor, type)
  7027.  
  7028.         elseif object == "ball" or object == "oddball" then
  7029.             Spawn(message, "Oddball", "weap", oddball_tag_id, executor, type)
  7030.  
  7031.         elseif object == "flag" then
  7032.             Spawn(message, "Flag", "weap", flag_tag_id, executor, type)
  7033.             flag_id = gettagid("weap", "weapons\\flag\\flag")
  7034.  
  7035.         elseif object == "frg" or object == "fuelrod" or object == "rod" or object == "plasmacannon" then
  7036.             Spawn(message, "Fuel Rod", "weap", plasmacannon_tag_id, executor, type)
  7037.  
  7038.         elseif object == "ggun" or object == "gravitygun" then
  7039.             Spawn(message, "Gravity Gun", "weap", gravityrifle_tag_id, executor, type)
  7040.  
  7041.         elseif object == "needler" then
  7042.             Spawn(message, "Needler", "weap", needler_tag_id, executor, type)
  7043.  
  7044.         elseif object == "pistol" then
  7045.             Spawn(message, "Pistol", "weap", pistol_tag_id, executor, type)
  7046.  
  7047.         elseif object == "ppistol" or object == "plasmapistol" then
  7048.             Spawn(message, "Plasma Pistol", "weap", plasmapistol_tag_id, executor, type)
  7049.  
  7050.         elseif object == "prifle" or object == "plasmarifle" then
  7051.             Spawn(message, "Plasma Rifle", "weap", plasmarifle_tag_id, executor, type)
  7052.  
  7053.         elseif object == "rifle" or object == "arifle" or object == "assaultrifle" then
  7054.             Spawn(message, "Assault Rifle", "weap", assaultrifle_tag_id, executor, type)
  7055.  
  7056.         elseif object == "rocket" or object == "rocketlauncher" or object == "rox" then
  7057.             Spawn(message, "Rocket Launcher", "weap", rocketlauncher_tag_id, executor, type)
  7058.  
  7059.         elseif object == "shotty" or object == "shotgun" then
  7060.             Spawn(message, "Shotgun", "weap", shotgun_tag_id, executor, type)
  7061.  
  7062.         elseif object == "sniper" then
  7063.             Spawn(message, "Sniper Rifle", "weap", sniper_tag_id, executor, type)
  7064.  
  7065.         elseif object == "flamethrower" or object == "flame" then
  7066.             Spawn(message, "Flame Thrower", "weap", flamethrower_tag_id, executor, type)
  7067.  
  7068.         elseif object == "spiker" then
  7069.             Spawn(message, "Covenant Spiker", "weap", covspiker_tag_id, executor, type)
  7070.  
  7071.         elseif object == "covpr" then
  7072.             Spawn(message, "Covenant Plasma Rifle", "weap", covplasmarifle_tag_id, executor, type)
  7073.  
  7074.         elseif object == "covpp" then
  7075.             Spawn(message, "Covenant Plasma Pistol", "weap", covpp_tag_id, executor, type)
  7076.  
  7077.         elseif object == "covbr" then
  7078.             Spawn(message, "Covenant Brute Rifle", "weap", covbr_tag_id, executor, type)
  7079.  
  7080.         elseif object == "covsmg" then
  7081.             Spawn(message, "Covenant SMG", "weap", covsmg_tag_id, executor, type)
  7082.  
  7083.         elseif object == "yohog" then
  7084.             Spawn(message, "YoHog", "weap", yohog_tag_id, executor, type)
  7085.  
  7086.         elseif object == "fhog" then
  7087.             Spawn(message, "FHog", "weap", fhog_tag_id, executor, type)
  7088.  
  7089.         elseif object == "healthpack" or object == "hpack" then
  7090.             Spawn(message, "Health Pack", "eqip", healthpack_tag_id, executor, type)
  7091.  
  7092.         elseif object == "rifleammo" then
  7093.             Spawn(message, "Assault Rifle Ammo", "eqip", rifleammo_tag_id, executor, type)
  7094.  
  7095.         elseif object == "needlerammo" then
  7096.             Spawn(message, "Needler Ammo", "eqip", needlerammo_tag_id, executor, type)
  7097.  
  7098.         elseif object == "pistolammo" then
  7099.             Spawn(message, "Pistol Ammo", "eqip", pistolammo_tag_id, executor, type)
  7100.  
  7101.         elseif object == "rocketammo" then
  7102.             Spawn(message, "Rocket Launcher Ammo", "eqip", rocketammo_tag_id, executor, type)
  7103.  
  7104.         elseif object == "shotgunammo" then
  7105.             Spawn(message, "Shotgun Ammo", "eqip", shotgunammo_tag_id, executor, type)
  7106.  
  7107.         elseif object == "sniperammo" then
  7108.             Spawn(message, "Sniper Rifle Ammo", "eqip", sniperammo_tag_id, executor, type)
  7109.  
  7110.         elseif object == "Flamethrowerammo" then
  7111.             Spawn(message, "Flamethrower Ammo", "eqip", flameammo_tag_id, executor, type)
  7112.         else
  7113.             bool = false
  7114.         end
  7115.         if bool then
  7116.             return
  7117.         end
  7118.     end
  7119.     --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7120.     if type ~= "give" then
  7121.         bool = true
  7122.         if object == "wraith" then
  7123.             Spawn(message, "Wraith", "vehi", wraith_tag_id, executor, type)
  7124.         elseif object == "peli" or object == "pelican" then
  7125.             Spawn(message, "Pelican", "vehi", pelican_tag_id, executor, type)
  7126.         elseif object == "ghost" then
  7127.             Spawn(message, "Ghost", "vehi", ghost_tag_id, executor, type)
  7128.         elseif object == "hog" or object == "warthog" then
  7129.             Spawn(message, "Warthog", "vehi", warthog_tag_id, executor, type)
  7130.         elseif object == "rhog" or object == "rocketwarthog" then
  7131.             Spawn(message, "Rocket Warthog", "vehi", rwarthog_tag_id, executor, type)
  7132.         elseif object == "shee" or object == "banshee" then
  7133.             Spawn(message, "Banshee", "vehi", banshee_tag_id, executor, type)
  7134.         elseif object == "tank" or object == "scorpion" then
  7135.             Spawn(message, "Tank", "vehi", scorpion_tag_id, executor, type)
  7136.         elseif object == "turret" or object == "shade" then
  7137.             Spawn(message, "Gun Turret", "vehi", turret_tag_id, executor, type)
  7138.         else
  7139.             bool = false
  7140.         end
  7141.         if bool then
  7142.             return
  7143.         end
  7144.     end
  7145.     if bool == false then
  7146.         if type == "give" then
  7147.             sendresponse("Error 001: Invalid Weapon! (Type: 'Give')", command, executor)
  7148.         elseif type == "enter" then
  7149.             sendresponse("Error 002: Invalid Vehicle! (Type: 'Enter')", command, executor)
  7150.         elseif type == "spawn" then
  7151.             sendresponse("Error 003: Invalid Object! (Type: 'Spawn')", command, executor)
  7152.         end
  7153.     end
  7154. end
  7155. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7156. --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7157. function Command_SpamMax(executor, command, value, count)
  7158.     if count == 1 then
  7159.         SPAM_MAX = tonumber(SPAM_MAX) or 7
  7160.         sendresponse("Spam max is " .. SPAM_MAX, command, executor)
  7161.     elseif count == 2 and tonumber(value) then
  7162.         if value == 0 and AntiSpam ~= false then
  7163.             AntiSpam = false
  7164.             sendresponse("AntiSpam is now disabled", command, executor)
  7165.         elseif value == 0 and AntiSpam == false then
  7166.             sendresponse("AntiSpam is already disabled", command, executor)
  7167.         else
  7168.             SPAM_MAX = tonumber(value)
  7169.             sendresponse("The Spam Max is now: " .. value, command, executor)
  7170.         end
  7171.     else
  7172.         sendresponse("Invalid Syntax:  " .. command .. " [value]", command, executor)
  7173.     end
  7174. end
  7175.  
  7176. function Command_SpamTimeOut(executor, command, time, count)
  7177.     if count == 1 then
  7178.         SPAM_TIMEOUT = tonumber(SPAM_TIMEOUT) or 60
  7179.         sendresponse("Spam timeout is " .. round(SPAM_TIMEOUT / 60, 1) .. " minute(s)", command, executor)
  7180.     elseif count == 2 and tonumber(time) then
  7181.         time = tonumber(time)
  7182.         if time == 0 and AntiSpam ~= false then
  7183.             AntiSpam = false
  7184.             sendresponse("AntiSpam is now disabled", command, executor)
  7185.         elseif time == 0 and AntiSpam == false then
  7186.             sendresponse("AntiSpam is already disabled", command, executor)
  7187.         else
  7188.             SPAM_TIMEOUT = tonumber(time * 60)
  7189.             sendresponse("The Spam timeout is now " .. tostring(time) .. " minute(s)", command, executor)
  7190.         end
  7191.     else
  7192.         sendresponse("Invalid Syntax:  " .. command .. " [time]", command, executor)
  7193.     end
  7194. end
  7195.  
  7196. function Command_Specs(executor, command, count)
  7197.     if count == 1 then
  7198.         local specs = readtagname(specs_addr)
  7199.         sendresponse("The server specs are: " .. tostring(specs), command, executor)
  7200.     else
  7201.         sendresponse("Invalid Syntax: " .. command, command, executor)
  7202.     end
  7203. end
  7204.  
  7205. function Command_StartMapcycle(executor, command, count)
  7206.     if count == 1 then
  7207.         local response = svcmd("sv_mapcycle_begin", true)
  7208.         sendresponse(response[1], command, executor)
  7209.         svcmd("sv_mapcycle_begin")
  7210.     else
  7211.         sendresponse("Invalid Syntax: " .. command, command, executor)
  7212.     end
  7213. end
  7214.  
  7215. function Command_Status(executor, command, count)
  7216.     if count == 1 then
  7217.         local response = "Admin Blocker: " .. tostring(admin_blocker) .. "  |  Anti Caps: " .. tostring(anticaps) .. "  |  Anti Spam: " .. tostring(AntiSpam) .. "\n"
  7218.         response = response .. "" .. "Chat Commands: " .. tostring(chatcommands) .. "  |  Deathless: " .. tostring(deathless) .. "  |  Falldamage: " .. tostring(falldamage) .. "\n"
  7219.         response = response .. "" .. "First Join Message: " .. tostring(firstjoin_message) .. "  |  Hash Check: " .. tostring(hash_check) .. "  |  Infinite Ammo: " .. tostring(infammo) .. "\n"
  7220.         response = response .. "" .. "Killspree: " .. tostring(killing_spree) .. "  |  Noweapons: " .. tostring(noweapons) .. "\n"
  7221.         response = response .. "" .. "Pvtmessage: " .. tostring(pm_enabled) .. "  |  Respawn_time: " .. tostring(respset) .. "  |  Rtv_enabled: " .. tostring(rockthevote) .. "\n"
  7222.         response = response .. "" .. "Rtv_needed: " .. tostring(rtv_required) .. "  |  Serveradmin_message: " .. tostring(sa_message) .. "  |  Spam Max: " .. tostring(SPAM_MAX) .. "\n"
  7223.         response = response .. "" .. "Spamtimeout: " .. tostring(SPAM_TIMEOUT) .. "seconds  |  Tbagdet: " .. tostring(tbag_detection) .. "  |  Uniques Enabled: " .. tostring(uniques_enabled) .. "\n"
  7224.         response = response .. "" .. "Version Check: " .. tostring(version_check) .. "  |  Version: " .. tostring(Version) .. "  |  Votekick Enabled: " .. tostring(votekick_allowed) .. "\n"
  7225.         response = response .. "" .. "Votekick Needed: " .. tostring(votekick_required) .. "  |  Votekick Action: " .. tostring(votekick_action) .. "  |  Welcomeback Message: " .. tostring(wb_message)
  7226.         sendresponse(response, command, executor)
  7227.     else
  7228.         sendresponse("Invalid Syntax: " .. command, command, executor)
  7229.     end
  7230. end
  7231.  
  7232. function Command_Superban(executor, command, player, message, count)
  7233.     if count == 2 or count == 3 then
  7234.         local players = getvalidplayers(player, executor, command)
  7235.         if players then
  7236.             local name = "the Server"
  7237.             if executor ~= nil then name = getname(executor) end
  7238.             for i = 1, #players do
  7239.                 message = tostring(message) or "None Given"
  7240.                 BanReason(getname(players[i]) .. " was banned by " .. name .. " Reason: " .. message .. " Type: Super Ban")
  7241.                 say(getname(players[i]) .. " was Super banned by " .. name .. " Reason: " .. message)
  7242.                 table.insert(Name_Bans, getname(players[i]))
  7243.                 local ip = getip(players[i])
  7244.                 IP_BanList[ip] = { }
  7245.                 table.insert(IP_BanList[ip], { ["name"] = getname(players[i]), ["ip"] = ip, ["time"] = - 1, ["id"] = IP_BanID })
  7246.                 IP_BanID = IP_BanID + 1
  7247.                 local words = tokenizestring(ip, ".")
  7248.                 local ip2 = words[1] .. "." .. words[2]
  7249.                 IpRange_BanList[ip2] = { }
  7250.                 table.insert(IpRange_BanList[ip2], { ["name"] = getname(players[i]), ["ip"] = ip2, ["time"] = ipbantime, ["id"] = IpRange_BanID })
  7251.                 IpRange_BanID = IpRange_BanID + 1
  7252.                 svcmd("sv_ban " .. resolveplayer(players[i]))
  7253.             end
  7254.         else
  7255.             sendresponse("Error 005: Invalid Player", command, executor)
  7256.         end
  7257.     else
  7258.         sendresponse("Invalid Syntax: " .. command .. " [player] {reason}", command, executor)
  7259.     end
  7260. end
  7261.  
  7262. function Command_Suspend(executor, command, player, time, count)
  7263.     local players = getvalidplayers(player, executor)
  7264.     if players then
  7265.         for i = 1, #players do
  7266.             if Suspend_Table[getip(players[i])] == nil then
  7267.                 local m_player = getplayer(players[i])
  7268.                 local player_respawn_time = readdword(m_player + 0x2c)
  7269.                 if count == 2 then
  7270.                     kill(players[i])
  7271.                     writedword(m_player + 0x2C, 2592000)
  7272.                     Suspend_Table[getip(players[i])] = 2
  7273.                     sendresponse(getname(players[i]) .. " has been suspended by an Admin.", command, executor)
  7274.                 elseif count == 3 then
  7275.                     kill(players[i])
  7276.                     writedword(m_player + 0x2C, time * 30)
  7277.                     Suspend_Table[getip(players[i])] = 1
  7278.                     if tonumber(time) == 1 then
  7279.                         sendresponse(getname(players[i]) .. " was suspended by an admin for " .. time .. " second", command, executor)
  7280.                     else
  7281.                         sendresponse(getname(players[i]) .. " was suspended by an admin for " .. time .. " seconds", command, executor)
  7282.                     end
  7283.                 else
  7284.                     sendresponse("Invalid Syntax: sv_suspend [player] {time}", command, executor)
  7285.                 end
  7286.             else
  7287.                 sendresponse(getname(players[i]) .. " has already been suspended.", command, executor)
  7288.             end
  7289.         end
  7290.     else
  7291.         sendresponse("Error 005: Invalid Player", command, executor)
  7292.     end
  7293. end
  7294.  
  7295. function Command_Takeweapons(executor, command, player, count)
  7296.     if count == 2 then
  7297.         local players = getvalidplayers(player, executor)
  7298.         if players then
  7299.             for i = 1, #players do
  7300.                 local ip = getip(players[i])
  7301.                 if Noweapons[ip] == nil then
  7302.                     Noweapons[ip] = 1
  7303.                     local m_objectId = getplayerobjectid(players[i])
  7304.                     if m_objectId then
  7305.                         local m_object = getobject(m_objectId)
  7306.                         if m_object then
  7307.                             for j = 0, 3 do
  7308.                                 local m_weaponId = readdword(m_object + 0x2F8 + j * 4)
  7309.                                 local m_weapon = getobject(m_weaponId)
  7310.                                 if m_weapon then
  7311.                                     destroyobject(m_weaponId)
  7312.                                 end
  7313.                             end
  7314.                         end
  7315.                     end
  7316.                     sendresponse(getname(players[i]) .. " now has no weapons", command, executor)
  7317.                 else
  7318.                     sendresponse(getname(players[i]) .. " already has no weapons", command, executor)
  7319.                 end
  7320.             end
  7321.         else
  7322.             sendresponse("Error 005: Invalid Player", command, executor)
  7323.         end
  7324.     else
  7325.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  7326.     end
  7327. end
  7328.  
  7329. function Command_TbagDetection(executor, command, boolean, count)
  7330.     if count == 1 then
  7331.         if tbag_detection then
  7332.             sendresponse("Tbag Detection is currently on", command, executor)
  7333.         else
  7334.             sendresponse("Tbag Detection is currently off", command, executor)
  7335.         end
  7336.     elseif count == 2 then
  7337.         if (boolean == "1" or boolean == "true") and tbag_detection ~= true then
  7338.             tbag_detection = true
  7339.             sendresponse("Tbag Detection is now enabled", command, executor)
  7340.         elseif (boolean == "1" or boolean == "true") and tbag_detection == true then
  7341.             sendresponse("Tbag Detection is already enabled", command, executor)
  7342.         elseif (boolean ~= "0" and boolean ~= "false") then
  7343.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  7344.         elseif (boolean == "0" or boolean == "false") and tbag_detection ~= false then
  7345.             tbag_detection = false
  7346.             sendresponse("Tbag Detection is now disabled", command, executor)
  7347.         elseif tbag_detection == nil then
  7348.             tbag_detection = true
  7349.             sendresponse("Tbag Detection is now enabled", command, executor)
  7350.         elseif (boolean == "0" or boolean == "false") and tbag_detection == false then
  7351.             sendresponse("Tbag Detection is already disabled", command, executor)
  7352.         else
  7353.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  7354.         end
  7355.     else
  7356.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  7357.     end
  7358. end
  7359.  
  7360. function Command_TeleportDelete(executor, command, location, count)
  7361.     if count == 3 then
  7362.         tostring(location)
  7363.         local response = svcmd("sv_teleport_del " .. location, true)
  7364.         sendresponse(tostring(response[1]), command, executor)
  7365.     else
  7366.         sendresponse("Invalid Syntax: " .. command .. " [ID]", command, executor)
  7367.     end
  7368. end
  7369.  
  7370. function Command_Teleport(executor, command, player, location, y, z, count)
  7371.     if count == 3 then
  7372.         local players = getvalidplayers(player, executor)
  7373.         if players then
  7374.             for i = 1, #players do
  7375.                 local response = svcmd("sv_teleport " .. resolveplayer(players[i]) .. " " .. location, true)
  7376.                 if string.find(response[1], "valid") then
  7377.                     sendresponse("Location '" .. tostring(location) .. "' does not exist for this map", command, executor)
  7378.                 else
  7379.                     sendresponse("Teleporting " .. getname(players[i]) .. " to location '" .. location .. "'", command, executor)
  7380.                 end
  7381.             end
  7382.         else
  7383.             sendresponse("Error 005: Invalid Player", command, executor)
  7384.         end
  7385.     elseif count == 5 then
  7386.         location = tonumber(t[3])
  7387.         y = tonumber(t[4])
  7388.         z = tonumber(t[5])
  7389.         local players = getvalidplayers(player, executor)
  7390.         if players then
  7391.             for i = 1, #players do
  7392.                 local response = svcmd("sv_teleport " .. resolveplayer(players[i]) .. " " .. location .. " " .. y .. " " .. z, true)
  7393.                 if string.find(response[1], "valid") then
  7394.                     sendresponse("Location '" .. tostring(location) .. "' does not exist for this map", command, executor)
  7395.                 else
  7396.                     sendresponse("Teleporting " .. getname(players[i]) .. " to location '" .. location .. "'", command, executor)
  7397.                 end
  7398.             end
  7399.         else
  7400.             sendresponse("Error 005: Invalid Player", command, executor)
  7401.         end
  7402.     else
  7403.         sendresponse("Invalid Syntax: " .. command .. " [player] [location] or [x] [y] [z]", command, executor)
  7404.     end
  7405. end
  7406.  
  7407. function Command_Test(executor, command, arg1, arg2, arg3, arg4, count)
  7408.     if count == 1 then
  7409.  
  7410.     elseif count == 2 then
  7411.  
  7412.     elseif count == 3 then
  7413.  
  7414.     elseif count == 4 then
  7415.  
  7416.     elseif count == 5 then
  7417.  
  7418.     else
  7419.  
  7420.     end
  7421. end
  7422.  
  7423. function Command_Textban(executor, command, player, time, message, count)
  7424.     if count >= 2 and count <= 4 then
  7425.         local textbantime = wordtotime(time)
  7426.         local players = getvalidplayers(player, executor)
  7427.         if players then
  7428.             local name = "the Server"
  7429.             if executor ~= nil then name = getname(executor) end
  7430.             for i = 1, #players do
  7431.                 local name = getname(players[i])
  7432.                 local ip = getip(players[i])
  7433.                 local hash = gethash(players[i])
  7434.                 if Admin_Table[hash] or IpAdmins[ip] then
  7435.                     sendresponse("Admins cannot be banned from the chat.", command, executor)
  7436.                 else
  7437.                     local bool = true
  7438.                     for k, v in pairs(Mute_Banlist) do
  7439.                         for key, value in pairs(Mute_Banlist[k]) do
  7440.                             if Mute_Banlist[k][key].ip == ip or Mute_Banlist[k][key].hash == hash then
  7441.                                 bool = false
  7442.                                 sendresponse(name .. " is already textbanned", command, executor)
  7443.                                 break
  7444.                             end
  7445.                         end
  7446.                         if not bool then
  7447.                             break
  7448.                         end
  7449.                     end
  7450.                     if bool then
  7451.                         message = tostring(message) or "None Given"
  7452.                         BanReason(getname(players[i]) .. " was text banned by " .. name .. " Reason: " .. message)
  7453.                         say(getname(players[i]) .. " was text banned by " .. name .. " Reason: " .. message)
  7454.                         Mute_Banlist[ip] = { }
  7455.                         table.insert(Mute_Banlist[ip], { ["name"] = name, ["hash"] = hash, ["ip"] = ip, ["time"] = textbantime, ["id"] = TextBanID })
  7456.                         TextBanID = TextBanID + 1
  7457.                         local msg = ""
  7458.                         if textbantime == -1 then
  7459.                             msg = name .. " has been banned from the chat indefinitely"
  7460.                         else
  7461.                             msg = name .. " has been banned from the chat for " .. time .. ""
  7462.                         end
  7463.                         sendresponse(msg, command, executor)
  7464.                         hprintf(msg)
  7465.                     end
  7466.                 end
  7467.             end
  7468.         else
  7469.             sendresponse("Error 005: Invalid Player", command, executor)
  7470.         end
  7471.     else
  7472.         sendresponse("Invalid Syntax: " .. command .. " [player] {time} {reason}", command, executor)
  7473.     end
  7474. end
  7475.  
  7476. function Command_Textbanlist(executor, command, count)
  7477.     if count == 1 then
  7478.         local response = "[ ID   |   Name   |   Time Left ]\n"
  7479.         local response_table = { }
  7480.         for k, v in pairs(Mute_Banlist) do
  7481.             for key, value in ipairs(Mute_Banlist[k]) do
  7482.                 local time = timetoword(Mute_Banlist[k][key].time)
  7483.                 response_table[tonumber(Mute_Banlist[k][key].id)] = Mute_Banlist[k][key].name .. "  |  " .. time .. "\n"
  7484.             end
  7485.         end
  7486.         for i = 0, TextBanID do
  7487.             if response_table[i] then
  7488.                 response = response .. "" .. i .. "  |  " .. response_table[i]
  7489.             end
  7490.         end
  7491.         sendresponse(response, command, executor)
  7492.     else
  7493.         sendresponse("Invalid Syntax: " .. command, command, executor)
  7494.     end
  7495. end
  7496.  
  7497. function Command_Textunban(executor, command, ID, count)
  7498.     if count == 2 and tonumber(ID) then
  7499.         ID = tonumber(ID)
  7500.         local response = "Invalid ID"
  7501.         if ID <= TextBanID then
  7502.             local bool = false
  7503.             for k, v in pairs(Mute_Banlist) do
  7504.                 if Mute_Banlist[k] ~= { } then
  7505.                     for key, value in ipairs(Mute_Banlist[k]) do
  7506.                         if Mute_Banlist[k][key].id == ID then
  7507.                             bool = true
  7508.                             response = Mute_Banlist[k][key].name .. " has been untextbanned"
  7509.                             table.remove(Mute_Banlist[k], key)
  7510.                             break
  7511.                         end
  7512.                     end
  7513.                 end
  7514.                 if bool then
  7515.                     break
  7516.                 end
  7517.             end
  7518.             sendresponse(response, command, executor)
  7519.         else
  7520.             sendresponse(response, command, executor)
  7521.         end
  7522.     else
  7523.         sendresponse("Invalid Syntax: " .. command .. " [ID]", command, executor)
  7524.     end
  7525. end
  7526.  
  7527. function Command_Teletoplayer(executor, command, player, player2, count)
  7528.     if count == 3 then
  7529.         local players = getvalidplayers(player, executor)
  7530.         if players then
  7531.             for i = 1, #players do
  7532.                 local name = getname(players[i])
  7533.                 local m_playerObjId = getplayerobjectid(players[i])
  7534.                 if m_playerObjId then
  7535.                     local m_object = getobject(m_playerObjId)
  7536.                     if m_object then
  7537.                         local m_vehicleId = readdword(m_object + 0x11C)
  7538.                         local m_vehicle = getobject(m_vehicleId)
  7539.                         local players2 = getvalidplayers(player2, executor)
  7540.                         if players2 then
  7541.                             local m_objectId = getplayerobjectid(players2[1])
  7542.                             if m_objectId then
  7543.                                 if players2[2] == nil and players[i] ~= players2[1] then
  7544.                                     local t_name = getname(players2[1])
  7545.                                     local player_x_coord, player_y_coord, player_z_coord = getobjectcoords(m_objectId)
  7546.                                     if m_vehicle then
  7547.                                         writefloat(m_vehicle + 0x5C, player_x_coord)
  7548.                                         writefloat(m_vehicle + 0x60, player_y_coord)
  7549.                                         writefloat(m_vehicle + 0x64, player_z_coord + 1.5)
  7550.                                         sendresponse(name .. " was teleported to " .. t_name, command, executor)
  7551.                                     elseif tonumber(player_z_coord) then
  7552.                                         movobjectcoords(m_playerObjId, player_x_coord, player_y_coord, player_z_coord + 1)
  7553.                                         sendresponse(name .. " was teleported to " .. t_name, command, executor)
  7554.                                     end
  7555.                                 elseif players2[2] then
  7556.                                     sendresponse("You cannot teleport to multiple people.", command, executor)
  7557.                                 end
  7558.                             else
  7559.                                 sendresponse("The player you are trying to teleport to is dead", command, executor)
  7560.                             end
  7561.                         else
  7562.                             sendresponse("Error 005: Invalid Player", command, executor)
  7563.                         end
  7564.                     else
  7565.                         sendresponse("The player(s) you are trying to teleport are dead", command, executor)
  7566.                     end
  7567.                 else
  7568.                     sendresponse("The player(s) you are trying to teleport are dead", command, executor)
  7569.                 end
  7570.             end
  7571.         else
  7572.             sendresponse("Error 005: Invalid Player", command, executor)
  7573.         end
  7574.     else
  7575.         sendresponse("Invalid Syntax: " .. command .. " [player] [player]", command, executor)
  7576.     end
  7577. end
  7578.  
  7579. function Command_Timelimit(executor, command, time, count)
  7580.     if count == 1 then
  7581.         local time_passed = readdword(readdword(gametime_base) + 0xC) / 1800
  7582.         local timelimit = readdword(gametype_base + 0x78) / 1800
  7583.         local time_left = timelimit - time_passed
  7584.         local Timelimit = readdword(timelimit_address)
  7585.         sendresponse("Current Timelimit is " .. round(timelimit) .. " minutes. Time remaining: " .. tostring(round(time_left, 0)) .. " minutes.", command, executor)
  7586.     elseif count == 2 and tonumber(time) then
  7587.         settimelimit(time)
  7588.         sendresponse("Timelimit set to " .. time .. " minutes", command, executor)
  7589.     else
  7590.         sendresponse("Invalid Syntax: " .. command .. " {time}", command, executor)
  7591.     end
  7592. end
  7593.  
  7594. function Command_Unban(executor, command, id, count)
  7595.     if count == 2 and tonumber(id) then
  7596.         local response = svcmd("sv_unban " .. tonumber(id), true)
  7597.         if response then
  7598.             if string.find(response[1], "Unbanning") then
  7599.                 sendresponse(response[1], command, executor)
  7600.             else
  7601.                 sendresponse("That ID has not been banned.", command, executor)
  7602.             end
  7603.         else
  7604.             sendresponse("An unknown error has occured getting the reply from svcmd.", command, executor)
  7605.         end
  7606.     else
  7607.         sendresponse("Invalid Syntax: " .. command .. " [Banlist ID]", command, executor)
  7608.     end
  7609. end
  7610.  
  7611. function Command_Unbos(executor, command, ID, count)
  7612.     if count == 2 then
  7613.         local entry = BosLog_Table[tonumber(ID)]
  7614.         local words = { }
  7615.         if entry == nil then
  7616.             sendresponse("Invalid Entry", command, executor)
  7617.         else
  7618.             local words = tokenizestring(entry, ",")
  7619.             local count = #words
  7620.             sendresponse("Removing " .. words[1] .. " - " .. words[2] .. " from BoS.", command, executor)
  7621.             table.remove(BosLog_Table, tonumber(ID))
  7622.         end
  7623.     else
  7624.         sendresponse("Invalid Syntax: " .. command .. " [entry]", command, executor)
  7625.     end
  7626. end
  7627.  
  7628. function Command_Ungod(executor, command, player, count)
  7629.     if count == 1 and executor ~= nil then
  7630.         local m_playerObjId = getplayerobjectid(executor)
  7631.         if m_playerObjId then
  7632.             local m_object = getobject(m_playerObjId)
  7633.             if m_object then
  7634.                 local ip = getip(executor)
  7635.                 if gods[ip] then
  7636.                     writefloat(m_object + 0xE0, 1)
  7637.                     writefloat(m_object + 0xE4, 1)
  7638.                     sendresponse("You are no longer in godmode.", command, executor, command, executor)
  7639.                     gods[ip] = nil
  7640.                 else
  7641.                     sendresponse("You are not in godmode", command, executor)
  7642.                 end
  7643.             else
  7644.                 sendresponse("You are dead", command, executor)
  7645.             end
  7646.         else
  7647.             sendresponse("You are dead", command, executor)
  7648.         end
  7649.     elseif count == 1 and executor == nil then
  7650.         sendresponse("The server is always god", command, executor)
  7651.     elseif count == 2 then
  7652.         local players = getvalidplayers(player, executor)
  7653.         if players then
  7654.             for i = 1, #players do
  7655.                 local m_playerObjId = getplayerobjectid(players[i])
  7656.                 if m_playerObjId then
  7657.                     local m_object = getobject(m_playerObjId)
  7658.                     if m_object then
  7659.                         local ip = getip(players[i])
  7660.                         if gods[ip] then
  7661.                             writefloat(m_object + 0xE0, 1)
  7662.                             writefloat(m_object + 0xE4, 1)
  7663.                             gods[ip] = nil
  7664.                             sendresponse(getname(players[i]) .. " is no longer in godmode", command, executor)
  7665.                         else
  7666.                             sendresponse(getname(players[i]) .. " is not in godmode", command, executor)
  7667.                         end
  7668.                     else
  7669.                         sendresponse("The selected player is dead", command, executor)
  7670.                     end
  7671.                 else
  7672.                     sendresponse("The selected player is dead", command, executor)
  7673.                 end
  7674.             end
  7675.         else
  7676.             sendresponse("Error 005: Invalid Player", command, executor)
  7677.         end
  7678.     else
  7679.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  7680.     end
  7681. end
  7682.  
  7683. function Command_Unhax(executor, command, player, count)
  7684.     if count == 2 then
  7685.         local players = getvalidplayers(player, executor)
  7686.         if players then
  7687.             for i = 1, #players do
  7688.                 local m_player = getplayer(players[i])
  7689.                 setscore(players[i], 0)
  7690.                 writeword(m_player + 0x9C, 0)
  7691.                 writeword(m_player + 0xA4, 0)
  7692.                 writeword(m_player + 0xAC, 0)
  7693.                 writeword(m_player + 0xAE, 0)
  7694.                 writeword(m_player + 0xB0, 0)
  7695.                 sendresponse(getname(players[i]) .. " has been unhaxed", command, executor)
  7696.             end
  7697.         else
  7698.             sendresponse("Error 005: Invalid Player", command, executor)
  7699.         end
  7700.     else
  7701.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  7702.     end
  7703. end
  7704.  
  7705. function Command_Unhide(executor, command, player, count)
  7706.     if count == 1 and executor ~= nil then
  7707.         local id = resolveplayer(executor)
  7708.         if id ~= nil then
  7709.             if hidden[id] then
  7710.                 sendresponse("You are no longer hidden", command, executor)
  7711.                 hidden[id] = nil
  7712.             else
  7713.                 sendresponse("You are not hidden", command, executor)
  7714.             end
  7715.         else
  7716.             sendresponse("The server cannot unhide itself", command, executor)
  7717.         end
  7718.     elseif count == 1 and executor == nil then
  7719.         sendresponse("The server is always hidden", command, executor)
  7720.     elseif count == 2 then
  7721.         local players = getvalidplayers(player, executor)
  7722.         if players then
  7723.             for i = 1, #players do
  7724.                 local id = resolveplayer(players[i])
  7725.                 if hidden[id] then
  7726.                     sendresponse(getname(players[i]) .. " is no longer hidden", command, executor)
  7727.                     hidden[id] = nil
  7728.                 else
  7729.                     sendresponse(getname(players[i]) .. " was never hidden", command, executor)
  7730.                 end
  7731.             end
  7732.         else
  7733.             sendresponse("Error 005: Invalid Player", command, executor)
  7734.         end
  7735.     else
  7736.         sendresponse("Invalid Syntax: " .. command .. " {player}", command, executor)
  7737.     end
  7738. end
  7739.  
  7740. function Command_Uninvis(executor, command, player, count)
  7741.     if count == 1 and executor ~= nil then
  7742.         local ip = getip(executor)
  7743.         if Ghost_Table[ip] == nil then
  7744.             sendresponse("You are not invisible", command, executor)
  7745.         else
  7746.             Ghost_Table[ip] = nil
  7747.             sendresponse("You are no longer invisible", command, executor)
  7748.         end
  7749.     elseif count == 1 and executor == nil then
  7750.         sendresponse("The server is always invisible", command, executor)
  7751.     elseif count == 2 and tonumber(command) == nil then
  7752.         local players = getvalidplayers(player, executor)
  7753.         if players then
  7754.             for i = 1, #players do
  7755.                 local ip = getip(players[i])
  7756.                 if Ghost_Table[ip] == nil then
  7757.                     sendresponse(getname(players[i]) .. " is not invisible", command, executor)
  7758.                 else
  7759.                     Ghost_Table[ip] = nil
  7760.                     sendresponse(getname(players[i]) .. " is no longer invisible", command, executor)
  7761.                 end
  7762.             end
  7763.         else
  7764.             sendresponse("Error 005: Invalid Player", command, executor)
  7765.         end
  7766.     else
  7767.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  7768.     end
  7769. end
  7770.  
  7771. function Command_Unmute(executor, command, player, count)
  7772.     if count == 2 then
  7773.         local players = getvalidplayers(player, executor)
  7774.         if players then
  7775.             for i = 1, #players do
  7776.                 local ip = getip(players[i])
  7777.                 if Mute_Table[ip] or Spam_Table[ip] ~= 0 then
  7778.                     Mute_Table[ip] = nil
  7779.                     SpamTimeOut_Table[ip] = nil
  7780.                     Spam_Table[ip] = 0
  7781.                     sendresponse(getname(players[i]) .. " has been unmuted", command, executor)
  7782.                 else
  7783.                     sendresponse(getname(players[i]) .. " has not been muted.", command, executor)
  7784.                 end
  7785.             end
  7786.         else
  7787.             sendresponse("Error 005: Invalid Player", command, executor)
  7788.         end
  7789.     else
  7790.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  7791.     end
  7792. end
  7793.  
  7794. function Command_Unsuspend(executor, command, player, count)
  7795.     if count == 2 then
  7796.         local players = getvalidplayers(player, executor)
  7797.         if players then
  7798.             for i = 1, #players do
  7799.                 if Suspend_Table[getip(players[i])] then
  7800.                     writedword(getplayer(players[i]) + 0x2C, 0)
  7801.                     sendresponse(getname(players[i]) .. " has been unsuspended", command, executor)
  7802.                 else
  7803.                     sendresponse(getname(players[i]) .. " has not been suspended.", command, executor)
  7804.                 end
  7805.             end
  7806.         else
  7807.             sendresponse("Error 005: Invalid Player")
  7808.         end
  7809.     else
  7810.         sendresponse("Invalid Syntax: " .. command .. " [player]")
  7811.     end
  7812. end
  7813.  
  7814. function Command_Versioncheck(boolean)
  7815.     if count == 2 then
  7816.         if (boolean == "1" or boolean == "true") and version_check ~= true then
  7817.             version_check = true
  7818.             writebyte(versioncheck_addr, 0x7D)
  7819.         elseif (boolean == "0" or boolean == "false") and version_check then
  7820.             version_check = false
  7821.             writebyte(versioncheck_addr, 0xEB)
  7822.         elseif version_check == nil then
  7823.             version_check = false
  7824.             writebyte(versioncheck_addr, 0xEB)
  7825.         end
  7826.     end
  7827. end
  7828.  
  7829. function Command_Viewadmins(executor, command, count)
  7830.     if count == 1 then
  7831.         sendresponse("The current admins in the server are listed below:", command, executor)
  7832.         sendresponse("[Level] Name: [Admin Type]", command, executor)
  7833.         local admins = { }
  7834.         for i = 0, 15 do
  7835.             local m_player = getplayer(i)
  7836.             if m_player then
  7837.                 local hash = gethash(i)
  7838.                 local name = getname(i)
  7839.                 if Admin_Table[hash] then
  7840.                     admins[name] = { "hash", "notip", Admin_Table[hash].level }
  7841.                 end
  7842.                 if IpAdmins[getip(i)] then
  7843.                     if admins[name] and admins[name] ~= { } then
  7844.                         admins[name][2] = "ip"
  7845.                     else
  7846.                         admins[name] = { "nothash", "ip", IpAdmins[getip(i)].level }
  7847.                     end
  7848.                 end
  7849.             end
  7850.         end
  7851.         for k, v in pairs(admins) do
  7852.             local message = ""
  7853.             if admins[k][1] == "hash" and admins[k][2] == "ip" then
  7854.                 message = "[" .. admins[k][3] .. "] " .. k .. "  :  Hash Admin and IP Admin"
  7855.             elseif admins[k][1] == "hash" then
  7856.                 message = "[" .. admins[k][3] .. "] " .. k .. "  :  Hash Admin"
  7857.             elseif admins[k][2] == "ip" then
  7858.                 message = "[" .. admins[k][3] .. "] " .. k .. "  :  IP Admin"
  7859.             end
  7860.             sendresponse(message, command, executor)
  7861.         end
  7862.     else
  7863.         sendresponse("Invalid Syntax: " .. command, command, executor)
  7864.     end
  7865. end
  7866.  
  7867. function Command_VotekickAction(executor, command, action, count)
  7868.     if count == 1 then
  7869.         sendresponse("The current action for people who are votekicked is '" .. tostring(votekick_action) .. "'", command, executor)
  7870.         sendresponse("Valid actions are 'kick' and 'ban'", command, executor)
  7871.     elseif count == 2 and(action == "kick" or action == "ban") then
  7872.         sendresponse("The current VoteKick action has been changed to '" .. action .. "'", command, executor)
  7873.         votekick_action = tostring(action)
  7874.     else
  7875.         sendresponse("Invalid Syntax: " .. command .. " {action}", command, executor)
  7876.     end
  7877. end
  7878.  
  7879. function Command_VotekickEnabled(executor, command, boolean, count)
  7880.     if count == 1 then
  7881.         if votekick_allowed then
  7882.             sendresponse("VoteKick is currently on", command, executor)
  7883.         else
  7884.             sendresponse("VoteKick is currently off", command, executor)
  7885.         end
  7886.     elseif count == 2 then
  7887.         if (boolean == "1" or boolean == "true") and votekick_allowed ~= true then
  7888.             votekick_allowed = true
  7889.             if rtv_required == nil then
  7890.                 rtv_required = 0.7
  7891.             end
  7892.             sendresponse("VoteKick is now enabled The default percentage needed is 70%.", command, executor)
  7893.             sendresponse("Change this with sv_votekick_needed", command, executor)
  7894.         elseif (boolean == "1" or boolean == "true") and votekick_allowed == true then
  7895.             sendresponse("VoteKick is already enabled", command, executor)
  7896.         elseif (boolean == "0" or boolean == "false") and votekick_allowed ~= false then
  7897.             votekick_allowed = false
  7898.             sendresponse("VoteKick is now disabled", command, executor)
  7899.         elseif votekick_allowed == nil then
  7900.             votekick_allowed = false
  7901.             sendresponse("VoteKick is now disabled", command, executor)
  7902.         elseif (boolean == "0" or boolean == "false") and votekick_allowed == false then
  7903.             sendresponse("VoteKick is already disabled", command, executor)
  7904.         else
  7905.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  7906.         end
  7907.     else
  7908.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  7909.     end
  7910. end
  7911.  
  7912. function Command_VotekickRequired(executor, command, percent, count)
  7913.     if count == 1 then
  7914.         if votekick_required == nil then votekick_required = 0.7 end
  7915.         sendresponse(tostring(votekick_required * 100) .. "% votes required for VoteKick", command, executor)
  7916.     elseif count == 2 and tonumber(percent) then
  7917.         if tonumber(percent) <= 1 then
  7918.             sendresponse("Votes required for VoteKick has been set to " .. tonumber(percent) * 100 .. "%", command, executor)
  7919.             votekick_required = tonumber(percent)
  7920.         end
  7921.     else
  7922.         sendresponse("Invalid Syntax: " .. command .. " [votes required (as a decimal)]", command, executor)
  7923.     end
  7924. end
  7925.  
  7926. function Command_WelcomeBackMessage(executor, command, boolean, count)
  7927.     if count == 1 then
  7928.         if wb_message then
  7929.             sendresponse("Welcome Back Message is currently on", command, executor)
  7930.         else
  7931.             sendresponse("Welcome Back Message is currently off", command, executor)
  7932.         end
  7933.     elseif count == 2 then
  7934.         if (boolean == "1" or boolean == "true") and wb_message ~= true then
  7935.             wb_message = true
  7936.             sendresponse("Welcome Back Message is now enabled", command, executor)
  7937.         elseif (boolean == "1" or boolean == "true") and wb_message == true then
  7938.             sendresponse("Welcome Back Message is already enabled", command, executor)
  7939.         elseif (boolean == "0" or boolean == "false") and wb_message ~= false then
  7940.             wb_message = false
  7941.             sendresponse("Welcome Back Message is now disabled", command, executor)
  7942.         elseif wb_message == nil then
  7943.             wb_message = false
  7944.             sendresponse("Welcome Back Message is now disabled", command, executor)
  7945.         elseif (boolean == "0" or boolean == "false") and wb_message == false then
  7946.             sendresponse("Welcome Back Message is already disabled", command, executor)
  7947.         else
  7948.             sendresponse("Error 009: Invalid Boolean: 0 for false, 1 for true", command, executor)
  7949.         end
  7950.     else
  7951.         sendresponse("Invalid Syntax: " .. command .. " {boolean}", command, executor)
  7952.     end
  7953. end
  7954.  
  7955. function Command_Write(executor, command, type, struct, offset, value, player, count)
  7956.     local offset = tonumber(offset)
  7957.     if count > 4 and count < 7 and tonumber(type) == nil and tonumber(struct) == nil and offset then
  7958.         local players = getvalidplayers(player, executor)
  7959.         if players then
  7960.             for i = 1, #players do
  7961.                 local m_objectId = getplayerobjectid(players[i])
  7962.                 if m_objectId then
  7963.                     if struct == "player" then
  7964.                         struct = getplayer(players[i])
  7965.                     elseif struct == "object" then
  7966.                         struct = getobject(m_objectId)
  7967.                         if struct == nil then sendresponse(getname(players[i]) .. " is not alive.", command, executor) return end
  7968.                     elseif getobject(m_objectId) == nil then
  7969.                         sendresponse(getname(players[i]) .. " is not alive.", command, executor)
  7970.                         return
  7971.                     elseif struct == "weapon" then
  7972.                         local m_object = getobject(m_objectId)
  7973.                         struct = getobject(readdword(m_object + 0x118))
  7974.                         if struct == nil then sendresponse(getname(players[i]) .. " is not holding a weapon", command, executor) return end
  7975.                     elseif tonumber(struct) == nil then
  7976.                         sendresponse("Invalid Struct. Valid structs are: player, object, and weapon", command, executor)
  7977.                         return
  7978.                     end
  7979.                 end
  7980.                 if value then
  7981.                     if type == "byte" then
  7982.                         writebyte(struct + offset, value)
  7983.                     elseif type == "float" then
  7984.                         writefloat(struct + offset, value)
  7985.                     elseif type == "word" then
  7986.                         writeword(struct + offset, value)
  7987.                     elseif type == "dword" then
  7988.                         writedword(struct + offset, value)
  7989.                     else
  7990.                         sendresponse("Error 010: Invalid Type. Valid types are byte, float, word, and dword", command, executor)
  7991.                         return
  7992.                     end
  7993.                     sendresponse("Writing " .. tostring(value) .. " to struct " .. tostring(struct) .. " at offset " .. tostring(offset) .. " was a success", command, executor)
  7994.                 end
  7995.             end
  7996.         else
  7997.             sendresponse("Error 005: Invalid Player", command, executor)
  7998.         end
  7999.     else
  8000.         sendresponse("Invalid Syntax: " .. command .. " [type] [struct] [offset] [value] [player]", command, executor)
  8001.     end
  8002. end
  8003.  
  8004. function Command_getlocation(executor, command, player, count)
  8005.     if count == 2 then
  8006.         local players = getvalidplayers(player, executor)
  8007.         if players then
  8008.             for i = 1, #players do
  8009.                 local ip = tostring(getip(players[i]))
  8010.                 if ip ~= "127.0.0.1" and string.sub(ip, 1, 7) ~= "192.168" then
  8011.                     local b = http.request(tostring(requestprefex) .. "geoip&i=" .. ip)
  8012.                     if b:find("GEOLOCATION") then
  8013.                         local field = tokenizestring(b, ";")
  8014.                         local countrycode = field[2]
  8015.                         local country = field[3]
  8016.                         local region = field[4]
  8017.                         local city = field[5]
  8018.                         local isp = field[6]
  8019.                         sendresponse(getname(players[i]) .. " ~ Country: " .. country .. " | Region: " .. region .. " | City: " .. city .. " | ISP: " .. isp, command, executor)
  8020.                     else
  8021.                         Write_Error("on Command_getlocation - " .. tostring(b))
  8022.                         sendresponse("GeoLocation server offline", command, executor)
  8023.                     end
  8024.                 else
  8025.                     sendresponse("Invalid IP - " .. ip, command, executor)
  8026.                 end
  8027.             end
  8028.         else
  8029.             sendresponse("Error 005: Invalid Player", command, executor)
  8030.         end
  8031.     else
  8032.         sendresponse("Invalid Syntax: " .. command .. " [player]", command, executor)
  8033.     end
  8034. end
  8035.  
  8036. function AccessMerging()
  8037.     for i = 0, #Access_Table do
  8038.         if Access_Table[i] ~= -1 then
  8039.             if string.find(Access_Table[i], ",sv_kick,") then
  8040.                 Access_Table[i] = Access_Table[i] .. ",sv_k"
  8041.             end
  8042.             if string.find(Access_Table[i], ",sv_admin_cur,") then
  8043.                 Access_Table[i] = Access_Table[i] .. ",sv_viewadmins"
  8044.             end
  8045.             if string.find(Access_Table[i], ",sv_admin") then
  8046.                 Access_Table[i] = Access_Table[i] .. ",sv_a"
  8047.             end
  8048.             if string.find(Access_Table[i], ",sv_setafk,") then
  8049.                 Access_Table[i] = Access_Table[i] .. ",sv_afk"
  8050.             end
  8051.             if string.find(Access_Table[i], ",sv_setammo,") then
  8052.                 Access_Table[i] = Access_Table[i] .. ",sv_ammo"
  8053.             end
  8054.             if string.find(Access_Table[i], ",sv_ban,") then
  8055.                 Access_Table[i] = Access_Table[i] .. ",sv_b"
  8056.             end
  8057.             if string.find(Access_Table[i], ",sv_setinvis,") then
  8058.                 Access_Table[i] = Access_Table[i] .. ",sv_invis"
  8059.             end
  8060.             if string.find(Access_Table[i], ",sv_map,") then
  8061.                 Access_Table[i] = Access_Table[i] .. ",sv_m"
  8062.             end
  8063.             if string.find(Access_Table[i], ",sv_mapcycle_begin,") then
  8064.                 Access_Table[i] = Access_Table[i] .. ",sv_mc"
  8065.             end
  8066.             if string.find(Access_Table[i], ",sv_map_next,") then
  8067.                 Access_Table[i] = Access_Table[i] .. ",sv_mnext"
  8068.             end
  8069.             if string.find(Access_Table[i], ",sv_players,") then
  8070.                 Access_Table[i] = Access_Table[i] .. ",sv_pl"
  8071.             end
  8072.             if string.find(Access_Table[i], ",sv_map_reset,") then
  8073.                 Access_Table[i] = Access_Table[i] .. ",sv_reset"
  8074.             end
  8075.             if string.find(Access_Table[i], ",sv_password,") then
  8076.                 Access_Table[i] = Access_Table[i] .. ",sv_pass"
  8077.             end
  8078.             if string.find(Access_Table[i], ",sv_admin_del,") then
  8079.                 Access_Table[i] = Access_Table[i] .. ",sv_revoke"
  8080.             end
  8081.             if string.find(Access_Table[i], ",sv_respawn_time,") then
  8082.                 Access_Table[i] = Access_Table[i] .. ",sv_setresp"
  8083.             end
  8084.             if string.find(Access_Table[i], ",sv_teleport_add,") then
  8085.                 Access_Table[i] = Access_Table[i] .. ",sv_st"
  8086.             end
  8087.             if string.find(Access_Table[i], ",sv_teleport") then
  8088.                 Access_Table[i] = Access_Table[i] .. ",sv_t"
  8089.             end
  8090.             if string.find(Access_Table[i], ",sv_changeteam,") then
  8091.                 Access_Table[i] = Access_Table[i] .. ",sv_ts"
  8092.             end
  8093.             if string.find(Access_Table[i], ",sv_teleport_pl,") then
  8094.                 Access_Table[i] = Access_Table[i] .. ",sv_tp"
  8095.             end
  8096.             if string.find(Access_Table[i], ",sv_control,") then
  8097.                 Access_Table[i] = Access_Table[i] .. ",sv_c"
  8098.             end
  8099.             if string.find(Access_Table[i], ",sv_follow,") then
  8100.                 Access_Table[i] = Access_Table[i] .. ",sv_f"
  8101.             end
  8102.             if string.find(Access_Table[i], ",sv_cheat_hax,") then
  8103.                 Access_Table[i] = Access_Table[i] .. ",sv_hax"
  8104.             end
  8105.             if string.find(Access_Table[i], ",sv_cheat_unhax,") then
  8106.                 Access_Table[i] = Access_Table[i] .. ",sv_unhax"
  8107.             end
  8108.             if string.find(Access_Table[i], ",sv_infinite_ammo,") then
  8109.                 Access_Table[i] = Access_Table[i] .. ",sv_infammo"
  8110.             end
  8111.             if string.find(Access_Table[i], ",sv_move,") then
  8112.                 Access_Table[i] = Access_Table[i] .. ",sv_j"
  8113.             end
  8114.             if string.find(Access_Table[i], ",sv_scrim,") then
  8115.                 Access_Table[i] = Access_Table[i] .. ",sv_lo3"
  8116.             end
  8117.             if string.find(Access_Table[i], ",sv_setspeed,") then
  8118.                 Access_Table[i] = Access_Table[i] .. ",sv_spd"
  8119.             end
  8120.             if string.find(Access_Table[i], ",sv_time_cur,") then
  8121.                 Access_Table[i] = Access_Table[i] .. ",sv_timelimit"
  8122.             end
  8123.             if string.find(Access_Table[i], ",sv_setgod,") and not string.find(Access_Table[i], ",sv_god,") then
  8124.                 Access_Table[i] = Access_Table[i] .. ",sv_god"
  8125.             end
  8126.             if Access_Table[i] ~= -1 then
  8127.                 if not Access_Table or not Access_Table[i] or not Access_Table[i]:len() then hprintf("Access.ini IS INCORRECTLY FORMATTED") return end
  8128.                 if string.sub(Access_Table[i], Access_Table[i]:len(), Access_Table[i]:len()) ~= "," then
  8129.                     Access_Table[i] = Access_Table[i] .. ","
  8130.                 end
  8131.             end
  8132.         end
  8133.     end
  8134. end
  8135.  
  8136. function BanReason(message)
  8137.     WriteLog(profilepath .. "\\logs\\Ban Reasons.log", tostring(message))
  8138. end
  8139.  
  8140. function cmderrors(message)
  8141.     WriteLog(profilepath .. "\\logs\\Command Script Errors.log", tostring(message))
  8142. end
  8143.  
  8144. function cmdlog(message)
  8145.     WriteLog(profilepath .. "\\logs\\Rcon Commands.log", tostring(message))
  8146. end
  8147.  
  8148. function checkaccess(Command, ACCESS, player, type)
  8149.     if Command and tonumber(ACCESS) >= 0 then
  8150.         local command_list = Access_Table[tonumber(ACCESS)]
  8151.         local command = Command:gsub("/", "sv_")
  8152.         if command_list == -1 or command_list == "data=-1" then
  8153.             return true
  8154.         else
  8155.             local found = command_list:find("," .. command .. ",")
  8156.             if found then
  8157.                 return true
  8158.             end
  8159.         end
  8160.     else
  8161.         hprintf("Error 012: Missing command")
  8162.     end
  8163.     return false
  8164. end
  8165.  
  8166. function CheckAccess(executor, command, player, ACCESS, type)
  8167.     if tonumber(player) and admin_blocker > 0 and command and tonumber(ACCESS) then
  8168.         local access_player = getaccess(tonumber(player))
  8169.         if access_player then
  8170.             local Command = getvalidformat(command)
  8171.             for i = 0, #command_access do
  8172.                 if Command == command_access[i] then
  8173.                     if admin_blocker == 1 and ACCESS > access_player then
  8174.                         return false
  8175.                     elseif admin_blocker == 2 and ACCESS >= access_player then
  8176.                         return false
  8177.                     elseif admin_blocker == 3 and Access_Table[tonumber(ACCESS)] == -1 then
  8178.                         return false
  8179.                     end
  8180.                 end
  8181.             end
  8182.         end
  8183.     end
  8184.     return true
  8185. end
  8186.  
  8187. function Check_Sphere(m_objectId, X, Y, Z, R)
  8188.     local Pass = false
  8189.     if getobject(m_objectId) then
  8190.         local x, y, z = getobjectcoords(m_objectId)
  8191.         if (X - x) ^ 2 +(Y - y) ^ 2 +(Z - z) ^ 2 <= R then
  8192.             Pass = true
  8193.         end
  8194.     end
  8195.     return Pass
  8196. end
  8197.  
  8198. function cleanupdrones(player)
  8199.     if getplayer(player) then
  8200.         if Vehicle_Drone_Table[player] then
  8201.             for k, v in pairs(Vehicle_Drone_Table[player]) do
  8202.                 if v then
  8203.                     local v_object = getobject(v)
  8204.                     if v_object then
  8205.                         destroyobject(v)
  8206.                     end
  8207.                 end
  8208.                 Vehicle_Drone_Table[player][k] = nil
  8209.             end
  8210.         end
  8211.     end
  8212. end
  8213. socket = require("socket")
  8214. function DefaultSvTimer(id, count, filename, time)
  8215.     local ip = getip
  8216.     local ServerPort =(readdword(address))
  8217.     local timestamp = os.date("%I:%M:%S%p  -  %A %d %Y")
  8218.     local defaults_lines = #DEFAULTTXT_COMMANDS
  8219.     local temp_lines = 0
  8220.     local file = io.open(filename)
  8221.     local temp_commands_executed = { }
  8222.     if file then
  8223.         for line in file:lines() do
  8224.             svcmd(tostring(line))
  8225.             temp_lines = temp_lines + 1
  8226.             local temp = tokenizecmdstring(tostring(line))
  8227.             temp_commands_executed[temp_lines] = temp[1]
  8228.         end
  8229.         file:close()
  8230.         if filename == "temp_" .. tostring(processid) .. ".tmp" then
  8231.             os.remove(filename)
  8232.         end
  8233.     elseif filename == "Defaults.txt" then
  8234.         file = io.open("Defaults.txt", "a")
  8235.         hprintf("       >> Defaults.txt not found. File will be created...")
  8236.         for i = 0, defaults_lines + 1 do
  8237.             if DEFAULTTXT_COMMANDS[i] then
  8238.                 svcmd(DEFAULTTXT_COMMANDS[i])
  8239.                 file:write(DEFAULTTXT_COMMANDS[i] .. "\n")
  8240.             end
  8241.         end
  8242.         file:close()
  8243.         temp_lines = defaults_lines
  8244.     elseif filename == "Persistent" then
  8245.         for i = 1, #DEFAULTTXT_COMMANDS do
  8246.             local t = tokenizestring(DEFAULTTXT_COMMANDS[i], " ")
  8247.             svcmd(t[1])
  8248.         end
  8249.     end
  8250.     local response = svcmd("sv_hash_check", true)
  8251.     if string.find(response[1], "enabled") then
  8252.         Command_Hashcheck("true")
  8253.     else
  8254.         Command_Hashcheck("false")
  8255.     end
  8256.     local response = svcmd("sv_version_check", true)
  8257.     if string.find(response[1], "enabled") then
  8258.         Command_Versioncheck("true")
  8259.     else
  8260.         Command_Versioncheck("false")
  8261.     end
  8262.     svcmd("sv_admin_check false")
  8263.     if filename ~= "Persistent" then
  8264.         if temp_lines < defaults_lines and temp_commands_executed then
  8265.             FinishRemaining(defaults_lines, temp_lines, temp_commands_executed)
  8266.             respond("")
  8267.             respond("")
  8268.             respond("")
  8269.         end
  8270.     end
  8271.     respond("")
  8272.     respond("-----] ignore the duplicate commands above [-----")
  8273.     respond("")
  8274.     respond("===================================================================================================")
  8275.     respond("                  '||'                  ||     ..|'''.|                   .'|.   .")
  8276.     respond("                   ||    ....  ... ..  ...   .|'     '  ... ..   ....   .||.   .||.")
  8277.     respond("                   ||  .|...||  ||' ''  ||   ||          ||' '' '' .||   ||     ||")
  8278.     respond("                   ||  ||       ||      ||   '|.      .  ||     .|' ||   ||     ||")
  8279.     respond("               || .|'   '|...' .||.    .||.   ''|....'  .||.    '|..'|' .||.    '|.'")
  8280.     respond("                '''")
  8281.     respond("                      ->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-")
  8282.     respond("                                         Chalwk's Realm")
  8283.     respond("                         Chalwk's Realm | Classic Snipers (original)")
  8284.     respond("                      ->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-")
  8285.     respond("")
  8286.     respond("[]  Server Name: " .. server_name)
  8287.     respond("[]  Server Port: " .. ServerPort)
  8288.     respond("[]  Local IP: " .. LocalIp)
  8289.     respond("[]  Public IP: " .. PublicIp)
  8290.     respond("[]  Commands Script Version: " .. Script_Version)
  8291.     respond("[]  Game Version: " .. GAME)
  8292.     respond("[]  Date & Time " .. timestamp)
  8293.     respond("[]  GameMode: " .. Game_Mode)
  8294.     respond("[]  Broadcasting on all frequencies: 1.00 - 1.10")
  8295.     respond("")
  8296.     respond("-<->-<->-<->-<->-<- ] REMOTE ACCESS [ -<->-<->-<->-<->-<-")
  8297.     respond("Public IP Address: " .. PublicIp)
  8298.     respond("Username: " .. RCUserName)
  8299.     respond("Password: " .. RCPassword)
  8300.     respond("* Remote Access requires the server to be live (publicly accessible).")
  8301.  
  8302.     -- No Longer Needed!
  8303.     -- if not changelog then
  8304.     --  respond("       >> Change log Version " ..Script_Version.. " is being written...")
  8305.     -- end
  8306.  
  8307.     if access_error then
  8308.         respond(">> Access.ini is not setup correctly")
  8309.     end
  8310.     respond("===================================================================================================")
  8311.     -- registertimer(0, "DeleteAdmins")
  8312.     timer = registertimer(970, "Timer")
  8313.     return false
  8314. end
  8315.  
  8316. function readstring(address, length, endian)
  8317.     local char_table = { }
  8318.     local string = ""
  8319.     local offset = offset or 0x0
  8320.     if length == nil then
  8321.         if readbyte(address + offset + 1) == 0 and readbyte(address + offset) ~= 0 then
  8322.             length = 51000
  8323.         else
  8324.             length = 256
  8325.         end
  8326.     end
  8327.     for i = 0, length do
  8328.         if readbyte(address +(offset + i)) ~= 0 then
  8329.             table.insert(char_table, string.char(readbyte(address +(offset + i))))
  8330.         elseif i % 2 == 0 and readbyte(address + offset + i) == 0 then
  8331.             break
  8332.         end
  8333.     end
  8334.     for k, v in pairs(char_table) do
  8335.         if endian == 1 then
  8336.             string = v .. string
  8337.         else
  8338.             string = string .. v
  8339.         end
  8340.     end
  8341.     return string
  8342. end
  8343.  
  8344. function DelayEject(id, count, player)
  8345.     exitvehicle(player)
  8346.     return false
  8347. end
  8348.  
  8349. function DeleteAdmins(id, count)
  8350.     local file = io.open(profilepath .. '\\Admin.txt', "r")
  8351.     if file then
  8352.         local file2 = io.open(profilepath .. "\\old-Admin.txt", "w")
  8353.         for line in file:lines() do
  8354.             words = tokenizestring(line, ",")
  8355.             svcmd("sv_admin_del " .. words[3])
  8356.             file2:write(line)
  8357.         end
  8358.         file2:close()
  8359.         file:close()
  8360.         os.remove(profilepath .. '\\Admin.txt')
  8361.     end
  8362.     return false
  8363. end
  8364.  
  8365. function DelayMessage(id, count, arguments)
  8366.     local msg = arguments[1]
  8367.     local command = tostring(arguments[2])
  8368.     local player = arguments[3]
  8369.     if string.sub(command, 1, 1) == "/" then
  8370.         --  say( msg)
  8371.         privatesay(player, msg)
  8372.     elseif string.sub(command, 1, 1) == "\\" then
  8373.         privatesay(player, msg)
  8374.     elseif player ~= nil and player ~= -1 then
  8375.         sendconsoletext(player, msg)
  8376.     end
  8377.     return false
  8378. end
  8379.  
  8380. function endian(address, offset, length)
  8381.     local data_table = { }
  8382.     local data = ""
  8383.     for i = 0, length do
  8384.         local hex = string.format("%X", readbyte(address + offset + i))
  8385.         if tonumber(hex, 16) < 16 then
  8386.             hex = 0 .. hex
  8387.         end
  8388.         table.insert(data_table, hex)
  8389.     end
  8390.     for k, v in pairs(data_table) do
  8391.         data = v .. data
  8392.     end
  8393.     return data
  8394. end
  8395.  
  8396. function FinishRemaining(default, temp, table)
  8397.     hprintf("-------------------------------------------------------------------------------")
  8398.     hprintf("   >> The following command(s) has/have been set to default settings")
  8399.     hprintf("   >> Reason: Not located in the Defaults.txt<<")
  8400.     for i = 1, default do
  8401.         local bool = true
  8402.         local command = tokenizecmdstring(DEFAULTTXT_COMMANDS[i])
  8403.         for j = 1, temp do
  8404.             if table[j] == command[1] then
  8405.                 bool = false
  8406.                 break
  8407.             end
  8408.         end
  8409.         if bool then
  8410.             svcmd(DEFAULTTXT_COMMANDS[i])
  8411.         end
  8412.     end
  8413.     hprintf("-------------------------------------------------------------------------------")
  8414. end
  8415.  
  8416. function FollowTimer(id, count, arguments)
  8417.     local player = arguments[1]
  8418.     local player2 = arguments[2]
  8419.     if getplayer(player) and getplayer(player2) then
  8420.         local m_objectId = getplayerobjectid(player)
  8421.         local m_playerObjId = getplayerobjectid(player2)
  8422.         if m_objectId and m_playerObjId then
  8423.             if getplayer(player) and getobject(m_objectId) then
  8424.                 if getplayer(player2) and getobject(m_playerObjId) then
  8425.                     local m_object = getobject(m_playerObjId)
  8426.                     local m_Object = getobject(m_objectId)
  8427.                     if x == nil then
  8428.                         x, y, z = getobjectcoords(m_playerObjId)
  8429.                         movobjectcoords(m_objectId, x, y, z + 0.5)
  8430.                     end
  8431.                     local obj_x_vel = readfloat(m_object + 0x68)
  8432.                     local obj_y_vel = readfloat(m_object + 0x6C)
  8433.                     local obj_z_vel = readfloat(m_object + 0x70)
  8434.                     writefloat(m_Object + 0x68, obj_x_vel)
  8435.                     writefloat(m_Object + 0x6C, obj_y_vel)
  8436.                     writefloat(m_Object + 0x70, obj_z_vel)
  8437.                 elseif getplayer(player2) then
  8438.                     x, y, z = nil
  8439.                 else
  8440.                     local id = resolveplayer(player)
  8441.                     follow[id] = nil
  8442.                     return false
  8443.                 end
  8444.             end
  8445.         end
  8446.     else
  8447.         return false
  8448.     end
  8449.     return true
  8450. end
  8451.  
  8452. function getaccess(player)
  8453.     if player and getplayer(player) then
  8454.         local hash = gethash(player)
  8455.         local ip = getip(player)
  8456.         local hash2
  8457.         local ip2
  8458.         if Players_List[player] then
  8459.             hash2 = Players_List[player].hash
  8460.             ip2 = Players_List[player].ip
  8461.         end
  8462.         if hash and ip then
  8463.             if Admin_Table[hash] then
  8464.                 return tonumber(Admin_Table[hash].level)
  8465.             elseif IpAdmins[ip] then
  8466.                 return tonumber(IpAdmins[ip].level)
  8467.             elseif Temp_Admins[ip] then
  8468.                 return 0
  8469.             end
  8470.         elseif hash2 and ip2 then
  8471.             if Admin_Table[hash2] then
  8472.                 return tonumber(Admin_Table[hash2].level)
  8473.             elseif IpAdmins[ip2] then
  8474.                 return tonumber(IpAdmins[ip2].level)
  8475.             end
  8476.         end
  8477.     end
  8478.     return
  8479. end
  8480.  
  8481. function GetGameAddresses(GAME)
  8482.     if GAME == "PC" then
  8483.         oddball_globals = 0x639E18
  8484.         slayer_globals = 0x63A0E8
  8485.         name_base = 0x745D4A
  8486.         specs_addr = 0x662D04
  8487.         hashcheck_addr = 0x59c280
  8488.         versioncheck_addr = 0x5152E7
  8489.         map_pointer = 0x63525c
  8490.         gametype_base = 0x671340
  8491.         gametime_base = 0x671420
  8492.         machine_pointer = 0x745BA0
  8493.         timelimit_address = 0x626630
  8494.         special_chars = 0x517D6B
  8495.         gametype_patch = 0x481F3C
  8496.         devmode_patch1 = 0x4A4DBF
  8497.         devmode_patch2 = 0x4A4E7F
  8498.         hash_duplicate_patch = 0x59C516
  8499.     else
  8500.         oddball_globals = 0x5BDEB8
  8501.         slayer_globals = 0x5BE108
  8502.         name_base = 0x6C7B6A
  8503.         specs_addr = 0x5E6E63
  8504.         hashcheck_addr = 0x530130
  8505.         versioncheck_addr = 0x4CB587
  8506.         map_pointer = 0x5B927C
  8507.         gametype_base = 0x5F5498
  8508.         gametime_base = 0x5F55BC
  8509.         machine_pointer = 0x6C7980
  8510.         timelimit_address = 0x5AA5B0
  8511.         special_chars = 0x4CE0CD
  8512.         gametype_patch = 0x45E50C
  8513.         devmode_patch1 = 0x47DF0C
  8514.         devmode_patch2 = 0x47DFBC
  8515.         hash_duplicate_patch = 0x5302E6
  8516.     end
  8517. end
  8518.  
  8519. function GetHelp(command)
  8520.     local response = ""
  8521.     if command == "sv_admin_add" or command == "sv_a" then
  8522.         response = "-- Admin Add\n-- Syntax: sv_admin_add [player or hash] [nickname] [level]\n-- Add's a player to the admin list via player number"
  8523.     elseif command == "sv_admin_del" then
  8524.         response = "-- Admin Delete\n-- Syntax: sv_admin_del [ID]\n-- Remove Admin\n"
  8525.     elseif command == "sv_revoke" then
  8526.         response = "-- Admin Revoke \n-- Syntax: sv_revoke [player]\n-- Remove admin via Hash and IP\n"
  8527.     elseif command == "sv_ipadminadd" or command == "sv_ipadminadd" then
  8528.         response = "-- IP Admin Add\n-- Syntax: sv_ipadminadd [player] [nickname] [level]\n-- Add admin via there IP instead of their hash."
  8529.     elseif command == "sv_ipadmindelete" or command == "sv_ipadmindelete" then
  8530.         response = "-- IP Admin Delete\n-- Syntax: sv_ipadmindelete [ID]\n-- Delete the selected IP admin from the admin list."
  8531.     elseif command == "sv_admin_list" or command == "sv_adminlist" then
  8532.         response = "-- Admin List\n-- Syntax: sv_admin_list\n-- Shows a list of all Admins"
  8533.     elseif command == "sv_viewadmins" then
  8534.         response = "-- Viewadmins\n-- Syntax: sv_viewadmins\n-- Shows Current Admins in the Server"
  8535.     elseif command == "sv_alias" then
  8536.         response = "-- Alias\n-- Syntax: sv_alias [player]\n-- Shows all names used with the hash"
  8537.     elseif command == "sv_map" then
  8538.         response = "-- Map Command\n-- Syntax: sv_map [map] [gametype] commands {script2} {script3}"
  8539.     elseif command == "sv_mc" then
  8540.         response = "-- Start MapCycle\n-- Syntax: sv_mc\n-- Shortcut for sv_mapcycle_begin"
  8541.     elseif command == "sv_mnext" then
  8542.         response = "-- Map Next\n-- Syntax: sv_mnext\n-- Shortcut for sv_map_next"
  8543.     elseif command == "sv_time_cur" then
  8544.         response = "-- Current Time\n-- Syntax: sv_time_cur {time}\n-- Displays remaining time in the match, and change the remaining time in the match"
  8545.     elseif command == "sv_reset" or command == "sv_mapreset" then
  8546.         response = "-- Map Reset\n-- Syntax: sv_reset\n-- Shortcut for sv_map_reset"
  8547.     elseif command == "sv_respawn_time" then
  8548.         response = "-- Respawn Time for Server\n-- Syntax: sv_respawn_time [time]\n-- Change the server's respawn time"
  8549.     elseif command == "sv_rtv_enabled" then
  8550.         response = "-- RTV Boolean\n-- Syntax: sv_rtv_enabled [boolean]\n-- Enable or disable RTV"
  8551.     elseif command == "sv_rtv_needed" then
  8552.         response = "-- RTV Needed\n-- Syntax: sv_rtv_needed [decimal 0 to 1]\n-- Change the number of votes needed for RTV to change the map."
  8553.     elseif command == "sv_specs" then
  8554.         response = "-- Specs\n-- Syntax: sv_specs\n-- Display the server specs (like processor, RAM, model, etc)"
  8555.     elseif command == "sv_votekick_enabled" then
  8556.         response = "-- VoteKick Boolean\n-- Syntax: sv_votekick_enabled [boolean]\n-- Allow you to enable or disable votekick, Boolean can be 0, false, 1, or true"
  8557.     elseif command == "sv_votekick_needed" then
  8558.         response = "-- Vote Kick Needed\n-- Syntax: sv_votekick_needed [decimal 0 to 1]\n-- Allow you to change the number of votes needed for VoteKick to kick the player."
  8559.     elseif command == "sv_votekick_action" then
  8560.         response = "-- Vote Kick Action\n-- Syntax: sv_votekick_action [kick/ban]\n-- Allows you to either ban or kick the player that has been voted out."
  8561.     elseif command == "sv_bos" then
  8562.         response = "-- Ban on Sight\n-- Syntax: sv_bos [player]\n-- Add the specified player to the Ban On Sight list."
  8563.     elseif command == "sv_boslist" then
  8564.         response = "-- Ban on Sight List\n-- Syntax: sv_boslist\n-- Display the Ban On Sight list"
  8565.     elseif command == "sv_unbos" then
  8566.         response = "-- Remove from Ban on Sight List\n-- Syntax: sv_unbos [ID]\n-- Remove selected index off of the ban on sight list"
  8567.     elseif command == "sv_cl" or command == "sv_change_level" then
  8568.         response = "-- Change Level Command\n-- Syntax: sv_change_level [nickname] {level}\n-- Change the specified admins' level"
  8569.     elseif command == "sv_ts" or command == "sv_changeteam" then
  8570.         response = "-- Change team Command\n-- Syntax: sv_changeteam [player]\n-- Change the specified players team"
  8571.     elseif command == "sv_ipban" then
  8572.         response = "-- IP Ban\n-- Syntax: sv_ipban [player or ip] {time} {message}\n-- Ban the specified player via their IP, not their hash"
  8573.     elseif command == "sv_ipbanlist" then
  8574.         response = "-- IP Ban List\n-- Syntax: sv_ipbanlist\n-- Display the IP banlist"
  8575.     elseif command == "sv_ipunban" then
  8576.         response = "-- IP Unban\n-- Syntax: sv_ipunban [ID]\n-- Remove selected index off of the IP banlist"
  8577.     elseif command == "sv_superban" then
  8578.         response = "-- Superban\n-- Syntax: sv_superban [player] {time} {message}\n-- Ban the selected player via hash and IP"
  8579.     elseif command == "sv_falldamage" then
  8580.         response = "-- Fall Damage\n-- Syntax: sv_falldamage [boolean]\n-- Enable/Disable the damage players receive from falling."
  8581.     elseif command == "sv_firstjoin_message" then
  8582.         response = "-- First Join Message\n-- Syntax: sv_firstjoin_message [boolean]\n-- Enable/Disable the First Join Message. So the message the very first time they join the server."
  8583.     elseif command == "sv_gethash" then
  8584.         response = "-- Get Hash\n-- Syntax: sv_gethash [player]\n-- Get the specified player's hash"
  8585.     elseif command == "sv_getip" then
  8586.         response = "-- Get IP\n-- Syntax: sv_getip [player]\n-- Get the specified playersIP address"
  8587.     elseif command == "sv_info" then
  8588.         response = "-- Info\n-- Syntax: sv_info [player]\n-- Returns a lot of info of the specified player"
  8589.     elseif command == "sv_deathless" then
  8590.         response = "-- Deathless\n-- Syntax: sv_deathless [boolean]\n-- Enable/Disable Deathless Player Mode.\n-- Boolean can be true or 1 for on, and false or 0 for off"
  8591.     elseif command == "sv_setafk" then
  8592.         response = "-- Set AFK\n-- Syntax: sv_setafk [player]\n-- Set the player to be AFK."
  8593.     elseif command == "sv_textban" then
  8594.         response = "-- Text Ban\n-- Syntax: sv_textban [player] {time} {message}\n-- Ban the specified people from the chat permanently"
  8595.     elseif command == "sv_textbanlist" then
  8596.         response = "-- Text Banlist\n-- Syntax: sv_textbanlist\n-- Display the text banlist"
  8597.     elseif command == "sv_textunban" then
  8598.         response = "-- Text Unban\n-- Syntax: sv_textunban [ID]\n--  Remove selected index off of the text banlist"
  8599.     elseif command == "sv_mute" then
  8600.         response = "-- Mute\n-- Syntax: sv_mute [player]\n-- Mute the specified players(For the match only). Admins cannot be muted"
  8601.     elseif command == "sv_unmute" then
  8602.         response = "-- Unmute\n-- Syntax: sv_unmute [player]\n-- Unmute the specified player."
  8603.     elseif command == "sv_getloc" then
  8604.         response = "-- Get Location\n-- Syntax: sv_getloc [player]\n-- Get the specified players' coordinates in the server"
  8605.     elseif command == "sv_lo3" or command == "sv_scrim" then
  8606.         response = "-- Live on Three \n-- Syntax: sv_scrim\n-- This command will reset the map 3 times"
  8607.     elseif command == "sv_say" then
  8608.         response = "-- Say\n-- Syntax: sv_say [message]\n-- This will allow you to s a message as the server"
  8609.     elseif command == "sv_infammo" or command == "sv_infinite_ammo" then
  8610.         response = "-- Infinite Ammo \n-- Syntax: sv_infinite_ammo [boolean]\n-- Enable or disable infinite ammo mode"
  8611.     elseif command == "sv_crash" then
  8612.         response = "-- Crash\n-- Syntax: sv_crash [player]\n-- This command will crash the players halo, This will not affect the server"
  8613.     elseif command == "sv_control" then
  8614.         response = "-- Control\n-- Syntax: sv_control [player_1] [player_2]\n-- Allows you to control a player. [player_2] is the player being controlled"
  8615.     elseif command == "sv_count" then
  8616.         response = "-- Count\n-- Syntax: sv_count\n-- It will display the number of unique users."
  8617.     elseif command == "sv_uniques_enabled" then
  8618.         response = "-- Unique Counting\n-- Syntax: sv_uniques_enabled \n-- Enables/Disables the Unique Counting feature."
  8619.     elseif command == "sv_eject" then
  8620.         response = "-- Eject\n-- Syntax: sv_eject [player]\n-- Force the specified players to exit their vehicle"
  8621.     elseif command == "sv_follow" then
  8622.         response = "-- Follow\n-- Syntax: sv_follow [player]\n-- Allows you to follow the specified player"
  8623.     elseif command == "sv_setgod" then
  8624.         response = "-- Set God\n-- Syntax: sv_setgod [player]\n-- Gives you a lot of health"
  8625.     elseif command == "sv_hax" or command == "sv_cheat_hax" then
  8626.         response = "-- Cheat Hax\n-- Syntax: sv_cheat_hax [player]\n-- Secret"
  8627.     elseif command == "sv_unhax" or command == "sv_cheat_unhax" then
  8628.         response = "-- Cheat Unhax\n-- Syntax: sv_cheat_unhax [player]\n-- Secret"
  8629.     elseif command == "sv_heal" then
  8630.         response = "-- Heal\n-- Syntax: sv_heal [player]\n-- Heal the specified players"
  8631.     elseif command == "sv_help" then
  8632.         response = "-- Help\n-- Syntax: sv_help [command]\n-- If you type a correct command, it will display its syntax and its function."
  8633.     elseif command == "sv_hide" then
  8634.         response = "-- Hide\n-- Syntax: sv_hide [player]\n-- You are invisible. Not Camo."
  8635.     elseif command == "sv_hitler" then
  8636.         response = "-- Hitler\n-- Syntax: sv_hitler [player]\n-- A letha injection is given to the specified player."
  8637.     elseif command == "sv_invis" then
  8638.         response = "-- Invis\n-- Syntax: sv_invis [player] {time}\n-- Give the specified player an invis/camo"
  8639.     elseif command == "sv_kill" then
  8640.         response = "-- Kill\n-- Syntax: sv_kill [player]\n-- Kills the Player."
  8641.     elseif command == "sv_killingspree" or command == "sv_killspree" then
  8642.         response = "-- Killing Spree Detection\n-- Syntax: sv_killspree [boolean]\n-- Enable/Disable Killing Spree Notifications"
  8643.     elseif command == "sv_launch" then
  8644.         response = "-- Launch\n-- Syntax: sv_launch [player]\n-- Launches the person in a random direction."
  8645.     elseif command == "sv_move" then
  8646.         response = "-- Move\n-- Syntax: sv_move [player] [x] [y] [z]\n-- Move the player by the set number of coords."
  8647.     elseif command == "sv_nameban" then
  8648.         response = "-- Name Ban\n-- Syntax: sv_nameban [player]\n-- Ban a person via their name"
  8649.     elseif command == "sv_namebanlist" then
  8650.         response = "-- Name Ban List\n-- Syntax: sv_namebanlist\n-- Lists the names banned"
  8651.     elseif command == "sv_nameunban" then
  8652.         response = "-- Name Unban\n-- Syntax: sv_nameunban [ID]\n--  Remove selected index off of the Name banlist"
  8653.     elseif command == "sv_noweapons" then
  8654.         response = "-- No Weapons\n-- Syntax: sv_noweapons [boolean]\n-- Enable/disable the use of weapons in a server."
  8655.     elseif command == "sv_os" then
  8656.         response = "-- OverShield\n-- Syntax: sv_os [player]\n-- Give specified players an overshield(os)"
  8657.     elseif command == "sv_privatemessaging" or command == "sv_pvtmessage" then
  8658.         response = "-- Private Messaging\n-- Syntax: sv_pvtmessage [boolean]\n-- Enable/Disable Private Messaging"
  8659.     elseif command == "sv_resetweapons" then
  8660.         response = "-- Reset Weapons\n-- Syntax: sv_resetweapons [player]\n-- Reset the weapons of the specified players"
  8661.     elseif command == "sv_serveradmin_message" then
  8662.         response = "-- Server Admin Message\n-- Syntax: sv_serveradmin_message [boolean]\n-- Enable/Disable Server Admin Message"
  8663.     elseif command == "sv_enter" then
  8664.         response = "-- Enter\n-- Syntax: sv_enter [vehicle] [player]\n-- Force specified player into specified vehicle"
  8665.     elseif command == "sv_spawn" then
  8666.         response = "-- Spawn\n-- Syntax: sv_spawn [object] [player]\n-- Spawns specified object near specified player"
  8667.     elseif command == "sv_give" then
  8668.         response = "-- Give\n-- Syntax: sv_give [object] [player]\n-- Gives specified player the specified weapon"
  8669.     elseif command == "sv_setammo" then
  8670.         response = "-- Set Ammo\n-- Syntax: sv_setammo [player] [type] [ammo]\n-- Set the ammo of the players specified\n-- Mode means type of ammo, use 1 for unloaded ammo and 2 for loaded ammo"
  8671.     elseif command == "sv_" then
  8672.         response = "-- Set Assists\n-- Syntax: sv_setassists [player] [assists]\n-- Set the assists for the specified players"
  8673.     elseif command == "sv_setcolor" then
  8674.         response = "-- Set Color\n-- Syntax: sv_setcolor [player] [color]\n-- Change the color of the selected player. Works on FFA Only"
  8675.     elseif command == "sv_setdeaths" then
  8676.         response = "-- Set Deaths\n-- Syntax: sv_setdeaths [player] [deaths]\n-- Set the deaths for the specified players"
  8677.     elseif command == "sv_setfrags" then
  8678.         response = "-- Set Frags\n-- Syntax: sv_setfrags [player] [frags]\n-- Set the frags for the specified players"
  8679.     elseif command == "sv_setmode" then
  8680.         response = "-- Mode\n-- Syntax: sv_setmode [player] [mode] {object(for spawngun)}\n-- Set the player into the specified mode, There are 4 modes. They are listed here:\n-- Portalgun\n-- Entergun\n-- Destroy, be very careful with this mode.\n-- Spawngun\n-- To turn your modes off, just do /setmode [player] none."
  8681.     elseif command == "sv_setscore" then
  8682.         response = "-- Set Score\n-- Syntax: sv_setscore [player] [score]\n-- Set the score for the specified players"
  8683.     elseif command == "sv_setplasmas" then
  8684.         response = "-- Set Plasmas\n-- Syntax: sv_setplasmas [player] [plasmas]\n-- Set the plasmas for the specified players"
  8685.     elseif command == "sv_spd" or command == "sv_setspeed" then
  8686.         response = "-- Set Speed\n-- Syntax: sv_setspeed [player] {speed}\n-- Allow you to view the selected players?speed and it will allow you to change it if you want"
  8687.     elseif command == "sv_pass" then
  8688.         response = "-- Password\n-- Syntax: sv_pass {password}\n-- Shortcut to change the server password."
  8689.     elseif command == "sv_resp" then
  8690.         response = "-- Respawn Time for Player\n-- Syntax: sv_resp [player] [time]\n-- Set the respawn time for the player (they must be dead)."
  8691.     elseif command == "sv_tbagdet" or command == "tbag" then
  8692.         response = "-- Tbag Detection\n-- Syntax: sv_tbagdet [boolean]\n-- Enable/Disable Tbagging"
  8693.     elseif command == "sv_tp" or command == "sv_teleport_pl" then
  8694.         response = "-- Teleport to Player\n-- Syntax: sv_teleport_pl [player_1] [player_2]\n-- Teleport player_1 to player_2"
  8695.     elseif command == "sv_suspend" then
  8696.         response = "-- Suspend\n-- Syntax: sv_suspend [player] {time}\n-- Suspend the specified players indefinitely, or for the specified time, \nby suspendingthat means they will not spawn"
  8697.     elseif command == "sv_takeweapons" then
  8698.         response = "-- Take Weapons\n-- Syntax: sv_takeweapons [player]\n-- Take all the weapons away from the specified player."
  8699.     elseif command == "sv_unban" then
  8700.         response = "-- Unban\n-- Syntax: sv_unban [ID]\n-- Unbans the specified player."
  8701.     elseif command == "sv_unhax" then
  8702.         response = "-- Cheat Unhax\n-- Syntax: sv_cheat_unhax [player]\n-- Unhaxs the specified player."
  8703.     elseif command == "sv_unhide" then
  8704.         response = "-- Unhide\n-- Syntax: sv_unhide [player]\n-- Unhides the specified player."
  8705.     elseif command == "sv_ungod" then
  8706.         response = "-- Ungod\n-- Syntax: sv_ungod [player]\n-- Ungods the specified player."
  8707.     elseif command == "sv_uninvis" then
  8708.         response = "-- Uninvis\n-- Syntax: sv_uninvis [player]\n-- Uninvises the specified player."
  8709.     elseif command == "sv_unsuspend" then
  8710.         response = "-- Unsusp\n-- Syntax: sv_unsuspend [player]\n-- Unsuspsend the specified player."
  8711.     elseif command == "sv_welcomeback_message" then
  8712.         response = "-- Welcome Back Message\n-- Syntax: sv_welcomeback_message [boolean]\n-- Enable/Disable Welcome Back Message"
  8713.     elseif command == "sv_write" then
  8714.         response = "-- Write\n-- Syntax: sv_write [type] [struct] [offset] [value] [player]\n-- Read the Guide for info on this command"
  8715.     elseif command == "sv_balance" then
  8716.         response = "-- Balance\n-- Syntax: sv_balance\n-- Balances Teams"
  8717.     elseif command == "sv_ pl" or command == "sv_players" then
  8718.         response = "-- Player list\n-- Syntax: sv_players\n-- sv_players command modified\n-- Shows Player ID, Player Name, and Player Team"
  8719.     elseif command == "sv_plmore" or command == "sv_players_more" then
  8720.         response = "-- Player list more\n-- Syntax: sv_players_more\n-- Shows Player ID, Player Name, Player Team, \nStatus(Admin/Regular), IP, and Hash"
  8721.     elseif command == "sv_stickman" then
  8722.         response = "-- Stickman Animation\n-- Syntax: sv_stickman\n"
  8723.     elseif command == "sv_kick" then
  8724.         response = "-- Kick\n-- Syntax: sv_kick [player] {message}\n-- Kicks the player out of the server with a reason written to the Player Kicks.log"
  8725.     elseif command == "sv_ban" then
  8726.         response = "-- Ban\n-- Syntax: sv_ban[player] {message} {time}\n-- Bans the player out of the server with a reason written to the BanReason.log"
  8727.     elseif command == "sv_chatcommands" then
  8728.         response = "-- ChatCommands\n-- Syntax: sv_chatcommands {boolean}\n-- Enables or Disables the chat commands in the sevrer"
  8729.     elseif command == "sv_login" then
  8730.         response = "-- Login\n-- Syntax: sv_login\n-- If there are no admins in the Admin_Table or IpAdmins then you will be able to login with this command\n so you are able to use Chat commands even without being a hash or IP admin, it is only temporary."
  8731.     elseif command == "sv_status" then
  8732.         response = "-- Status\n-- Syntax: sv_status\n-- Shows a list of all the Defaults.txt commands and their status."
  8733.     elseif command == "sv_adminblocker" then
  8734.         response = "-- Admin Blocker\n-- Syntax: sv_adminblocker {type}\n-- Enables, disables or limits the abiliy of an admin to kick/ban another admin"
  8735.     elseif command == "sv_anticaps" then
  8736.         response = "-- AntiCaps\n-- Syntax sv_anticaps {boolean} \n-- Enables or Disables the use of caps in the server"
  8737.     elseif command == "sv_antispam" then
  8738.         response = "-- AntiSpam\n-- Syntax sv_antispam {all | players | off} \n-- All = All Players\n-- Players = all players execept admins\n-- Off = Disables AntiSpam"
  8739.     elseif command == "sv_spammax" then
  8740.         response = "-- SpamMax\n-- Syntax: sv_spammax {value}\n-- Changes the max amount of messages that can be sent in 1 minute"
  8741.     elseif command == "sv_spamtimeout" then
  8742.         response = "-- SpamTimeout\n-- Syntax: sv_spamtimeout {time}\n-- Changes the time you are muted for spamming"
  8743.     elseif command == "sv_bosplayers" then
  8744.         response = "-- BosPlayers\n-- Syntax: sv_bosplayers\n-- Shows the available players that can be banned on sight."
  8745.     elseif command == "sv_scrimmode" then
  8746.         response = "-- Scrim Mode\n-- Syntax: sv_scrimmode {boolean}\n-- Enables/Disables the ability to you Cheat/Troll Commands."
  8747.     elseif command == "sv_credits" then
  8748.         response = "Version: " .. Script_Version .. " Credits: Aelite, Wizard, and Nuggets \nBase script created by: Smiley"
  8749.     elseif command == "sv_list" then
  8750.         response = "-- List\n-- Syntax: sv_list {page}\n-- Lists all commands"
  8751.     elseif command == "sv_pvtsay" then
  8752.         response = "-- Private Say\n--Syntax sv_pvtsay {player} {message}\n--Sends a private message to the specifed player"
  8753.     elseif command == "sv_cmds" then
  8754.         response = "-- Commands\n--Syntax sv_cmds\n-- Lists the commands you are allowed to executed"
  8755.     elseif command == "sv_setkills" then
  8756.         response = "-- Set Kills\n--Syntax sv_setkills {player}\n-- Sets the kills for the specified players"
  8757.     elseif command == "sv_setassists" then
  8758.         response = "-- Set Assists\n--Syntax sv_setassists {player}\n-- Sets the assists for the specified players"
  8759.     elseif command == "sv_addrcon" then
  8760.         response = "-- Add Rcon Password\n-- Syntax sv_addrcon [password] {level}\n--Allows the use of more than one rcon password in the server"
  8761.     elseif command == "sv_delrcon" then
  8762.         response = "-- Delete Rcon Password\n-- Syntax sv_delrcon {password}\n-- Deletes the rcon password."
  8763.     elseif command == "sv_rconlist" then
  8764.         response = "-- Rcon Password List\n-- Syntax sv_rconlist\n-- Lists all available rcon passwords except the main rcon password"
  8765.     elseif command == "sv_iprangebanlist" then
  8766.         response = "-- IP Range Ban list\n-- Syntax sv_iprangebanlist\n-- Lists all players IP range banned."
  8767.     elseif command == "sv_iprangeban" then
  8768.         response = "-- IP Range Ban\n-- Syntax sv_iprangeban [player or ip] {time} {message}\n-- Bans an entire IP Range Ex: 192.198.0.0 - 192.168.255.255"
  8769.     elseif command == "sv_iprangeunban" then
  8770.         response = "-- IP Range Unban\n-- Syntax sv_iprangeunban [ID]\n-- Remove selected index off of the IP Range banlist"
  8771.     elseif command == "sv_read" then
  8772.         response = "-- Read\n-- Syntax: sv_read [type] [struct] [offset] [value] [player]\n-- Read the Guide for info on this command"
  8773.     elseif command == "sv_load" then
  8774.         response = "-- Script Load\n-- Syntax: sv_load\n-- Shortcut for sv_script_load"
  8775.     elseif command == "sv_unload" then
  8776.         response = "-- Script Unload\n-- Syntax: sv_unload\n-- Shortcut for sv_script_unload"
  8777.     elseif command == "sv_resetplayer" then
  8778.         response = "-- Reset Player\n-- Syntax: sv_resetplayer [player]\n-- Removes all troll settings from specified player"
  8779.     elseif command == "sv_dmg" or command == "sv_damage" then
  8780.         response = "-- Damage Multiplier\n-- Syntax: sv_damage [player] [damage multiplier]\n-- Increases the amount of damage the player does."
  8781.     elseif command == "sv_hash_duplicates" then
  8782.         response = "-- Hash Duplicate Checking\n-- Syntax: sv_hash_duplicates {boolean}\n-- Enables/Disables the server from checking if the hash key is already in the server."
  8783.     elseif command == "sv_multiteam_vehicles" then
  8784.         response = "-- Multi Team Vehicles\n-- Syntax: sv_multiteam_vehicles {boolean}\n-- Enables/Disables the ability to enter a vehicle with another player in FFA."
  8785.     else
  8786.         return "Error 007: Invalid Command Use sv_list for list of commands"
  8787.     end
  8788.     return response .. "\n-- For more information check out the command script guide\n-- http://phasorscripts.wordpress.com/command-script-guide/"
  8789. end
  8790.  
  8791. function getobjecttag(m_objectId)
  8792.     if m_objectId then
  8793.         local m_object = getobject(m_objectId)
  8794.         if m_object then
  8795.             local object_map_id = readdword(m_object)
  8796.             local map_base = readdword(map_pointer)
  8797.             local map_tag_count = todec(endian(map_base, 0xC, 0x3))
  8798.             local tag_table_base = map_base + 0x28
  8799.             local tag_table_size = 0x20
  8800.             for i = 0,(map_tag_count - 1) do
  8801.                 local tag_id = todec(endian(tag_table_base, 0xC +(tag_table_size * i), 0x3))
  8802.                 if tag_id == object_map_id then
  8803.                     local tag_class = readstring(tag_table_base +(tag_table_size * i), 0x3, 1)
  8804.                     local tag_name_address = endian(tag_table_base, 0x10 +(tag_table_size * i), 0x3)
  8805.                     local tag_name = readtagname("0x" .. tag_name_address)
  8806.                     return tag_name, tag_class
  8807.                 end
  8808.             end
  8809.         end
  8810.     end
  8811. end
  8812.  
  8813. function getteamplay()
  8814.     if readbyte(gametype_base + 0x34) == 1 then
  8815.         return true
  8816.     else
  8817.         return false
  8818.     end
  8819. end
  8820.  
  8821. function getvalidformat(command)
  8822.     local Command
  8823.     if string.sub(command, 1, 1) == "\\" or string.sub(command, 1, 1) == "/" then
  8824.         Command = "sv_" .. string.sub(command, 2)
  8825.     elseif string.sub(command, 1, 1) ~= "\\" and string.sub(command, 1, 1) ~= "/" and string.sub(command, 0, 3) ~= "sv_" then
  8826.         Command = "sv_" .. command
  8827.     else
  8828.         Command = command
  8829.     end
  8830.     return Command
  8831. end
  8832.  
  8833. function getvalidplayers(expression, player)
  8834.     if Current_Players ~= 0 then
  8835.         local players = { }
  8836.         if expression == "*" then
  8837.             for i = 0, 15 do
  8838.                 if getplayer(i) then
  8839.                     table.insert(players, i)
  8840.                 end
  8841.             end
  8842.         elseif expression == "me" then
  8843.             if player ~= nil and player ~= -1 and player then
  8844.                 table.insert(players, player)
  8845.             end
  8846.         elseif string.sub(expression, 1, 3) == "red" then
  8847.             for i = 0, 15 do
  8848.                 if getplayer(i) and getteam(i) == 0 then
  8849.                     table.insert(players, i)
  8850.                 end
  8851.             end
  8852.         elseif string.sub(expression, 1, 4) == "blue" then
  8853.             for i = 0, 15 do
  8854.                 if getplayer(i) and getteam(i) == 1 then
  8855.                     table.insert(players, i)
  8856.                 end
  8857.             end
  8858.         elseif (tonumber(expression) or 0) >= 1 and(tonumber(expression) or 0) <= 16 then
  8859.             local expression = tonumber(expression)
  8860.             if rresolveplayer(expression) then
  8861.                 table.insert(players, rresolveplayer(expression))
  8862.             end
  8863.         elseif expression == "random" or expression == "rand" then
  8864.             if Current_Players == 1 and player ~= nil then
  8865.                 table.insert(players, player)
  8866.                 return players
  8867.             end
  8868.             local bool = false
  8869.             while not bool do
  8870.                 num = math.random(0, 15)
  8871.                 if getplayer(num) and num ~= player then
  8872.                     bool = true
  8873.                 end
  8874.             end
  8875.             table.insert(players, num)
  8876.         else
  8877.             for i = 0, 15 do
  8878.                 if getplayer(i) then
  8879.                     if string.wild(getname(i), expression) == true then
  8880.                         table.insert(players, i)
  8881.                     end
  8882.                 end
  8883.             end
  8884.         end
  8885.         if players[1] then
  8886.             return players
  8887.         end
  8888.     end
  8889.     return false
  8890. end
  8891.  
  8892. function hashtoplayer(hash)
  8893.     for i = 0, 15 do
  8894.         if getplayer(i) and gethash(i) == hash then return i end
  8895.     end
  8896. end
  8897.  
  8898. function Ipban(player, bool)
  8899.     local hash = gethash(player)
  8900.     svcmd("sv_ban " .. resolveplayer(player))
  8901.     if not bool then
  8902.         local file = io.open(profilepath .. "\\Banned.txt", "r")
  8903.         if file then
  8904.             local Lines = 0
  8905.             for line in file:lines() do
  8906.                 Lines = Lines + 1
  8907.                 if line and line ~= "" then
  8908.                     if string.find(line, hash) then
  8909.                         svcmd("sv_unban " .. Lines - 2)
  8910.                     end
  8911.                 end
  8912.             end
  8913.         end
  8914.     end
  8915. end
  8916.  
  8917. function lo3Timer(id, count)
  8918.     if gameend == true then return false end
  8919.     if count >= 3 then
  8920.         if Scrim_Mode then
  8921.             say("Scrim Mode is currently on")
  8922.         else
  8923.             say("Scrim Mode is currently off")
  8924.         end
  8925.         say("Start your match")
  8926.         svcmd("sv_map_reset")
  8927.         lo3_timer = nil
  8928.         return false
  8929.     else
  8930.         svcmd("sv_map_reset")
  8931.         return true
  8932.     end
  8933. end
  8934.  
  8935. -- The "tag_id" name such as "cyborg_tag_id" can be called anything.
  8936. function LoadTags()
  8937.     cyb_tag_id = gettagid("bipd", "revolution\\biped\\cyborg")
  8938.     cyborg_tag_id = gettagid("bipd", "characters\\cyborg_mp\\cyborg_mp")
  8939.     captain_tag_id = gettagid("bipd", "characters\\captain\\captain")
  8940.     cortana_tag_id = gettagid("bipd", "characters\\cortana\\cortana")
  8941.     cortana2_tag_id = gettagid("bipd", "characters\\cortana\\halo_enhanced\\halo_enhanced")
  8942.     crewman_tag_id = gettagid("bipd", "characters\\crewman\\crewman")
  8943.     elite_tag_id = gettagid("bipd", "characters\\elite\\elite")
  8944.     elite2_tag_id = gettagid("bipd", "characters\\elite\\elite special")
  8945.     engineer_tag_id = gettagid("bipd", "characters\\engineer\\engineer")
  8946.     flood_tag_id = gettagid("bipd", "characters\\flood_captain\\flood_captain")
  8947.     flood2_tag_id = gettagid("bipd", "characters\\flood_infection\\flood_infection")
  8948.  
  8949.     -- Equipment --
  8950.     camouflage_tag_id = gettagid("eqip", "powerups\\active camouflage")
  8951.     healthpack_tag_id = gettagid("eqip", "powerups\\health pack")
  8952.     overshield_tag_id = gettagid("eqip", "powerups\\over shield")
  8953.     doublespeed_tag_id = gettagid("eqip", "powerups\\double speed")
  8954.     fullspec_tag_id = gettagid("eqip", "powerups\\full-spectrum vision")
  8955.     fragnade_tag_id = gettagid("eqip", "weapons\\frag grenade\\frag grenade")
  8956.     plasmanade_tag_id = gettagid("eqip", "weapons\\plasma grenade\\plasma grenade")
  8957.     rifleammo_tag_id = gettagid("eqip", "powerups\\assault rifle ammo\\assault rifle ammo")
  8958.     needlerammo_tag_id = gettagid("eqip", "powerups\\needler ammo\\needler ammo")
  8959.     pistolammo_tag_id = gettagid("eqip", "powerups\\pistol ammo\\pistol ammo")
  8960.     rocketammo_tag_id = gettagid("eqip", "powerups\\rocket launcher ammo\\rocket launcher ammo")
  8961.     shotgunammo_tag_id = gettagid("eqip", "powerups\\shotgun ammo\\shotgun ammo")
  8962.     sniperammo_tag_id = gettagid("eqip", "powerups\\sniper rifle ammo\\sniper rifle ammo")
  8963.     flameammo_tag_id = gettagid("eqip", "powerups\\flamethrower ammo\\flamethrower ammo")
  8964.  
  8965.     -- Vehicles --
  8966.     banshee_tag_id = gettagid("vehi", "vehicles\\banshee\\banshee_mp")
  8967.     turret_tag_id = gettagid("vehi", "vehicles\\c gun turret\\c gun turret_mp")
  8968.     ghost_tag_id = gettagid("vehi", "vehicles\\ghost\\ghost_mp")
  8969.     rwarthog_tag_id = gettagid("vehi", "vehicles\\rwarthog\\rwarthog")
  8970.     scorpion_tag_id = gettagid("vehi", "vehicles\\scorpion\\scorpion_mp")
  8971.     warthog_tag_id = gettagid("vehi", "vehicles\\warthog\\mp_warthog")
  8972.     wraith_tag_id = gettagid("vehi", "vehicles\\wraith\\wraith")
  8973.     pelican_tag_id = gettagid("vehi", "vehicles\\pelican\\pelican")
  8974.     yohog_tag_id = gettagid("vehi", "vehicles\\yohog\\yohog")
  8975.     fhog_tag_id = gettagid("vehi", "vehicles\\fwarthog\\fwarthog")
  8976.  
  8977.     -- Weapons --
  8978.     assaultrifle_tag_id = gettagid("weap", "weapons\\assault rifle\\assault rifle")
  8979.     oddball_tag_id = gettagid("weap", "weapons\\ball\\ball")
  8980.     flag_tag_id = gettagid("weap", "weapons\\flag\\flag")
  8981.     flamethrower_tag_id = gettagid("weap", "weapons\\flamethrower\\flamethrower")
  8982.     gravityrifle_tag_id = gettagid("weap", "weapons\\gravity rifle\\gravity rifle")
  8983.     needler_tag_id = gettagid("weap", "weapons\\needler\\mp_needler")
  8984.     pistol_tag_id = gettagid("weap", "weapons\\pistol\\pistol")
  8985.     plasmapistol_tag_id = gettagid("weap", "weapons\\plasma pistol\\plasma pistol")
  8986.     plasmarifle_tag_id = gettagid("weap", "weapons\\plasma rifle\\plasma rifle")
  8987.     plasmacannon_tag_id = gettagid("weap", "weapons\\plasma_cannon\\plasma_cannon")
  8988.     rocketlauncher_tag_id = gettagid("weap", "weapons\\rocket launcher\\rocket launcher")
  8989.     shotgun_tag_id = gettagid("weap", "weapons\\shotgun\\shotgun")
  8990.     sniper_tag_id = gettagid("weap", "weapons\\sniper rifle\\sniper rifle")
  8991.     energysword_tag_id = gettagid("weap", "weapons\\energy sword\\energy sword")
  8992.     carbine_tag_id = gettagid("weap", "revolution\\weapons\\carbine\\carbine")
  8993.     revsniper_tag_id = gettagid("weap", "revolution\\weapons\\sniper\\revolution sniper")
  8994.     covspiker_tag_id = gettagid("weap", "cmt\\weapons\\covenant\\spiker\\spiker")
  8995.     covplasmarifle_tag_id = gettagid("weap", "cmt\\weapons\\covenant\\brute_plasma_rifle\\brute plasma rifle")
  8996.     covpp_tag_id = gettagid("weap", "cmt\\weapons\\covenant\\brute_plasma_pistol\\brute plasma pistol")
  8997.     covsmg_tag_id = gettagid("weap", "cmt\\weapons\\human\\smg\\silenced smg")
  8998.     covbr_tag_id = gettagid("weap", "cmt\\weapons\\human\\battle_rifle\\battle_rifle_specops")
  8999.  
  9000.     -- Projectiles --
  9001.     bansheebolt_tag_id = gettagid("proj", "vehicles\\banshee\\banshee bolt")
  9002.     bansheeblast_tag_id = gettagid("proj", "vehicles\\banshee\\mp_banshee fuel rod")
  9003.     turretfire_tag_id = gettagid("proj", "vehicles\\c gun turret\\mp gun turret")
  9004.     ghostbolt_tag_id = gettagid("proj", "vehicles\\ghost\\ghost bolt")
  9005.     tankshot_tag_id = gettagid("proj", "vehicles\\scorpion\\bullet")
  9006.     tankblast_tag_id = gettagid("proj", "vehicles\\scorpion\\tank shell")
  9007.     warthogshot_tag_id = gettagid("proj", "vehicles\\warthog\\bullet")
  9008.     rifleshot_tag_id = gettagid("proj", "weapons\\assault rifle\\bullet")
  9009.     flame_tag_id = gettagid("proj", "weapons\\flamethrower\\flame")
  9010.     needlerfire_tag_id = gettagid("proj", "weapons\\needler\\mp_needle")
  9011.     pistolshot_tag_id = gettagid("proj", "weapons\\pistol\\bullet")
  9012.     plasmapistolbolt_tag_id = gettagid("proj", "weapons\\plasma pistol\\bolt")
  9013.     plasmariflebolt_tag_id = gettagid("proj", "weapons\\plasma rifle\\bolt")
  9014.     plasmarifleblast_tag_id = gettagid("proj", "weapons\\plasma rifle\\charged bolt")
  9015.     plasmacannonshot_tag_id = gettagid("proj", "weapons\\plasma_cannon\\plasma_cannon")
  9016.     rocket_tag_id = gettagid("proj", "weapons\\rocket launcher\\rocket")
  9017.     shotgunshot_tag_id = gettagid("proj", "weapons\\shotgun\\pellet")
  9018.     snipershot_tag_id = gettagid("proj", "weapons\\sniper rifle\\sniper bullet")
  9019.  
  9020.     -- Globals --
  9021.     global_distanceId = gettagid("jpt!", "globals\\distance")
  9022.     global_fallingId = gettagid("jpt!", "globals\\falling")
  9023.  
  9024.     objects[1] = { "cyborg", "bipd", cyborg_tag_id }
  9025.     objects[2] = { "camo", "eqip", camouflage_tag_id }
  9026.     objects[3] = { "health", "eqip", healthpack_tag_id }
  9027.     objects[4] = { "overshield", "eqip", overshield_tag_id }
  9028.     objects[5] = { "fnade", "eqip", fragnade_tag_id }
  9029.     objects[6] = { "pnade", "eqip", plasmanade_tag_id }
  9030.     objects[7] = { "shee", "vehi", banshee_tag_id }
  9031.     objects[8] = { "turret", "vehi", turret_tag_id }
  9032.     objects[9] = { "ghost", "vehi", ghost_tag_id }
  9033.     objects[10] = { "rhog", "vehi", rwarthog_tag_id }
  9034.     objects[11] = { "tank", "vehi", scorpion_tag_id }
  9035.     objects[12] = { "hog", "vehi", warthog_tag_id }
  9036.     objects[13] = { "rifle", "weap", assaultrifle_tag_id }
  9037.     objects[14] = { "ball", "weap", oddball_tag_id }
  9038.     objects[15] = { "flag", "weap", flag_tag_id }
  9039.     objects[16] = { "flamethrower", "weap", flamethrower_tag_id }
  9040.     objects[17] = { "needler", "weap", needler_tag_id }
  9041.     objects[18] = { "pistol", "weap", pistol_tag_id }
  9042.     objects[19] = { "ppistol", "weap", plasmapistol_tag_id }
  9043.     objects[20] = { "prifle", "weap", plasmarifle_tag_id }
  9044.     objects[21] = { "frg", "weap", plasmacannon_tag_id }
  9045.     objects[22] = { "rocket", "weap", rocketlauncher_tag_id }
  9046.     objects[23] = { "shotgun", "weap", shotgun_tag_id }
  9047.     objects[24] = { "sniper", "weap", sniper_tag_id }
  9048.     objects[25] = { "sheebolt", "proj", bansheebolt_tag_id }
  9049.     objects[26] = { "sheerod", "proj", bansheeblast_tag_id }
  9050.     objects[27] = { "turretbolt", "proj", turretfire_tag_id }
  9051.     objects[28] = { "ghostbolt", "proj", ghostbolt_tag_id }
  9052.     objects[29] = { "tankshot", "proj", tankshot_tag_id }
  9053.     objects[30] = { "tankshell", "proj", tankblast_tag_id }
  9054.     objects[31] = { "hogshot", "proj", warthogshot_tag_id }
  9055.     objects[32] = { "rifleshot", "proj", rifleshot_tag_id }
  9056.     objects[33] = { "flame", "proj", flame_tag_id }
  9057.     objects[34] = { "needlershot", "proj", needlerfire_tag_id }
  9058.     objects[35] = { "pistolshot", "proj", pistolshot_tag_id }
  9059.     objects[36] = { "ppistolbolt", "proj", plasmapistolbolt_tag_id }
  9060.     objects[37] = { "priflebolt", "proj", plasmariflebolt_tag_id }
  9061.     objects[38] = { "priflecbolt", "proj", plasmarifleblast_tag_id }
  9062.     objects[39] = { "rocketproj", "proj", rocket_tag_id }
  9063.     objects[40] = { "shottyshot", "proj", shotgunshot_tag_id }
  9064.     objects[41] = { "snipershot", "proj", snipershot_tag_id }
  9065.     objects[42] = { "fuelrodshot", "proj", plasmacannonshot_tag_id }
  9066.     objects[43] = { "falldamage", "jpt", global_fallingId }
  9067.     objects[44] = { "distance", "jpt", global_distanceId }
  9068.     objects[45] = { "cyb", "bipd", cyb_tag_id }
  9069.     objects[46] = { "carbine", "weap", carbine_tag_id }
  9070.     objects[47] = { "revsniper", "weap", revsniper_tag_id }
  9071.     objects[48] = { "covspiker", "weap", covspiker_tag_id }
  9072.     objects[49] = { "covpr", "weap", covplasmarifle_tag_id }
  9073.     objects[50] = { "covpp", "weap", covpp_tag_id }
  9074.     objects[51] = { "covbr", "weap", covbr_tag_id }
  9075.     objects[52] = { "covsmg", "weap", covsmg_tag_id }
  9076.     objects[53] = { "yohog", "vehi", yohog_tag_id }
  9077.     objects[54] = { "fhog", "vehi", fhog_tag_id }
  9078. end
  9079.  
  9080. function MainTimer(id, count)
  9081.     if count % 10 == 0 then
  9082.         for i = 0, 15 do
  9083.             if getplayer(i) then
  9084.                 local ip = getip(i)
  9085.                 if Ghost_Table[ip] == true then
  9086.                     applycamo(i, 1)
  9087.                 elseif Ghost_Table[ip] and Ghost_Table[ip] > 0 then
  9088.                     applycamo(i, Ghost_Table[ip])
  9089.                     Ghost_Table[ip] = Ghost_Table[ip] -1
  9090.                 elseif Ghost_Table[ip] then
  9091.                     if Ghost_Table[ip] <= 0 then
  9092.                         Ghost_Table[ip] = nil
  9093.                     end
  9094.                 end
  9095.             end
  9096.  
  9097.         end
  9098.     end
  9099.     for i = 0, 15 do
  9100.         local m_player = getplayer(i)
  9101.         if m_player then
  9102.             local m_playerObjId = getplayerobjectid(i)
  9103.             if m_playerObjId then m_object = getobject(m_playerObjId) end
  9104.             if m_object then
  9105.                 local id = resolveplayer(i)
  9106.                 local x_aim = readfloat(m_object + 0x230)
  9107.                 local y_aim = readfloat(m_object + 0x234)
  9108.                 local z_aim = readfloat(m_object + 0x238)
  9109.                 local z = readfloat(m_player + 0x100)
  9110.                 local obj_forward = readfloat(m_object + 0x278)
  9111.                 local obj_left = readfloat(m_object + 0x27C)
  9112.                 if afk[id][1] == true then
  9113.                     afk[id][1] = x_aim
  9114.                     afk[id][2] = y_aim
  9115.                     afk[id][3] = z_aim
  9116.                     writebit(m_object + 0x10, 7, 1)
  9117.                 elseif afk[id][1] then
  9118.                     if x_aim ~= afk[id][1] or y_aim ~= afk[id][2] or z_aim ~= afk[id][3] or obj_forward ~= 0 or obj_left ~= 0 then
  9119.                         writebit(m_object + 0x10, 7, 0)
  9120.                         privateSay(i, "You are no longer afk")
  9121.                         afk[id] = { }
  9122.                     else
  9123.                         writefloat(m_player + 0x100, z - 1000)
  9124.                     end
  9125.                 elseif hidden[id] then
  9126.                     writefloat(m_player + 0x100, z - 1000)
  9127.                 end
  9128.             end
  9129.         end
  9130.     end
  9131.     return true
  9132.     -- end
  9133. end
  9134.  
  9135. function multiteamtimer(id, count, player)
  9136.     local m_player = getplayer(player)
  9137.     if m_player and multiteam_vehicles then
  9138.         writebyte(m_player + 0x20, 0)
  9139.     end
  9140.     return false
  9141. end
  9142.  
  9143. function nadeTimer(id, count)
  9144.     for c = 0, 15 do
  9145.         if getplayer(c) then
  9146.             local m_objectId = getplayerobjectid(c)
  9147.             if m_objectId then
  9148.                 local m_object = getobject(m_objectId)
  9149.                 if m_object then
  9150.                     writebyte(m_object + 0x31E, 3)
  9151.                     writebyte(m_object + 0x31F, 3)
  9152.                 end
  9153.             end
  9154.         end
  9155.     end
  9156.     if infammo then
  9157.         return true
  9158.     elseif infammo then
  9159.         return true
  9160.     end
  9161. end
  9162.  
  9163. function Readstring(address, length, endian)
  9164.     local char_table = { }
  9165.     local string = ""
  9166.     local offset = offset or 0x0
  9167.     if length == nil then
  9168.         if readbyte(address + offset + 1) == 0 and readbyte(address + offset) ~= 0 then
  9169.             length = 51000
  9170.         else
  9171.             length = 256
  9172.         end
  9173.     end
  9174.     for i = 0, length do
  9175.         if readbyte(address +(offset + i)) ~= 0 then
  9176.             table.insert(char_table, string.char(readbyte(address +(offset + i))))
  9177.         elseif i % 2 == 0 and readbyte(address + offset + i) == 0 then
  9178.             break
  9179.         end
  9180.     end
  9181.     for k, v in pairs(char_table) do
  9182.         if endian == 1 then
  9183.             string = v .. string
  9184.         else
  9185.             string = string .. v
  9186.         end
  9187.     end
  9188.     return string
  9189. end
  9190.  
  9191. function readtagname(address)
  9192.     local char_table = { }
  9193.     local i = 0
  9194.     local string = ""
  9195.     while readbyte(address + i) ~= 0 do
  9196.         table.insert(char_table, string.char(readbyte(address + i)))
  9197.         i = i + 1
  9198.     end
  9199.     for k, v in pairs(char_table) do
  9200.         string = string .. v
  9201.     end
  9202.     return string
  9203. end
  9204.  
  9205. function reloadadmins(id, count)
  9206.     local file = io.open(string.format("%s\\Admin.txt", profilepath), "r")
  9207.     if file then
  9208.         for line in file:lines() do
  9209.             local words = tokenizestring(line, ",")
  9210.             local count = #words
  9211.             if not Admin_Table[words[2]] then Admin_Table[words[2]] = { } end
  9212.             Admin_Table[words[2]].name = words[1]
  9213.             Admin_Table[words[2]].level = words[3]
  9214.             if count == 4 and tonumber(words[3]) then
  9215.                 if not IpAdmins[words[4]] then IpAdmins[words[4]] = { } end
  9216.                 IpAdmins[words[4]].name = words[1]
  9217.                 IpAdmins[words[4]].level = words[3]
  9218.             end
  9219.         end
  9220.         file:close()
  9221.     end
  9222.     file = io.open(profilepath .. "\\IP Admins.txt", "r")
  9223.     if file then
  9224.         for line in file:lines() do
  9225.             local words = tokenizestring(line, ",")
  9226.             local count = #words
  9227.             if not IpAdmins[words[2]] then IpAdmins[words[2]] = { } end
  9228.             IpAdmins[words[2]].name = words[1]
  9229.             IpAdmins[words[2]].level = words[3]
  9230.         end
  9231.         file:close()
  9232.     end
  9233.     return false
  9234. end
  9235.  
  9236. function resetweapons(player)
  9237.     if getplayer(player) then
  9238.         local m_objectId = getplayerobjectid(player)
  9239.         if m_objectId then
  9240.             local m_object = getobject(m_objectId)
  9241.             if m_object then
  9242.                 if getobject(readdword(m_object + 0x118)) then return end
  9243.                 local x = readfloat(m_object + 0x5C)
  9244.                 local y = readfloat(m_object + 0x60)
  9245.                 local z = readfloat(m_object + 0x64)
  9246.                 assignweapon(player, createobject(pistol_tag_id, 0, 60, false, x + 1.0, y, z + 2.0))
  9247.                 assignweapon(player, createobject(assaultrifle_tag_id, 0, 60, false, x + 1.0, y, z + 2.0))
  9248.             end
  9249.         end
  9250.     end
  9251. end
  9252.  
  9253. function round(val, decimal)
  9254.     if (decimal) then
  9255.         return math.floor((val * 10 ^ decimal) + 0.5) /(10 ^ decimal)
  9256.     else
  9257.         return math.floor(val + 0.5)
  9258.     end
  9259. end
  9260.  
  9261. function rtvTimer(id, count)
  9262.     if gameend == true then return false end
  9263.     if count == 1 then
  9264.         RTV_Initiated = RTV_Timout
  9265.         RTV_TABLE = { }
  9266.         say("The current RTV has expired")
  9267.         return false
  9268.     else
  9269.         return true
  9270.     end
  9271. end
  9272.  
  9273. function pack(...)
  9274.     local arg = { ...}
  9275.     return arg
  9276. end
  9277.  
  9278. function portalgunTimer(id, count, arg)
  9279.     local m_object = arg[1]
  9280.     if count == 100 then
  9281.         return false
  9282.     end
  9283.     if m_object then
  9284.         local obj_x_velocity = readfloat(m_object + 0x68)
  9285.         if obj_x_velocity == 0 then
  9286.             local x = readfloat(m_object + 0x5C)
  9287.             local y = readfloat(m_object + 0x60)
  9288.             local z = readfloat(m_object + 0x64)
  9289.             local m_playerobjId = getplayerobjectid(arg[2])
  9290.             if m_playerobjId then
  9291.                 movobjectcoords(m_playerobjId, x, y, z)
  9292.             end
  9293.             return false
  9294.         else
  9295.             return true
  9296.         end
  9297.     end
  9298.     return true
  9299. end
  9300. -----------------------------------------------------------------------------------------------------------
  9301. function say(message, script_prefix)
  9302.     if GAME == "PC" then
  9303.         phasor_say((script_prefix or default_script_prefix) .. " " .. message, false)
  9304.     else
  9305.         phasor_say(message, false)
  9306.     end
  9307. end
  9308. -----------------------------------------------------------------------------------------------------------
  9309. function privatesay(player, message, script_prefix)
  9310.     if GAME == "PC" then
  9311.         phasor_privatesay(player,(script_prefix or default_script_prefix) .. " " .. message, false)
  9312.     else
  9313.         phasor_privatesay(player, message, false)
  9314.     end
  9315. end
  9316. -----------------------------------------------------------------------------------------------------------
  9317. function Say(message, time, exception)
  9318.     time = time or 3
  9319.     for i = 0, 15 do
  9320.         if getplayer(i) and exception ~= i then
  9321.             privateSay(i, message, time)
  9322.         end
  9323.     end
  9324. end
  9325. -----------------------------------------------------------------------------------------------------------
  9326. function privateSay(player, message, time)
  9327.     local time = time or 3
  9328.     if message then
  9329.         sendconsoletext(player, message, time)
  9330.     end
  9331. end
  9332. -----------------------------------------------------------------------------------------------------------
  9333. function sendresponse(message, command, player, log)
  9334.     if message then
  9335.         if message == "" then
  9336.             return
  9337.         elseif type(message) == "table" then
  9338.             message = message[1]
  9339.         end
  9340.         player = tonumber(player)
  9341.         if command then
  9342.             if string.sub(command, 1, 1) == "/" then
  9343.                 local arguments = { message, command, player }
  9344.                 registertimer(0, "DelayMessage", arguments)
  9345.             elseif string.sub(command, 1, 1) == "\\" then
  9346.                 local arguments = { message, command, player }
  9347.                 registertimer(0, "DelayMessage", arguments)
  9348.             elseif tonumber(player) and player ~= nil and player ~= -1 and player >= 0 and player < 16 then
  9349.                 sendconsoletext(player, message)
  9350.             end
  9351.             hprintf(message)
  9352.             if log ~= false and player ~= nil and player ~= -1 and player then
  9353.                 cmdlog("Response to " .. getname(player) .. ": " .. message)
  9354.             end
  9355.         else
  9356.             hprintf("Internal Error Occurred Check the Command Script Errors log")
  9357.             cmderrors("Error Occurred at SendResponse: Information Available: " .. message)
  9358.         end
  9359.     end
  9360. end
  9361. -----------------------------------------------------------------------------------------------------------
  9362. function setscore(player, score)
  9363.     if tonumber(score) then
  9364.         if gametype == 1 then
  9365.             local m_player = getplayer(player)
  9366.             if score >= 0x7FFF then
  9367.                 writeword(m_player + 0xC8, 0x7FFF)
  9368.             elseif score <= -0x7FFF then
  9369.                 writeword(m_player + 0xC8, -0x7FFF)
  9370.             else
  9371.                 writeword(m_player + 0xC8, score)
  9372.             end
  9373.         elseif gametype == 2 then
  9374.             if score >= 0x7FFFFFFF then
  9375.                 writeword(slayer_globals + 0x40 + player * 4, 0x7FFFFFFF)
  9376.             elseif score <= -0x7FFFFFFF then
  9377.                 writeword(slayer_globals + 0x40 + player * 4, -0x7FFFFFFF)
  9378.             else
  9379.                 writeword(slayer_globals + 0x40 + player * 4, score)
  9380.             end
  9381.         elseif gametype == 3 then
  9382.             local oddball_game = readbyte(gametype_base + 0x8C)
  9383.             if oddball_game == 0 or oddball_game == 1 then
  9384.                 if score * 30 >= 0x7FFFFFFF then
  9385.                     writeword(oddball_globals + 0x84 + player * 4, 0x7FFFFFFF)
  9386.                 elseif score * 30 <= -0x7FFFFFFF then
  9387.                     writeword(oddball_globals + 0x84 + player * 4, -1 * 0x7FFFFFFF)
  9388.                 else
  9389.                     writeword(oddball_globals + 0x84 + player * 4, score * 30)
  9390.                 end
  9391.             else
  9392.                 if score > 0x7FFFFC17 then
  9393.                     writeword(oddball_globals + 0x84 + player * 4, 0x7FFFFC17)
  9394.                 elseif score <= -0x7FFFFC17 then
  9395.                     writeword(oddball_globals + 0x84 + player * 4, -0x7FFFFC17)
  9396.                 else
  9397.                     writeword(oddball_globals + 0x84 + player * 4, score)
  9398.                 end
  9399.             end
  9400.         elseif gametype == 4 then
  9401.             local m_player = getplayer(player)
  9402.             if score * 30 >= 0x7FFF then
  9403.                 writeword(m_player + 0xC4, 0x7FFF)
  9404.             elseif score * 30 <= -0x7FFF then
  9405.                 writeword(m_player + 0xC4, -0x7FFF)
  9406.             else
  9407.                 writeword(m_player + 0xC4, score * 30)
  9408.             end
  9409.         elseif gametype == 5 then
  9410.             local m_player = getplayer(player)
  9411.             if score >= 0x7FFF then
  9412.                 writeword(m_player + 0xC6, 0x7FFF)
  9413.             elseif score <= -0x7FFF then
  9414.                 writeword(m_player + 0xC6, -0x7FFF)
  9415.             else
  9416.                 writeword(m_player + 0xC6, score)
  9417.             end
  9418.         end
  9419.     end
  9420. end
  9421.  
  9422. function string.findchar(str, char)
  9423.     local chars = string.split(str, "")
  9424.     local indexes = { }
  9425.     for k, v in ipairs(chars) do
  9426.         if v == char then
  9427.             table.insert(indexes, k)
  9428.         end
  9429.     end
  9430.     return table.unpack(indexes)
  9431. end
  9432.  
  9433. function string.split(str, ...)
  9434.  
  9435.     local args = { ...}
  9436.  
  9437.     for k, v in ipairs(args) do
  9438.         if v == "" then
  9439.             local subs = { }
  9440.             for i = 1, string.len(str) do
  9441.                 table.insert(subs, string.sub(str, i, i))
  9442.             end
  9443.  
  9444.             return subs
  9445.         end
  9446.     end
  9447.  
  9448.     local subs = { }
  9449.     local sub = ""
  9450.     for i = 1, string.len(str) do
  9451.         local bool
  9452.         local char = string.sub(str, i, i)
  9453.         for k, v in ipairs(args) do
  9454.             local delim = string.sub(str, i -(string.len(v) -1), i)
  9455.             if v == delim then
  9456.                 bool = true
  9457.                 sub = string.sub(sub, 1, string.len(sub) -(string.len(v) -1))
  9458.                 if sub ~= "" then
  9459.                     table.insert(subs, sub)
  9460.                 end
  9461.                 sub = ""
  9462.                 break
  9463.             end
  9464.         end
  9465.  
  9466.         if not bool then
  9467.             sub = sub .. char
  9468.         end
  9469.  
  9470.         if i == string.len(str) then
  9471.             table.insert(subs, sub)
  9472.         end
  9473.     end
  9474.  
  9475.     return subs
  9476. end
  9477.  
  9478. function string.wild(match, wild, case_sensative)
  9479.     if not case_sensative then
  9480.         match, wild = string.lower(match), string.lower(wild)
  9481.     end
  9482.     if string.sub(wild, 1, 1) == "?" then wild = string.gsub(wild, "?", string.sub(match, 1, 1), 1) end
  9483.     if string.sub(wild, string.len(wild), string.len(wild)) == "?" then wild = string.gsub(wild, "?", string.sub(match, string.len(match), string.len(match)), 1) end
  9484.     if not string.find(wild, "*") and not string.find(wild, "?") and wild ~= match then return false end
  9485.     if string.sub(wild, 1, 1) ~= string.sub(match, 1, 1) and string.sub(wild, 1, 1) ~= "*" then return false end
  9486.     if string.sub(wild, string.len(wild), string.len(wild)) ~= string.sub(match, string.len(match), string.len(match)) and string.sub(wild, string.len(wild), string.len(wild)) ~= "*" then return false end
  9487.     local substrings = string.split(wild, "*")
  9488.     local begin = 1
  9489.     for k, v in ipairs(substrings) do
  9490.         local sublength = string.len(v)
  9491.         local temp_begin = begin
  9492.         local temp_end = begin + sublength - 1
  9493.         local matchsub = string.sub(match, begin, temp_end)
  9494.         local bool
  9495.         repeat
  9496.             local wild = v
  9497.             local indexes = pack(string.findchar(wild, "?"))
  9498.             if #indexes > 0 then
  9499.                 for _, i in ipairs(indexes) do
  9500.                     wild = string.gsub(wild, "?", string.sub(matchsub, i, i), 1)
  9501.                 end
  9502.             end
  9503.             if matchsub == wild then
  9504.                 bool = true
  9505.                 break
  9506.             end
  9507.             matchsub = string.sub(match, temp_begin, temp_end)
  9508.             temp_begin = temp_begin + 1
  9509.             temp_end = temp_end + 1
  9510.         until temp_end >= string.len(match)
  9511.         if not bool then
  9512.             return false
  9513.         end
  9514.         begin = sublength + 1
  9515.     end
  9516.     return true
  9517. end
  9518.  
  9519. function SelectPlayer(team)
  9520.     local t = { }
  9521.     for i = 0, 15 do
  9522.         if getplayer(i) and getteam(i) == team then
  9523.             table.insert(t, i)
  9524.         end
  9525.     end
  9526.     if #t > 0 then
  9527.         return t[getrandomnumber(1, #t + 1)]
  9528.     end
  9529.     return nil
  9530. end
  9531.  
  9532. function settimelimit(value)
  9533.     if tonumber(value) then
  9534.         writedword(timelimit_address, tonumber(value))
  9535.         local time_passed = readdword(readdword(gametime_base) + 0xC)
  9536.         writedword(gametype_base + 0x78, 30 * 60 * value + time_passed)
  9537.     end
  9538. end
  9539.  
  9540. function Timer(id, count)
  9541.     if SPAM_MAX == nil then SPAM_MAX = 7 end
  9542.     if SPAM_TIMEOUT == nil then SPAM_TIMEOUT = 60 end
  9543.     for i = 0, 15 do
  9544.         if getplayer(i) then
  9545.             local ip = getip(i)
  9546.             if Spam_Table[ip] == nil then
  9547.                 Spam_Table[ip] = 0
  9548.             end
  9549.             if Spam_Table[ip] < tonumber(SPAM_MAX) then
  9550.                 if Spam_Table[ip] > 0 then
  9551.                     Spam_Table[ip] = Spam_Table[ip] -0.25
  9552.                 end
  9553.             else
  9554.                 say(getname(i) .. " has been muted for " .. SPAM_TIMEOUT .. " seconds for spamming...", false)
  9555.                 hprintf(getname(i) .. " has been muted for " .. SPAM_TIMEOUT .. " seconds for spamming...")
  9556.                 Spam_Table[ip] = -1
  9557.             end
  9558.             if Spam_Table[ip] == -1 then
  9559.                 if SpamTimeOut_Table[ip] == nil then
  9560.                     SpamTimeOut_Table[ip] = tonumber(SPAM_TIMEOUT)
  9561.                 else
  9562.                     SpamTimeOut_Table[ip] = SpamTimeOut_Table[ip] -1
  9563.                 end
  9564.                 if SpamTimeOut_Table[ip] == 0 then
  9565.                     say(getname(i) .. " has been un-muted!", false)
  9566.                     hprintf(getname(i) .. " has been un-muted!")
  9567.                     SpamTimeOut_Table[ip] = nil
  9568.                     Spam_Table[ip] = 0
  9569.                 end
  9570.             end
  9571.         end
  9572.     end
  9573.     for k, v in pairs(IP_BanList) do
  9574.         if IP_BanList[k] ~= { } then
  9575.             for key, value in ipairs(IP_BanList[k]) do
  9576.                 if tonumber(IP_BanList[k][key].time) then
  9577.                     IP_BanList[k][key].time = tonumber(IP_BanList[k][key].time)
  9578.                 else
  9579.                     IP_BanList[k][key].time = -1
  9580.                 end
  9581.                 if IP_BanList[k][key].time > 0 then
  9582.                     IP_BanList[k][key].time = IP_BanList[k][key].time - 1
  9583.                     if IP_BanList[k][key].time == 0 then
  9584.                         table.remove(IP_BanList[k], key)
  9585.                     end
  9586.                 end
  9587.             end
  9588.         end
  9589.     end
  9590.     for k, v in pairs(Mute_Banlist) do
  9591.         if Mute_Banlist[k] ~= { } then
  9592.             for key, value in ipairs(Mute_Banlist[k]) do
  9593.                 if tonumber(Mute_Banlist[k][key].time) then
  9594.                     Mute_Banlist[k][key].time = tonumber(Mute_Banlist[k][key].time)
  9595.                 else
  9596.                     Mute_Banlist[k][key].time = -1
  9597.                 end
  9598.                 if Mute_Banlist[k][key].time > 0 then
  9599.                     Mute_Banlist[k][key].time = Mute_Banlist[k][key].time - 1
  9600.                     if Mute_Banlist[k][key].time == 0 then
  9601.                         table.remove(Mute_Banlist[k], key)
  9602.                     end
  9603.                 end
  9604.             end
  9605.         end
  9606.     end
  9607.  
  9608.     for k, v in pairs(IpRange_BanList) do
  9609.         if IpRange_BanList[k] ~= { } then
  9610.             for key, value in ipairs(IpRange_BanList[k]) do
  9611.                 if tonumber(IpRange_BanList[k][key].time) then
  9612.                     IpRange_BanList[k][key].time = tonumber(IpRange_BanList[k][key].time)
  9613.                 else
  9614.                     IpRange_BanList[k][key].time = -1
  9615.                 end
  9616.                 if IpRange_BanList[k][key].time > 0 then
  9617.                     IpRange_BanList[k][key].time = IpRange_BanList[k][key].time - 1
  9618.                     if IpRange_BanList[k][key].time == 0 then
  9619.                         table.remove(IpRange_BanList[k], key)
  9620.                     end
  9621.                 end
  9622.             end
  9623.         end
  9624.     end
  9625.     return true
  9626. end
  9627.  
  9628. function Spawn(message, objname, objtype, mapId, player, type)
  9629.     vehid = 0
  9630.     local m = tokenizestring(message, " ")
  9631.     local count = #m
  9632.     if count == 2 then
  9633.         local m_playerObjId = getplayerobjectid(player)
  9634.         if m_playerObjId then
  9635.             local m_object = getobject(m_playerObjId)
  9636.             local m_vehicleId = readdword(m_object + 0x11C)
  9637.             if m_object then
  9638.                 if isinvehicle(player) and m_vehicleId then
  9639.                     x, y, z = getobjectcoords(m_vehicleId)
  9640.                 else
  9641.                     x, y, z = getobjectcoords(m_playerObjId)
  9642.                     local camera_x = readfloat(m_object + 0x230)
  9643.                     local camera_y = readfloat(m_object + 0x234)
  9644.                     x = x + camera_x * 2
  9645.                     y = y + camera_y * 2
  9646.                     z = z + 2
  9647.                 end
  9648.                 vehid = createobject(mapId, 0, 60, false, x + 1.0, y, z + 1.3)
  9649.                 if type == "give" then
  9650.                     assignweapon(player, vehid)
  9651.                     sendresponse(objname .. " was given to " .. getname(player), message, player)
  9652.                 elseif type == "spawn" then
  9653.                     sendresponse(objname .. " spawned at " .. getname(player) .. "'s location", message, player)
  9654.                 elseif type == "enter" then
  9655.                     Vehicle_Drone_Table[player] = Vehicle_Drone_Table[player] or { }
  9656.                     table.insert(Vehicle_Drone_Table[player], vehid)
  9657.                     entervehicle(player, vehid, 0)
  9658.                     sendresponse(tostring(getname(player)) .. " was forced to enter a " .. tostring(objname), message, player)
  9659.                 end
  9660.             else
  9661.                 sendresponse("Sorry! - You cannot spawn objects while dead!", message, player)
  9662.             end
  9663.         else
  9664.             sendresponse("Sorry! - You cannot spawn objects while dead!", message, player)
  9665.         end
  9666.     elseif count >= 3 and count <= 6 then
  9667.         local players = getvalidplayers(m[3], player)
  9668.         if players then
  9669.             for i = 1, #players do
  9670.                 if players[i] == nil then break end
  9671.                 if getplayer(players[i]) then
  9672.                     local m_playerObjId = getplayerobjectid(players[i])
  9673.                     if m_playerObjId then
  9674.                         local m_object = getobject(m_playerObjId)
  9675.                         local m_vehicleId = readdword(m_object + 0x11C)
  9676.                         if m_object then
  9677.                             if isinvehicle(players[i]) and m_vehicleId and getobject(m_vehicleId) then
  9678.                                 x, y, z = getobjectcoords(m_vehicleId)
  9679.                             else
  9680.                                 x, y, z = getobjectcoords(m_playerObjId)
  9681.                                 local camera_x = readfloat(m_object + 0x230)
  9682.                                 local camera_y = readfloat(m_object + 0x234)
  9683.                                 x = x + camera_x * 2
  9684.                                 y = y + camera_y * 2
  9685.                                 z = z + 2
  9686.                             end
  9687.                             if count == 3 then
  9688.                                 vehid = createobject(mapId, 0, 60, false, x, y, z)
  9689.                                 if objtype == "weap" and type == "give" then
  9690.                                     assignweapon(players[i], vehid)
  9691.                                     sendresponse("A " .. objname .. " was given to " .. getname(players[i]), message, player)
  9692.                                     sendresponse(getname(players[i]) .. " was given a " .. objname .. ".", "//", players[i])
  9693.                                 elseif type == "spawn" then
  9694.                                     sendresponse("A " .. objname .. " was spawned at " .. getname(players[i]) .. "'s location!", message, player)
  9695.                                 elseif type == "enter" then
  9696.                                     Vehicle_Drone_Table[players[i]] = Vehicle_Drone_Table[players[i]] or { }
  9697.                                     table.insert(Vehicle_Drone_Table[players[i]], vehid)
  9698.                                     entervehicle(players[i], vehid, 0)
  9699.                                     sendresponse(getname(players[i]) .. " was forced to enter a " .. objname, message, player)
  9700.                                 end
  9701.                             elseif count == 4 then
  9702.                                 if m[4] ~= 0 then
  9703.                                     for i = 1, m[4] do
  9704.                                         createobject(mapId, 0, 0, false, x, y, z)
  9705.                                     end
  9706.                                     sendresponse(m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location!", message, player)
  9707.                                     privatesay(players[i], objname .. " was spawned above you!")
  9708.                                 else
  9709.                                     sendresponse("You didn't spawn anything!")
  9710.                                 end
  9711.                             elseif count == 5 then
  9712.                                 if m[4] ~= 0 then
  9713.                                     for i = 1, m[4] do
  9714.                                         createobject(mapId, 0, m[5], false, x, y, z)
  9715.                                     end
  9716.                                     sendresponse(m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location!", message, player)
  9717.                                     privatesay(players[i], objname .. " was spawned above you!")
  9718.                                 else
  9719.                                     sendresponse("You didn't spawn anything!")
  9720.                                 end
  9721.                             elseif count == 6 then
  9722.                                 if m[4] ~= 0 then
  9723.                                     for i = 1, m[4] do
  9724.                                         createobject(mapId, 0, m[5], m[6], x, y, z)
  9725.                                     end
  9726.                                     sendresponse(m[4] .. " " .. objname .. "s spawned at " .. getname(players[i]) .. "'s location!", message, player)
  9727.                                     privatesay(players[i], objname .. " was spawned above you!")
  9728.                                 else
  9729.                                     sendresponse("You didn't spawn anything!", message, player)
  9730.                                 end
  9731.                             end
  9732.                         elseif type ~= "give" then
  9733.                             sendresponse("Unable to spawn next to " .. getname(players[i]) .. ". - The Player isn't alive!", message, player)
  9734.                         elseif type == "give" then
  9735.                             sendresponse("Unable to give " .. getname(players[i]) .. " a " .. objname .. ". - The Player isn't alive!", message, player)
  9736.                         end
  9737.                     end
  9738.                 else
  9739.                     sendresponse("Player is nil.", message, player)
  9740.                 end
  9741.             end
  9742.  
  9743.         else
  9744.             sendresponse("Error 005: Invalid Player!", message, player)
  9745.         end
  9746.     end
  9747.     return vehid
  9748. end
  9749.  
  9750. function spawngunTimer(id, count, arguments)
  9751.     local player = arguments[2]
  9752.     local m_object = arguments[1]
  9753.     if m_object then
  9754.         local x = readfloat(m_object + 0x5C)
  9755.         local y = readfloat(m_object + 0x60)
  9756.         local z = readfloat(m_object + 0x64)
  9757.         local odj = createobject(objspawnid[getip(player)], 0, 10, false, x, y, z + 0.6)
  9758.     end
  9759.     return false
  9760. end
  9761.  
  9762. function Stickman(id, count)
  9763.     if count == 1 then
  9764.         hprintf("    _._    ")
  9765.         hprintf("   / O \\   ")
  9766.         hprintf("   \\| |/   ")
  9767.         hprintf("O--+=-=+--O")
  9768.     elseif count == 2 then
  9769.         svcmd("cls")
  9770.         hprintf("   ,-O-,   ")
  9771.         hprintf("O--=---=--O")
  9772.         hprintf("    2-2    ")
  9773.         hprintf("    - -    ")
  9774.     elseif count == 3 then
  9775.         svcmd("cls")
  9776.         hprintf("   ,_O_,   ")
  9777.         hprintf("O--(---)--O")
  9778.         hprintf("    >'>    ")
  9779.         hprintf("    - -    ")
  9780.     elseif count == 4 then
  9781.         svcmd("cls")
  9782.         hprintf("   ._O_.   ")
  9783.         hprintf("O--<-+->--O")
  9784.         hprintf("     X     ")
  9785.         hprintf("    / \\    ")
  9786.         hprintf("   -   -   ")
  9787.     elseif count == 5 then
  9788.         svcmd("cls")
  9789.         hprintf("O--=-O-=--O")
  9790.         hprintf("    '-'    ")
  9791.         hprintf("     v     ")
  9792.         hprintf("    / )    ")
  9793.         hprintf("   ~  z    ")
  9794.     elseif count == 6 then
  9795.         svcmd("cls")
  9796.         hprintf("O--,---,--O")
  9797.         hprintf("   \\ O /   ")
  9798.         hprintf("    - -    ")
  9799.         hprintf("     -     ")
  9800.         hprintf("    // \\    ")
  9801.         hprintf("   =   =   ")
  9802.     elseif count == 7 then
  9803.         svcmd("cls")
  9804.         hprintf("O--=-O-=--O")
  9805.         hprintf("    '-'    ")
  9806.         hprintf("     v     ")
  9807.         hprintf("    / )    ")
  9808.         hprintf("   ~  z    ")
  9809.     elseif count == 8 then
  9810.         svcmd("cls")
  9811.         hprintf("   ._O_.   ")
  9812.         hprintf("O--<-+->--O")
  9813.         hprintf("     X     ")
  9814.         hprintf("    / \\    ")
  9815.         hprintf("   -   -   ")
  9816.     elseif count == 9 then
  9817.         svcmd("cls")
  9818.         hprintf("   ,_O_,   ")
  9819.         hprintf("O--(---)--O")
  9820.         hprintf("    >'>    ")
  9821.         hprintf("    - -    ")
  9822.     elseif count == 10 then
  9823.         svcmd("cls")
  9824.         hprintf("   ,-O-,   ")
  9825.         hprintf("O--=---=--O")
  9826.         hprintf("    2-2    ")
  9827.         hprintf("    - -    ")
  9828.     elseif count == 11 then
  9829.         svcmd("cls")
  9830.         hprintf("    _._    ")
  9831.         hprintf("   / O \\   ")
  9832.         hprintf("   \\| |//   ")
  9833.         hprintf("O--+=-=+--O")
  9834.     elseif count >= 12 then
  9835.         svcmd("cls")
  9836.         return false
  9837.     end
  9838.     return true
  9839. end
  9840.  
  9841. function todec(number)
  9842.     return tonumber(number, 16)
  9843. end
  9844.  
  9845. function timetoword(time)
  9846.     if time == -1 or time == "-1" then
  9847.         return -1
  9848.     elseif tonumber(time) then
  9849.         local returntime = ""
  9850.         local seconds = tonumber(time)
  9851.         local days = math.floor(seconds / 86400)
  9852.         seconds = seconds - days * 86400
  9853.         local hours = math.floor(seconds / 3600)
  9854.         seconds = seconds - hours * 3600
  9855.         local minutes = math.floor(seconds / 60)
  9856.         seconds = seconds - minutes * 60
  9857.         if seconds ~= 0 then
  9858.             returntime = seconds .. "s"
  9859.         end
  9860.         if minutes ~= 0 then
  9861.             if returntime == "" then
  9862.                 returntime = minutes .. "m"
  9863.             else
  9864.                 returntime = minutes .. "m " .. returntime
  9865.             end
  9866.         end
  9867.         if hours ~= 0 then
  9868.             if returntime == "" then
  9869.                 returntime = hours .. "h"
  9870.             else
  9871.                 returntime = hours .. "h " .. returntime
  9872.             end
  9873.         end
  9874.         if days ~= 0 then
  9875.             if returntime == "" then
  9876.                 returntime = days .. "d"
  9877.             else
  9878.                 returntime = days .. "d " .. returntime
  9879.             end
  9880.         end
  9881.         if returntime == "" then
  9882.             returntime = "0s"
  9883.         end
  9884.         return returntime
  9885.     else
  9886.         return -1
  9887.     end
  9888. end
  9889.  
  9890. function votekick(name, player)
  9891.     VoteKick_Table = { }
  9892.     votekick_allowed = true
  9893.     if not votekicktimeouttimer then
  9894.         votekicktimeouttimer = registertimer(60000, "votekicktimeoutTimer")
  9895.     end
  9896.     say("Kicking " .. name .. "")
  9897.     if votekick_action == "ban" then
  9898.         svcmd("sv_ban " .. player + 1 .. " 5m")
  9899.     else
  9900.         svcmd("sv_kick " .. player + 1)
  9901.     end
  9902. end
  9903.  
  9904. function votekicktimeoutTimer(id, count)
  9905.     VoteKickTimeout_Table = false
  9906.     say("Vote-Kick is now available!")
  9907.     return false
  9908. end
  9909.  
  9910. function wordtotime(time)
  9911.     if time then
  9912.         if tonumber(time) then
  9913.             return tonumber(time)
  9914.         else
  9915.             local timeban = 0
  9916.             local num = ""
  9917.             for i = 1, string.len(time) do
  9918.                 local char = string.sub(time, i, i)
  9919.                 if tonumber(char) then
  9920.                     num = num .. char
  9921.                 else
  9922.                     local holder = 0
  9923.                     if char == "s" then
  9924.                         holder = tonumber(num)
  9925.                     elseif char == "m" then
  9926.                         holder = tonumber(num) * 60
  9927.                     elseif char == "h" then
  9928.                         holder = tonumber(num) * 60 * 60
  9929.                     elseif char == "d" then
  9930.                         holder = tonumber(num) * 60 * 60 * 24
  9931.                     else
  9932.                         holder = 0
  9933.                     end
  9934.                     if holder and timeban then
  9935.                         timeban = timeban + holder
  9936.                     else
  9937.                         if timeban then
  9938.                             timeban = timeban + 1
  9939.                         end
  9940.                     end
  9941.                     num = ""
  9942.                 end
  9943.             end
  9944.             if timeban > 0 then
  9945.                 return tonumber(timeban)
  9946.             end
  9947.         end
  9948.     else
  9949.         return -1
  9950.     end
  9951. end
  9952.  
  9953. function writewordsigned(address, word)
  9954.     value = tonumber(word)
  9955.     if value == nil then value = tonumber(word, 16) end
  9956.     if value and value > 0x7FFF then
  9957.         local max = 0xFFFF
  9958.         local difference = max - value
  9959.         value = -1 - difference
  9960.     end
  9961.     writeword(address, value)
  9962. end
  9963.  
  9964. function WriteChangeLog()
  9965.     local file = io.open("changelog_" .. Script_Version .. ".txt", "w")
  9966.     file:write("Document Name: Commands, v7.5\n")
  9967.     file:write("Credits to the original creator(s):\n")
  9968.     file:write("        AelitePrime, Wizard, and Nuggets.\n")
  9969.     file:write("        Base script created 'Smiley'.\n")
  9970.     file:write("1) Original Release: v4.2 by AelitePrime: Aug 3, 2013\n")
  9971.     file:write("2) Updated Version: v7.5 by Chalwk: 2014 - 2015\n")
  9972.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  9973.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  9974.     file:write("\n")
  9975.     file:write("CHANGE LOG: By Chalwk:\n")
  9976.     file:write("Added Script Prefix \n")
  9977.     file:write("\n")
  9978.     file:write("\n")
  9979.     file:write("\n")
  9980.     file:write("\n")
  9981.     file:write("\n")
  9982.     file:write("\n")
  9983.     file:write("\n")
  9984.     file:write("\n")
  9985.     file:write("\n")
  9986.     file:write("\n")
  9987.     file:write("\n")
  9988.     file:write("\n")
  9989.     file:write("\n")
  9990.     file:write("\n")
  9991.     file:write("\n")
  9992.     file:write("\n")
  9993.     file:write("\n")
  9994.     file:write("\n")
  9995.     file:write("\n")
  9996.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  9997.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  9998.     file:write("-- Added Time Limit Addresses. sv_time_cur is now compatible with Halo CE\n")
  9999.     file:write("-- Added the sendconsoletext overload\n")
  10000.     file:write("-- Added 'sv_hash_duplicates' command which enables/disables the checking of duplicate keys in the server.\n")
  10001.     file:write("-- Added 'sv_multiteam_vehicles' Enables/Disables the ability to enter a vehicle with another player in FFA.\n")
  10002.     file:write("\n")
  10003.     file:write("-- Modified all tables that used the hash for identication, and changed it to IP\n")
  10004.     file:write("\n")
  10005.     file:write("-- Fixed minor bug with votekick\n")
  10006.     file:write("-- Fixed issue with sv_superban\n")
  10007.     file:write("-- Fixed AntiCaps command. WARNING: If you use a chatfilter script. Load that script before this one.\n")
  10008.     file:write("-- Fixed issue with team play detection\n")
  10009.     file:write("-- Fixed minor bugs.\n")
  10010.     file:write("\n")
  10011.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10012.     file:write("Commands Version 4.1(Released July 23rd, 2013)\n")
  10013.     file:write("-- Update Reason: Bug fixes\n")
  10014.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10015.     file:write("\n")
  10016.     file:write("-- Fixed minor bugs\n")
  10017.     file:write("\n")
  10018.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10019.     file:write("Commands Version 4.0(Released July 21st, 2013)\n")
  10020.     file:write("-- Update Reason: make it compatible with new Phasor\n")
  10021.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10022.     file:write("\n")
  10023.     file:write("-- Added 'sv_addrcon' This gives you the ability to have more than one rcon.\n")
  10024.     file:write("-- Added 'sv_delrcon' Removes rcons from the rcon list.\n")
  10025.     file:write("-- Added 'sv_rconlist' Displays all available rcons\n")
  10026.     file:write("-- Added 'sv_iprangeban' Bans entire IP Range\n")
  10027.     file:write("-- Added 'sv_iprangeunban' Removes an IP from the banlist\n")
  10028.     file:write("-- Added 'sv_iprangebanlist' Shows all IP's banned\n")
  10029.     file:write("-- Added 'sv_read' command.\n")
  10030.     file:write("-- Added 'sv_load' shortcut for sv_script_load.\n")
  10031.     file:write("-- Added 'sv_unload' shortcut for sv_script_unload.\n")
  10032.     file:write("-- Added 'sv_resetplayer' and '/resetplayer' removes all troll command settings.\n")
  10033.     file:write("-- Added 'sv_damage' Increases player damage.\n")
  10034.     file:write("-- Added reason to sv_textban\n")
  10035.     file:write("-- Added Command_Balance function since sv_team_balance is not a command anymore for the moment.\n")
  10036.     file:write("\n")
  10037.     file:write("-- Modified Reason is said to the public\n")
  10038.     file:write("-- Modified Adminblocker the admin is notified if a command is being executed on them.\n")
  10039.     file:write("-- Modified AntiSpam changed from boolean to a type: all, players, off\n")
  10040.     file:write("-- Modified 'sv_commands' -> 'sv_cmds'\n")
  10041.     file:write("-- Modified 'sv_ipban' now accepts IP's'\n")
  10042.     file:write("-- Modified AFK detection. Works better\n")
  10043.     file:write("-- Modified NameBan. Banned names are changed to 'player' on join.\n")
  10044.     file:write("-- Modified Tbag Detection: Detects victim location. You must be near the victims death to be able to tbag him/her.\n")
  10045.     file:write("\n")
  10046.     file:write("-- Fixed most bugs with the new phasor\n")
  10047.     file:write("-- Fixed 'sv_scrimmode' \n")
  10048.     file:write("-- Fixed @ bug\n")
  10049.     file:write("-- Fixed AccessMerging bug when -1 was given to any other level other than 0\n")
  10050.     file:write("-- Fixed minor Bos Bug\n")
  10051.     file:write("-- Fixed setscore bug\n")
  10052.     file:write("\n")
  10053.     file:write("-- Removed sv_pinglist command\n")
  10054.     file:write("-- Removed sv_hash_check, sv_version, and sv_version_check. Phasor has them built in.\n")
  10055.     file:write("-- Removed Portal Blocking\n")
  10056.     file:write("-- Removed /setname until further notice\n")
  10057.     file:write("\n")
  10058.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10059.     file:write("Commands Version 3.0.1 (Released February 28th, 2013)\n")
  10060.     file:write("-- Update Reason: Mainly Bug Fixes\n")
  10061.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10062.     file:write("\n")
  10063.     file:write("-- Added sv_scrimmode\n")
  10064.     file:write("\n")
  10065.     file:write("-- Modified ipadminadd now accepts IP's\n")
  10066.     file:write("-- Modified 'sv_admin_add: Combined sv_admin_add and sv_admin_addh\n")
  10067.     file:write("\n")
  10068.     file:write("-- Fixed /e bug\n")
  10069.     file:write("-- Fixed SPAM_MAX and SPAM_TIMEOUT bugs\n")
  10070.     file:write("-- Fixed textban bugs\n")
  10071.     file:write("-- Fixed superban bugs\n")
  10072.     file:write("-- Fixed ipban bug\n")
  10073.     file:write("\n")
  10074.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10075.     file:write("Commands Version 3.0.0 (released February 11th, 2013)\n")
  10076.     file:write("-- Update Reason: Bug Fixes and New Features\n")
  10077.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10078.     file:write("\n")
  10079.     file:write("-- Added safe guards for the admin system.\n")
  10080.     file:write("-- Added Ping List command. Displays the Players ID, Name and Ping level.\n")
  10081.     file:write("-- Added System for no Hash and/or IP admins\n")
  10082.     file:write("-- Added a sv_login command so if you are using the System for no Hash and/or IP Admins people with rcon are able to use chat commands\n")
  10083.     file:write("-- Added a sv_status command. It will show the current status of Defaults.txt commands.\n")
  10084.     file:write("-- Added info shown to the sv_info command\n")
  10085.     file:write("-- Added 'sv_chatcommands' to enable or disable admin chat commands\n")
  10086.     file:write("-- Added 'sv_adminblocker' enables,disables or limits the abiliy of an admin to kick/ban another admin\n")
  10087.     file:write("-- Added 'sv_anticaps'  Enables or Disables the use of caps in the server\n")
  10088.     file:write("-- Added 'sv_antispam' Enables or Disables the AntiSpam system of the script\n")
  10089.     file:write("-- Added 'sv_spammax' Changes the max amount of messages that can be sent in 1 minute\n")
  10090.     file:write("-- Added 'sv_spamtimeout' Changes the time you are muted for spamming\n")
  10091.     file:write("-- Added a time amount that a player can be textbanned 'sv_textban [player] {time}'. if no time is set then the default is -1 which is forever.\n")
  10092.     file:write("-- Added a way to use any command without the 'sv_' Ex: 'sv_admin_add' can be written as 'admin_add' \n")
  10093.     file:write("-- Added a time amount that a player can be ipbanned 'sv_ipban [player] {time} {message}'. if no time is set then the default is -1 which is forever.\n")
  10094.     file:write("-- Added 'sv_bosplayers' to see the available players that can be banned on sight.\n")
  10095.     file:write("\n")
  10096.     file:write("-- Modified how Defaults.txt works. If a command is not specified in the Defaults.txt file it is set to default by the script so no errors occur during game.\n")
  10097.     file:write("-- Modified Tbag function\n")
  10098.     file:write("-- Modified ban, you are now able to send reason(s) for the ban which will be written a file.\n")
  10099.     file:write("-- Modified kick, you are now able to send reason(s) for the kick which will be written a file.\n")
  10100.     file:write("-- Modified Ipban, you are now able to send reason(s) for the ipban which will be written a file.\n")
  10101.     file:write("-- Modified Superban, you are now able to send reason(s) for the superban which will be written a file.\n")
  10102.     file:write("-- Modified Votekick. You can only votekick again after 1 minute has passed since last votekick.\n")
  10103.     file:write("-- Modified ChangeLevel. The coding for this command has been improved.\n")
  10104.     file:write("-- Modified GetHelp\n")
  10105.     file:write("\n")
  10106.     file:write("-- Fixed Ipban bug\n")
  10107.     file:write("-- Fixed the '/e' command.\n")
  10108.     file:write("-- Fixed the 'sv_unmute' command.\n")
  10109.     file:write("\n")
  10110.     file:write("-- Removed sv_command_type and all content related to it\n")
  10111.     file:write("-- Removed redundant code.\n")
  10112.     file:write("-- Renamed 'sv_sa_message' to 'sv_serveradmin_message'\n")
  10113.     file:write("-- Renamed 'sv_fj_message' to 'sv_firstjoin_message'\n")
  10114.     file:write("-- Renamed 'sv_wb_message' to 'sv_welcomeback_message'\n")
  10115.     file:write("\n")
  10116.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10117.     file:write("Commands Version 2.4.3 (released September 23rd,2012\n")
  10118.     file:write("-- Update Reason: Fixed issues with ServerChat Function.\n")
  10119.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10120.     file:write("\n")
  10121.     file:write("-- Fixed-- Fixed OnServerChat Function error caused Chat Commands to fail.\n")
  10122.     file:write("\n")
  10123.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10124.     file:write("Commands Version 2.4.2 (released August 29th,2012\n")
  10125.     file:write("-- Update Reason: Fixed issues from version 2.4.1 and new commands.\n")
  10126.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10127.     file:write("\n")
  10128.     file:write("-- Added a change admin level command. You can now change the level of an IP and/or Hash admin  level. 'sv_change_level'\n")
  10129.     file:write("-- Added a Command Type command. You can now change between the way Wizard setup his chat commands, and my way. 'sv_command_type'\n")
  10130.     file:write("-- Added a Command Type command to the default.txt\n")
  10131.     file:write("\n")
  10132.     file:write("-- Re-Added Private say command\n")
  10133.     file:write("-- Re-Added '/e' command.\n")
  10134.     file:write("-- Re-Added Nuke Command.\n")
  10135.     file:write("-- Re-Added SetName Command.\n")
  10136.     file:write("\n")
  10137.     file:write("-- Modified Tbag function\n")
  10138.     file:write("\n")
  10139.     file:write("-- Fixed 'sv_info' command error\n")
  10140.     file:write("-- Fixed OnServerChat, now you wont get 'You are not allowed to use this command' every time you type.\n")
  10141.     file:write("\n")
  10142.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10143.     file:write("Commands Version 2.4.1 (released August 22nd,2012\n")
  10144.     file:write("-- Update Reason: Fixed issues from version 2.4\n")
  10145.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10146.     file:write("\n")
  10147.     file:write("-- Fixed 'sv_players_more' issue.\n")
  10148.     file:write("-- Fixed 'sv_players' issue.\n")
  10149.     file:write("-- Fixed Chat Command issue. If you were admin, then you could do any In-Chat in the script. Check Manual for info on how to add new commands.\n")
  10150.     file:write("-- Fixed Command issue. If you were admin, then you could do any In-Console in the script. Check Manual for info on how to add new commands.\n")
  10151.     file:write("\n")
  10152.     file:write("-- Removed Restriction of Portal Blocking. Warning: Modded Maps with portals might cause the server to crash. Hope to fix soon.\n")
  10153.     file:write("\n")
  10154.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10155.     file:write("Commands Version 2.4 (released August 19th,2012\n")
  10156.     file:write("-- Update Reason: New Features, Fix minor bugs, Remove non-working commands(will be re-add later), and Organize the Script\n")
  10157.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10158.     file:write("\n")
  10159.     file:write("-- Added Admin Add Hash. You can now add people via hash. So you are able to add people without them being in the server. 'sv_admin_addh'. This is mostly used if you have 5 or more people you want to add at the same time. Another Script is needed to succesfully use this command.\n")
  10160.     file:write("-- Added a Portal Blocking Command. If someone is blocking a portal they will be killed. 'sv_pbdet'\n")
  10161.     file:write("-- Added a Private Messaging boolean for the @ in chat. 'sv_pvtmessage'\n")
  10162.     file:write("-- Added Private Messaging to the default.txt\n")
  10163.     file:write("-- Added a Tbagging function.\n")
  10164.     file:write("-- Added a Tbagging Boolean Command. 'sv_tbagdet'\n")
  10165.     file:write("-- Added Tbagging Command to the default.txt\n")
  10166.     file:write("-- Added Killing spree Notifications\n")
  10167.     file:write("-- Added a Killing spree Notification command 'sv_killspree'\n")
  10168.     file:write("-- Added Killing spree Notification to the default.txt\n")
  10169.     file:write("-- Added a 'Welcome back' message in OnPlayerJoin. It will only say it if you are not an IP/Hash Admin\n")
  10170.     file:write("-- Added a Welcome back message command. 'sv_welcomeback_message'\n")
  10171.     file:write("-- Added Welcome Back Message to the default.txt\n")
  10172.     file:write("-- Added a 'This is the players first time joining the server' message in OnPlayerJoin\n")
  10173.     file:write("-- Added a Command for Server Admin Message. 'sv_sa_message'\n")
  10174.     file:write("-- Added Server Admin message to the default.txt\n")
  10175.     file:write("-- Added a Command for First Joining Message 'sv_firstjoin_message'\n")
  10176.     file:write("-- Added First Joining Message to the default.txt\n")
  10177.     file:write("-- Added a Command for Unique Counting. 'sv_uniques_enabled'\n")
  10178.     file:write("-- Added Unique Counting to the default.txt\n")
  10179.     file:write("-- Added a 'sv_players_more' Command. This does the same function as 'sv_players' but it gives you more information on each player.\n")
  10180.     file:write("-- Added IP to the info Command.\n")
  10181.     file:write("\n")
  10182.     file:write("-- Fixed RTV Enabled Command \n")
  10183.     file:write("-- Fixed VoteKick Enabled Command \n")
  10184.     file:write("-- Fixed info command. \n")
  10185.     file:write("-- Fixed time current command. \n")
  10186.     file:write("-- Fixed Set Teleport Shortcut. 'sv_st' \n")
  10187.     file:write("-- Fixed Teleport Delete Shortcut. 'sv_t del'\n")
  10188.     file:write("\n")
  10189.     file:write("-- Modified 'sv_players' command. Now it only gives you Player ID, Player Name, and Player Team.\n")
  10190.     file:write("-- Modified 'sv_count' command. Now disables if 'sv_uniques_enabled' is disabled.\n")
  10191.     file:write("-- Modified Chat Commands: all commands can now be used in chat. Note: Some shortcuts have been transfered but not all.\n")
  10192.     file:write("-- Modified GetHelp Commnad\n")
  10193.     file:write("-- Modified List Command\n")
  10194.     file:write("\n")
  10195.     file:write("-- Removed 'sv_unban' command from the script. Caused the OnSeverCommand function to crash.\n")
  10196.     file:write("-- Removed Private say command\n")
  10197.     file:write("-- Removed '/e' command.\n")
  10198.     file:write("-- Removed Nuke Command.\n")
  10199.     file:write("-- Removed SetName Command.\n")
  10200.     file:write("\n")
  10201.     file:write("-- Access level crash fixes and a few other features\n")
  10202.     file:write("-- Organized all of the Functions\n")
  10203.     file:write("-- Commented all Main Functions. This will only show on the Commented version of the script\n")
  10204.     file:write("\n")
  10205.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10206.     file:write("Commands Version 2.3 (released June 13th 2012\n")
  10207.     file:write("Mainly fixed up the admin system\n")
  10208.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10209.     file:write("\n")
  10210.     file:write("-- Added a /crash [player] and a sv_crash [player] command. Do not use it when the game is ending... you've been warned...\n")
  10211.     file:write("-- Added a /scorelimit and a sv_scorelimit command\n")
  10212.     file:write("-- Added a /a del command.\n")
  10213.     file:write("-- Added sv_ipadminadd to the rcon\n")
  10214.     file:write("-- Added a patch that will allow new gametypes to be added without restarting the server\n")
  10215.     file:write("-- Added textbanning. It's like the mute command except it's a permanent\n")
  10216.     file:write("\n")
  10217.     file:write("-- Modified the AdminList command. Shows a lot more now.\n")
  10218.     file:write("\n")
  10219.     file:write("-- Fixed rcon commands so that the responses show up with the /e command\n")
  10220.     file:write("-- Fixed the ipban command (whoops)\n")
  10221.     file:write("-- Fixed a very small problem with the setcolor command.\n")
  10222.     file:write("-- Fixed up the timelimit command :)\n")
  10223.     file:write("-- Fixed IpAdmins. They can now use the rcon.\n")
  10224.     file:write("\n")
  10225.     file:write("-- This script no longer uses Phasor admins, if it sees that you are, it will delete all of them and add them to mine, so if you see Admin.txt\n")
  10226.     file:write("turned into Admins.txt, don't worry, it's supposed to do that.\n")
  10227.     file:write("-- This script enables CE devmode commands (cheat_deathless_player, cheat_medusa, etc)\n")
  10228.     file:write("-- IP admins no longer get removed when you unload the commands script\n")
  10229.     file:write("\n")
  10230.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10231.     file:write("Commands Version 2.201 (released on June 5th 2012)\n")
  10232.     file:write("This is mainly just a bug fix version\n")
  10233.     file:write("--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10234.     file:write("\n")
  10235.     file:write("-- Added a /setscore and sv_setscore command.\n")
  10236.     file:write("-- Added New functionality to /hax and /unhax\n")
  10237.     file:write("\n")
  10238.     file:write("-- Modified setkills, setassists, and setdeaths to work a little cleaner\n")
  10239.     file:write("\n")
  10240.     file:write("-- Fixed /commands to show all of the commands.\n")
  10241.     file:write("-- Fixed a weird problem with the /enter command (when you ejected it would crash your game)\n")
  10242.     file:write("-- Fixed /a list (i forgot to check for the /, i was only checking for \\a list, so /a list wouldn't work)\n")
  10243.     file:write("-- Fixed falldamage (and also made it so longer falls don't kill you)\n")
  10244.     file:write("-- Fixed /hide, when you leave and another person rejoins with your player number, it will no longer hide them (thank you mitch... lol)\n")
  10245.     file:write("-- Fixed a bug when loading this script first, it wouldn't let other scripts control the weapons being assigned on spawn (can't believe i didn't see it earlier, ty nuggets + others)\n")
  10246.     file:write("\n")
  10247.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10248.     file:write("Commands Version 2.2 (Released on June 1st 2012)\n")
  10249.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10250.     file:write("\n")
  10251.     file:write("-- Added unique player tracking. It will keep track of the number of unique players who joined the server\n")
  10252.     file:write("-- Added '/count' Get the number of unique players\n")
  10253.     file:write("-- Added /balance, it executes sv_teams_balance in console\n")
  10254.     file:write("-- Added sv_privatesay. Looks like i forgot the sv_command for that\n")
  10255.     file:write("-- Added private chat. Use @(player expression) to message someone\n")
  10256.     file:write("-- Added /setcolor. Only works in FFA gametypes.\n")
  10257.     file:write("-- Added namebanning to superban.\n")
  10258.     file:write("-- Added a \\nameban command.\n")
  10259.     file:write("-- Added ipadmin deleting\n")
  10260.     file:write("\n")
  10261.     file:write("--Modifed 'sv_map' made it so that the sv_map and /m loads the commands script by default\n")
  10262.     file:write("-- Modified the AdminList function to be a lot more useful\n")
  10263.     file:write("\n")
  10264.     file:write("-- Fixed Bugs\n")
  10265.     file:write("-- Fixed votekick.\n")
  10266.     file:write("-- Fixed /privatesay. It would only let you message one word before\n")
  10267.     file:write("-- Fixed ACCESS levels for the script. It kind of worked, but not really.\n")
  10268.     file:write("-- Fixed an issue with /timelimit and sv_time_cur\n")
  10269.     file:write("-- Fixed deathless glitch\n")
  10270.     file:write("\n")
  10271.     file:write("-- Removed some of the spam when the script loads (it was an easy way to accomplish what i wanted at the time)\n")
  10272.     file:write("\n")
  10273.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10274.     file:write("Commands Version 2.001\n")
  10275.     file:write("-- Fixed /ipadminadd \n")
  10276.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10277.     file:write("Commands Version 2.0(Released April 22nd, 2012)\n")
  10278.     file:write("This is pretty much a rewrite of the entire script. So many new features were added. So many that I don't even want to make this changelog. Anyway, I'm forcing myself to make it. So here it is:\n")
  10279.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10280.     file:write("\n")
  10281.     file:write("-- Added hash check manipulation. You can now disable or enable hash checking (meaning that cracked versions can join your server if its disabled, but that also means everyone is unbannable if they spoof their key (which most people don't know how to do).\n")
  10282.     file:write("-- Added sv_revoke and /revoke. The syntax is /revoke [player]. This will take away someone's admin who is currently in the server.\n")
  10283.     file:write("-- Added /os, this will give you an Overshield (syntax is /os [player])\n")
  10284.     file:write("-- Added a command to view all admins on the server, syntax is: /a list\n")
  10285.     file:write("-- Added a command to view the current admins in the server. Syntax is: /viewadmins\n")
  10286.     file:write("-- Added a command to view the server specs (processor speed, model name, manufacturer). Syntax is /specs, or sv_specs in console\n")
  10287.     file:write("-- Added another player expression. Now you are able to use 'random' as a player name So like '/k random' would kick a random person\n")
  10288.     file:write("-- Added version changing. You can change to any version of Halo. Syntax is: /version {version} or sv_version {version} in console.\n")
  10289.     file:write("-- Added version check removal. You can enable or disable version checking. Having this disabled means that any person on any version can join your server (please note that your server will only appear on the server you specify in the version command)\n")
  10290.     file:write("-- Added a Defaults.txt. This text file gets called on server startup.\n")
  10291.     file:write("-- Added a sv_commands and a /commands. This will show all the commands that exist for this script.\n")
  10292.     file:write("-- Added a /hide and a /unhide command, these will make you totally hidden from everyone else in the server. It also removes you from the scoreboard, however, it only works with players that join after you execute it. People in the server at the time that you use it will still see you on the scoreboard.\n")
  10293.     file:write("-- Added a parameter to '/spd'. Syntax is /spd [player] {speed}. Doing /spd [player] will show you their current speed.\n")
  10294.     file:write("-- Added another parameter to '/t'. Syntax is '/t list', this will show you the list of teleports for the map.\n")
  10295.     file:write("-- Added infinite nades to sv_infinite_ammo\n")
  10296.     file:write("-- Added a '/banlist' command to chat. This will show you the banlist.\n")
  10297.     file:write("-- Added an '/alias' command to chat. This will show aliases of the player you pick. Kinda glitchy, oxide's fault, not mine.\n")
  10298.     file:write("-- Added sv_rtv_needed [decimal 0 to 1]\n")
  10299.     file:write("-- Added sv_votekick_needed [decimal 0 to 1]\n")
  10300.     file:write("-- Added sv_rtv_enabled [true or false, 1 or 0]\n")
  10301.     file:write("-- Added sv_votekick_enabled [true or false, 1 or 0]\n")
  10302.     file:write("-- Added ipbanning. Syntax is sv_ipban, sv_ipbanlist, sv_ipunban, and for chat: /ipban, /ipbanlist, /ipunban.\n")
  10303.     file:write("-- Added 'sv_launch' and '/launch'. Syntax is 'sv_launch [player]' or '/launch [player]'\n")
  10304.     file:write("-- Added a control command. Syntax is 'sv_control [victim] [controller]' or '/c [victim] [controller]' in chat.\n")
  10305.     file:write("-- Added a privatesay command. Syntax is 'sv_privatesay [player] [message]' or '/privatesay [player] [message]' in chat\n")
  10306.     file:write("-- Added temp.txt managing, basically so values that you set the previous map won't be erased when the next map loads (like when you do sv_respawn_time 5, and it goes back to default everytime you reload the script)\n")
  10307.     file:write("-- Added ipadminadding. You can add admins via IP now. Syntax is sv_ipadminadd (player) (nickname) (level) or /ipadminadd (player) (nickname) (level) in chat.\n")
  10308.     file:write("-- Added: Now includes logging. This will log directly to commands.log in the log folder\n")
  10309.     file:write("-- Added: If you do not have an ACCESS file, this script will make one for you.\n")
  10310.     file:write("-- Added '/e' command.\n")
  10311.     file:write("\n")
  10312.     file:write("-- Modified /timelimit and sv_timelimit. It will change the ingame timelimit (time remaining) as well as the timelimit for every game after that. This still breaks with sv_reloadscripts.\n")
  10313.     file:write("-- Modified sv_afk was changed to 'sv_setafk'. Thought it was a better name for the command.\n")
  10314.     file:write("\n")
  10315.     file:write("-- Fixed /setname, it will change your name, but for others to see it it requires a rejoin.\n")
  10316.     file:write("-- Fixed the admin system, before you had to do sv_reloadscripts after you added someone, that's been fixed.\n")
  10317.     file:write("-- Fixed Access.ini not syncing with chat commands, meaning if you have sv_kick in your ACCESS level, you can now use /k in the chat.\n")
  10318.     file:write("-- Fixed a bug with /ammo, this now works correctly. Syntax is: /ammo [player] [type (1 or 2)] [ammo] or sv_setammo in console.\n")
  10319.     file:write("-- Fixed smiley's BOS commands, thanks to bvigil for telling me what it was supposed to do.\n")
  10320.     file:write("-- Fixed a bug with /tp and sv_teleport_pl, which were crashing when the other player was dead.\n")
  10321.     file:write("-- Fixed /setplasmas, thank you sanity for the notice...\n")
  10322.     file:write("-- Fixed a reported bug with /noweapons... I was never able to reproduce it, so I must have indirectly fixed it.\n")
  10323.     file:write("-- Fixed /info which would crash when you used a player expression that was not a number.\n")
  10324.     file:write("-- Fixed a couple of bugs with rtv and votekick (whoops)\n")
  10325.     file:write("-- Fixed a bug with 'sv_mute' and '/mute'. You can no longer mute admins.\n")
  10326.     file:write("-- Fixed /st. This will set a teleport location to wherever you are standing. Syntax is: /st [teleport name]\n")
  10327.     file:write("-- Fixed the spawngun. Syntax is /setmode (player) spawngun (object)\n")
  10328.     file:write("-- Fixed Smiley's BoS (Ban On Sight) system. I had to rewrite 80% of it to work with the new Phasor. It now also bans the person's IP.\n")
  10329.     file:write("\n")
  10330.     file:write("-- Sorry this took so long, it took a while to rewrite the whole script. Technically it's been done for a while, i was just waiting for Oxide to release phasor 059. But that won't happen until after june, and there's no way i'm keeping you all waiting. Hope you enjoy it.\n")
  10331.     file:write("\n")
  10332.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10333.     file:write("Commands Version 1.0\n")
  10334.     file:write("First Official Release (january or something)\n")
  10335.     file:write("-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n")
  10336.     file:write("\n")
  10337.     file:write("-- Script Created")
  10338.     file:write("\n")
  10339.     file:close()
  10340. end
  10341.  
  10342. function WriteLog(filename, value)
  10343.     local file = io.open(filename, "a")
  10344.     if file then
  10345.         local timestamp = os.date("%Y/%m/%d %H:%M:%S")
  10346.         local line = string.format("%s\t%s\n", timestamp, tostring(value))
  10347.         file:write(line)
  10348.         file:close()
  10349.     end
  10350. end
  10351.  
  10352. -- Start of SendConsoleText Script.
  10353.  
  10354. console = { }
  10355. console.__index = console
  10356. registertimer(100, "ConsoleTimer")
  10357. phasor_sendconsoletext = sendconsoletext
  10358.  
  10359. function sendconsoletext(player, message, time, order, align, func)
  10360.     console[player] = console[player] or { }
  10361.     local temp = { }
  10362.     temp.player = player
  10363.     temp.id = nextid(player, order)
  10364.     temp.message = message or ""
  10365.     temp.time = time or 8
  10366.     temp.remain = temp.time
  10367.     temp.align = align or "left"
  10368.     if type(func) == "function" then
  10369.         temp.func = func
  10370.     elseif type(func) == "string" then
  10371.         temp.func = _G[func]
  10372.     end
  10373.     console[player][temp.id] = temp
  10374.     setmetatable(console[player][temp.id], console)
  10375.     return console[player][temp.id]
  10376. end
  10377.  
  10378. function nextid(player, order)
  10379.     if not order then
  10380.         local x = 0
  10381.         for k, v in pairs(console[player]) do
  10382.             if k > x + 1 then
  10383.                 return x + 1
  10384.             end
  10385.  
  10386.             x = x + 1
  10387.         end
  10388.         return x + 1
  10389.     else
  10390.         local original = order
  10391.         while console[player][order] do
  10392.             order = order + 0.001
  10393.             if order == original + 0.999 then break end
  10394.         end
  10395.         return order
  10396.     end
  10397. end
  10398.  
  10399. function getmessage(player, order)
  10400.     if console[player] then
  10401.         if order then
  10402.             return console[player][order]
  10403.         end
  10404.     end
  10405. end
  10406.  
  10407. function getmessages(player)
  10408.     return console[player]
  10409. end
  10410.  
  10411. function getmessageblock(player, order)
  10412.     local temp = { }
  10413.     for k, v in pairs(console[player]) do
  10414.         if k >= order and k < order + 1 then
  10415.             table.insert(temp, console[player][k])
  10416.         end
  10417.     end
  10418.     return temp
  10419. end
  10420.  
  10421. function console:getmessage()
  10422.     return self.message
  10423. end
  10424.  
  10425. function console:append(message, reset)
  10426.     if console[self.player] then
  10427.         if console[self.player][self.id] then
  10428.             if getplayer(self.player) then
  10429.                 if reset then
  10430.                     if reset == true then
  10431.                         console[self.player][self.id].remain = console[self.player][self.id].time
  10432.                     elseif tonumber(reset) then
  10433.                         console[self.player][self.id].time = tonumber(reset)
  10434.                         console[self.player][self.id].remain = tonumber(reset)
  10435.                     end
  10436.                 end
  10437.                 console[self.player][self.id].message = message or ""
  10438.                 return true
  10439.             end
  10440.         end
  10441.     end
  10442. end
  10443.  
  10444. function console:shift(order)
  10445.     local temp = console[self.player][self.id]
  10446.     console[self.player][self.id] = console[self.player][order]
  10447.     console[self.player][order] = temp
  10448. end
  10449.  
  10450. function console:pause(time)
  10451.     console[self.player][self.id].pausetime = time or 5
  10452. end
  10453.  
  10454. function console:delete()
  10455.     console[self.player][self.id] = nil
  10456. end
  10457.  
  10458. function ConsoleTimer(id, count)
  10459.     for i, _ in opairs(console) do
  10460.         if tonumber(i) then
  10461.             if getplayer(i) then
  10462.                 for k, v in opairs(console[i]) do
  10463.                     if console[i][k].pausetime then
  10464.                         console[i][k].pausetime = console[i][k].pausetime - 0.1
  10465.                         if console[i][k].pausetime <= 0 then
  10466.                             console[i][k].pausetime = nil
  10467.                         end
  10468.                     else
  10469.                         if console[i][k].func then
  10470.                             if not console[i][k].func(i) then
  10471.                                 console[i][k] = nil
  10472.                             end
  10473.                         end
  10474.                         if console[i][k] then
  10475.                             console[i][k].remain = console[i][k].remain - 0.1
  10476.                             if console[i][k].remain <= 0 then
  10477.                                 console[i][k] = nil
  10478.                             end
  10479.                         end
  10480.                     end
  10481.                 end
  10482.                 if table.len(console[i]) > 0 then
  10483.                     local paused = 0
  10484.                     for k, v in pairs(console[i]) do
  10485.                         if console[i][k].pausetime then
  10486.                             paused = paused + 1
  10487.                         end
  10488.                     end
  10489.                     if paused < table.len(console[i]) then
  10490.                         local str = ""
  10491.                         for i = 0, 30 do
  10492.                             str = str .. " \n"
  10493.                         end
  10494.                         phasor_sendconsoletext(i, str)
  10495.                         for k, v in opairs(console[i]) do
  10496.                             if not console[i][k].pausetime then
  10497.                                 if console[i][k].align == "right" or console[i][k].align == "center" then
  10498.                                     phasor_sendconsoletext(i, consolecenter(string.sub(console[i][k].message, 1, 78)))
  10499.                                 else
  10500.                                     phasor_sendconsoletext(i, string.sub(console[i][k].message, 1, 78))
  10501.                                 end
  10502.                             end
  10503.                         end
  10504.                     end
  10505.                 end
  10506.             else
  10507.                 console[i] = nil
  10508.             end
  10509.         end
  10510.     end
  10511.     return true
  10512. end
  10513.  
  10514. function consolecenter(text)
  10515.     if text then
  10516.         local len = string.len(text)
  10517.         for i = len + 1, 78 do
  10518.             text = " " .. text
  10519.         end
  10520.         return text
  10521.     end
  10522. end
  10523.  
  10524. function opairs(t)
  10525.     local keys = { }
  10526.     for k, v in pairs(t) do
  10527.         table.insert(keys, k)
  10528.     end
  10529.     table.sort(keys,
  10530.     function(a, b)
  10531.         if type(a) == "number" and type(b) == "number" then
  10532.             return a < b
  10533.         end
  10534.         an = string.lower(tostring(a))
  10535.         bn = string.lower(tostring(b))
  10536.         if an ~= bn then
  10537.             return an < bn
  10538.         else
  10539.             return tostring(a) < tostring(b)
  10540.         end
  10541.     end )
  10542.     local count = 1
  10543.     return function()
  10544.         if table.unpack(keys) then
  10545.             local key = keys[count]
  10546.             local value = t[key]
  10547.             count = count + 1
  10548.             return key, value
  10549.         end
  10550.     end
  10551. end
  10552.  
  10553. function table.len(t)
  10554.     local count = 0
  10555.     for k, v in pairs(t) do
  10556.         count = count + 1
  10557.     end
  10558.     return count
  10559. end
  10560.  
  10561. -- End of SendConsoleText Script.
  10562. function gethttpsize(u)
  10563.     local r, c, h = http.request { method = "HEAD", url = u }
  10564.     if c == 200 then
  10565.         return tonumber(h["content-length"])
  10566.     end
  10567. end
  10568.  
  10569. function getbyhttp(u, file)
  10570.     local save = ltn12.sink.file(file or io.stdout)
  10571.     -- Only Print Feedback if OutPut is not stdout
  10572.     if file then save = ltn12.sink.chain(stats(gethttpsize(u)), save) end
  10573.     local r, c, h, s = http.request { url = u, sink = save }
  10574.     if c ~= 200 then io.stderr:write(s or c, "\n") end
  10575. end
Add Comment
Please, Sign In to add comment