Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin_table = {}
- mute_table = {}
- function GetRequiredVersion()
- return 3104
- end
- function OnScriptLoad(process)
- local file = io.open("cg//admin.txt", "r")
- if (file ~= nil) then
- for line in file:lines() do
- local words = {}
- for word in line:gmatch("%w+") do
- table.insert(words, word)
- end
- admin_table[words[2]] = words[3]
- end
- file:close()
- end
- end
- function OnScriptUnload()
- end
- function OnNewGame(map)
- end
- function OnGameEnd(mode)
- end
- function OnServerChat(player, chattype, message)
- local AllowChat = 1
- local count = gettokencount(message, " ")
- local t = {}
- local hash = gethash(player)
- local access = nil
- for k,v in pairs(admin_table) do
- if k == hash then
- access = tonumber(v)
- break
- end
- end
- for i=1,count do
- local word = gettoken(message, " ", i - 1)
- table.insert(t, word)
- end
- if access ~= nil then
- local found2 = string.find(t[1], "/")
- local found3 = string.find(t[1], "/", 2)
- local found4 = string.find(t[1], "/info", -5)
- if found2 ~= nil and found3 == nil and found4 == nil then
- AllowChat = 0
- local found5 = string.find(t[1], "/ban", -4)
- local found6 = string.find(t[1], "/changeteam", -11)
- local found7 = string.find(t[1], "/kick", -5)
- local found8 = string.find(t[1], "/kill", -5)
- local found9 = string.find(t[1], "/invis", -6)
- local found10 = string.find(t[1], "/mute", -5)
- local found11 = string.find(t[1], "/setspeed", -9)
- local found12 = string.find(t[1], "/suspend", -8)
- local found13 = string.find(t[1], "/teleport", -9)
- local found14 = string.find(t[1], "/unmute", -7)
- local found15 = string.find(t[1], "/unsuspend", -10)
- local found16 = string.find(t[1], "/map_next", -9)
- local found17 = string.find(t[1], "/map_reset", -10)
- if found5 == nil and found6 == nil and found7 == nil and found8 == nil and found9 == nil and found10 == nil and found11 == nil and found12 == nil and found13 == nil and found14 == nil and found15 == nil and found16 == nil and found17 == nil then
- privatesay(player, "Invalid Command")
- else
- if count == 1 then
- if found16 ~= nil then
- if t[1] == "/map_next" then
- if access <= 2 then
- if count == 1 then
- svcmd("sv_map_next")
- else
- privatesay(player, "Invalid Syntax: /map_next")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- end
- elseif found17 ~= nil then
- if t[1] == "/map_reset" then
- if access <= 2 then
- if count == 1 then
- svcmd("sv_map_reset")
- else
- privatesay(player, "Invalid Syntax: /map_reset")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- end
- end
- elseif count >= 2 then
- local hash2 = gethash(t[2] - 1)
- local name2 = getname(t[2] - 1)
- if hash2 ~= 0 then
- if t[1] == "/ban" then
- if access <= 2 then
- if count == 2 then
- svcmd("sv_ban " .. t[2])
- elseif count == 3 then
- svcmd("sv_ban " .. t[2] .. " " .. t[3])
- else
- privatesay(player, "Invalid Syntax: /ban [player]")
- privatesay(player, "Invalid Syntax: /ban [player] [time]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/changeteam" then
- if access <= 2 then
- if count == 2 then
- svcmd("sv_changeteam " .. t[2])
- else
- privatesay(player, "Invalid Syntax: /changeteam [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/kick" then
- if access <= 2 then
- if count == 2 then
- svcmd("sv_kick " .. t[2])
- else
- privatesay(player, "Invalid Syntax: /kick [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/kill" then
- if access <= 0 then
- if count == 2 then
- svcmd("sv_kill " .. t[2])
- else
- privatesay(player, "Invalid Syntax: /kill [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/invis" then
- if access <= 0 then
- if count == 2 then
- svcmd("sv_invis " .. t[2])
- elseif count == 3 then
- svcmd("sv_invis " .. t[2] .. " " .. t[3])
- else
- privatesay(player, "Invalid Syntax: /invis [player]")
- privatesay(player, "Invalid Syntax: /invis [player] [time]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/mute" then
- if access <= 2 then
- if count == 2 then
- local mute = nil
- for k,v in pairs(admin_table) do
- if k == hash2 then
- mute = 1
- break
- end
- end
- if hash2 ~= 0 then
- if mute == nil then
- if mute_table[hash2] == nil then
- mute_table[hash2] = 1
- say(name2 .. " was muted by an admin!")
- else
- privatesay(player, name2 .. " has already been muted.")
- end
- else
- privatesay(player, "Admins cannot be muted.")
- end
- end
- else
- privatesay(player, "Invalid Syntax: /mute [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/setammo" then
- if access <= 0 then
- if count == 3 then
- svcmd("sv_setammo " .. t[2] .. " " .. t[3])
- else
- privatesay(player, "Invalid Syntax: /setammo [player] [ammo]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/setspeed" then
- if access <= 0 then
- if count == 3 then
- svcmd("sv_setspeed " .. t[2] .. " " .. t[3])
- else
- privatesay(player, "Invalid Syntax: /setspeed [player] [speed]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/suspend" then
- if access <= 0 then
- if count == 2 then
- local m_player = getplayer(t[2] - 1)
- local player_respawn_time = readdword(m_player, 0x2C)
- if player_respawn_time == 0 then
- svcmd("sv_kill " .. t[2])
- writedword(m_player, 0x2C, 2592000)
- say(name2 .. " was suspended by an admin!")
- else
- privatesay(player, name2 .. " has already been suspended.")
- end
- else
- privatesay(player, "Invalid Syntax: /suspend [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/teleport" then
- if access <= 0 then
- local name = getname(t[2] - 1)
- local m_player = getplayer(t[2] - 1)
- local player_respawn_time = readdword(m_player, 0x2C)
- local m_playerObjId = readdword(m_player, 0x34)
- local m_object = getobject(m_playerObjId)
- local m_vehicle = getobject(readdword(m_object, 0x11C))
- if player_respawn_time == 0 then
- if count == 3 then
- local hash3 = gethash(t[3] - 1)
- if t[3] ~= t[2] and hash3 ~= 0 then
- local t_player = getplayer(t[3] - 1)
- local target_respawn_time = readdword(t_player, 0x2C)
- if player_respawn_time == 0 then
- local t_playerObjId = readdword(t_player, 0x34)
- local t_object = getobject(t_playerObjId)
- local t_vehicle = getobject(readdword(t_object, 0x11C))
- if t_vehicle ~= 0 then
- t_object = t_vehicle
- end
- local obj_x_coord = readfloat(t_object, 0x5C)
- local obj_y_coord = readfloat(t_object, 0x60)
- local obj_z_coord = readfloat(t_object, 0x64)
- if m_vehicle ~= 0 then
- writefloat(m_vehicle, 0x5C, obj_x_coord)
- writefloat(m_vehicle, 0x60, obj_y_coord)
- writefloat(m_vehicle, 0x64, obj_z_coord)
- say(name .. " was teleported by an admin!")
- else
- svcmd("sv_teleport " .. t[2] .. " " .. obj_x_coord .. ", " .. obj_y_coord .. ", " .. obj_z_coord + 0.5)
- end
- else
- privatesay(player, "Invalid Player")
- end
- else
- privatesay(player, "Invalid Player")
- end
- elseif count == 5 then
- if m_vehicle ~= 0 then
- writefloat(m_vehicle, 0x5C, t[3])
- writefloat(m_vehicle, 0x60, t[4])
- writefloat(m_vehicle, 0x64, t[5])
- say(name .. " was teleported by an admin!")
- else
- svcmd("sv_teleport " .. t[2] .. ", " .. t[3] .. ", " .. t[4] .. ", " .. t[5])
- end
- else
- privatesay(player, "Invalid Syntax: /teleport [player] [player]")
- privatesay(player, "Invalid Syntax: /teleport [player] [x] [y] [z]")
- end
- else
- privatesay(player, "Invalid Player")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/unmute" then
- if access <= 2 then
- if count == 2 then
- if hash2 ~= 0 then
- if mute_table[hash2] ~= nil then
- mute_table[hash2] = nil
- say(name2 .. " was unmuted by an admin!")
- else
- privatesay(player, name2 .. " has not been muted.")
- end
- end
- else
- privatesay(player, "Invalid Syntax: /unmute [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- elseif t[1] == "/unsuspend" then
- if access <= 0 then
- if count == 2 then
- local m_player = getplayer(t[2] - 1)
- local player_respawn_time = readdword(m_player, 0x2C)
- if player_respawn_time ~= 0 then
- writedword(m_player, 0x2C, 0)
- say(name2 .. " was unsuspended by an admin!")
- else
- privatesay(player, name2 .. " has not been suspended.")
- end
- else
- privatesay(player, "Invalid Syntax: /unsuspend [player]")
- end
- else
- privatesay(player, "You cannot execute this command.")
- end
- end
- else
- privatesay(player, "Invalid Player")
- end
- end
- end
- end
- end
- if t[1] == "/info" then
- AllowChat = 0
- local player_number = resolveplayer(player)
- local m_player = getplayer(player)
- local hash = gethash(player)
- local display = 1
- if access ~= nil then
- if count == 2 then
- player_number = t[2]
- m_player = getplayer(player_number - 1)
- hash = gethash(player_number - 1)
- if hash == 0 then
- privatesay(player, "Invalid Player")
- display = 0
- end
- elseif count > 2 then
- privatesay(player, "Invalid Syntax: /info")
- privatesay(player, "Invalid Syntax: /info [player]")
- display = 0
- end
- end
- if display == 1 then
- local m_playerObjId = readdword(m_player, 0x34)
- local m_object = getobject(m_playerObjId)
- local player_name = readstring(m_player, 0x4, 0x14)
- local player_team = readdword(m_player, 0x20)
- local player_interaction_seat = readword(m_player, 0x2A)
- local player_speed = readfloat(m_player, 0x6C)
- local player_objective_mode = readbyte(m_player, 0x74)
- local player_kills = readword(m_player, 0x9C)
- local player_assists = readword(m_player, 0xA4)
- local player_betrays = readword(m_player, 0xAC)
- local player_deaths = readword(m_player, 0xAE)
- local player_suicides = readword(m_player, 0xB0)
- local player_ping = readword(m_player, 0xDC)
- local player_weap_type = readword(m_player, 0x14C)
- local player_nade_type = readword(m_player, 0x14E)
- local obj_max_health = readfloat(m_object, 0xD8)
- local obj_max_shields = readfloat(m_object, 0xDC)
- local obj_health = readfloat(m_object, 0xE0)
- local obj_shields = readfloat(m_object, 0xE4)
- local obj_invis_mode = readbyte(m_object, 0x204)
- local obj_flashlight_mode = readbyte(m_object, 0x206)
- local obj_crouch_mode = readbyte(m_object, 0x208)
- local obj_primary_nades = readbyte(m_object, 0x31E)
- local obj_secondary_nades = readbyte(m_object, 0x31F)
- local obj_flashlight_level = readfloat(m_object, 0x344)
- local obj_invis_scale = readfloat(m_object, 0x37C)
- local obj_primary_weap_id = readdword(m_object, 0x2F8)
- local obj_secondary_weap_id = readdword(m_object, 0x2FC)
- local primary_weap = getobject(obj_primary_weap_id)
- local secondary_weap = getobject(obj_secondary_weap_id)
- local m_vehicle = getobject(readdword(m_object, 0x11C))
- if m_vehicle ~= 0 then
- if player_interaction_seat ~= 1 then
- primary_weap = getobject(readdword(m_vehicle, 0x2F8))
- secondary_weap = getobject(readdword(m_vehicle, 0x2FC))
- end
- m_object = m_vehicle
- end
- local obj_x_coord = readfloat(m_object, 0x5C)
- local obj_y_coord = readfloat(m_object, 0x60)
- local obj_z_coord = readfloat(m_object, 0x64)
- local primary_weap_heat = readfloat(primary_weap, 0x23C)
- local primary_weap_age = readfloat(primary_weap, 0x240)
- local primary_weap_ammo = readword(primary_weap, 0x2B6)
- local primary_weap_clip = readword(primary_weap, 0x2B8)
- local secondary_weap_heat = readfloat(secondary_weap, 0x23C)
- local secondary_weap_age = readfloat(secondary_weap, 0x240)
- local secondary_weap_ammo = readword(secondary_weap, 0x2B6)
- local secondary_weap_clip = readword(secondary_weap, 0x2B8)
- local teamsize = getteamsize(player_team)
- if player_team == 0 then
- player_team = "Red"
- elseif player_team == 1 then
- player_team = "Blue"
- end
- if player_objective_mode == 0x22 then
- player_objective_mode = "Hill"
- elseif player_objectivemode == 0x29 then
- player_objective_mode = "Ball"
- else
- player_objective_mode = "None"
- end
- if player_weap_type == 2 and player_objective_mode == "None" then
- player_objective_mode = "Flag"
- end
- player_betrays = player_betrays - player_suicides
- obj_x_coord = round(obj_x_coord)
- obj_y_coord = round(obj_y_coord)
- obj_z_coord = round(obj_z_coord)
- obj_max_health = round(obj_health * obj_max_health)
- obj_max_shields = round(obj_shields * obj_max_shields)
- obj_health = round(obj_health * 100)
- obj_shields = round(obj_shields * 100)
- if obj_invis_mode == 0x51 then
- obj_invis_mode = "Yes"
- else
- obj_invis_mode = "No"
- end
- if obj_flashlight_mode == 8 then
- obj_flashlight_mode = "On"
- else
- obj_flashlight_mode = "Off"
- end
- obj_flashlight_level = round(obj_flashlight_level * 100)
- obj_invis_scale = round(obj_invis_scale * 100)
- if obj_crouch_mode == 0 then
- obj_crouch_mode = "Standing"
- elseif obj_crouch_mode == 1 then
- obj_crouch_mode = "Crouching"
- elseif obj_crouch_mode == 2 then
- obj_crouch_mode = "Jumping"
- end
- if player_weap_type == 1 then
- primary_weap_heat = readfloat(secondary_weap, 0x23C)
- primary_weap_age = readfloat(secondary_weap, 0x240)
- primary_weap_ammo = readword(secondary_weap, 0x2B6)
- primary_weap_clip = readword(secondary_weap, 0x2B8)
- secondary_weap_heat = readfloat(primary_weap, 0x23C)
- secondary_weap_age = readfloat(primary_weap, 0x240)
- secondary_weap_ammo = readword(primary_weap, 0x2B6)
- secondary_weap_clip = readword(primary_weap, 0x2B8)
- end
- primary_weap_heat = round(primary_weap_heat * 100)
- primary_weap_age = round((1 - primary_weap_age) * 100)
- secondary_weap_heat = round(secondary_weap_heat * 100)
- secondary_weap_age = round((1 - secondary_weap_age) * 100)
- local primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo
- local secondary_weap_info = "Secondary Ammo: " .. secondary_weap_clip .. " / " .. secondary_weap_ammo
- if primary_weap_age >= 0 and primary_weap_ammo == 0 and primary_weap_clip == 0 then
- primary_weap_info = "Primary Battery: " .. primary_weap_heat .. "% / " .. primary_weap_age .. "%"
- end
- if secondary_weap_age >= 0 and secondary_weap_ammo == 0 and secondary_weap_clip == 0 then
- secondary_weap_info = "Secondary Battery: " .. secondary_weap_heat .. "% / " .. secondary_weap_age .. "%"
- end
- local nade_info = "Frag Grenades: " .. obj_primary_nades .. " | " .. "Plasma Grenades: " .. obj_secondary_nades
- if player_nade_type == 1 then
- nade_info = "Plasma Grenades: " .. obj_secondary_nades .. " | " .. "Frag Grenades: " .. obj_primary_nades
- end
- privatesay(player, "----------")
- privatesay(player, "Name: " .. player_name .. " (" .. player_number .. ") | " .. "Team: " .. player_team .. " (" .. teamsize .. ") | " .. "Speed: " .. player_speed .. " | " .. "Location: " .. obj_x_coord .. ", " .. obj_y_coord .. ", " .. obj_z_coord)
- privatesay(player, "Hash: " .. hash .. " | " .. "Ping: " .. player_ping .. " | " .. "Stance: " .. obj_crouch_mode)
- privatesay(player, "Kills: " .. player_kills .. " | " .. "Assists: " .. player_assists .. " | " .. "Betrays: " .. player_betrays .. " | " .. "Suicides: " .. player_suicides .. " | " .. "Deaths: " .. player_deaths .. " | " .. "Objective: " .. player_objective_mode)
- privatesay(player, "Health: " .. obj_health .. "% (" .. obj_max_health .. ") | " .. "Shields: " .. obj_shields .. "% (" .. obj_max_shields .. ") | " .. "Invis: " .. obj_invis_mode .. " (" .. obj_invis_scale .. "%) | " .. "Light: " .. obj_flashlight_mode .. " (" .. obj_flashlight_level .. "%)")
- privatesay(player, primary_weap_info .. " | " .. secondary_weap_info)
- privatesay(player, nade_info)
- privatesay(player, "----------")
- end
- end
- if mute_table[hash] ~= nil then
- AllowChat = 0
- end
- return AllowChat
- end
- function OnServerCommand(player, command)
- local fixed_command = string.gsub(command, "\"", "")
- if string.sub(command, 1, 7) == "sv_info" then
- local player_number = player + 1
- local m_player = getplayer(player)
- local hash = gethash(player)
- local display = 1
- if gettokencount(fixed_command, " ") == 2 then
- player_number = tonumber(gettoken(fixed_command, " ", 1))
- m_player = getplayer(player_number - 1)
- hash = gethash(player_number - 1)
- if hash == 0 then
- hprintf("Invalid Player")
- display = 0
- end
- elseif gettokencount(fixed_command, " ") > 2 then
- hprintf("Invalid Syntax: sv_info [player]")
- display = 0
- end
- if display == 1 then
- local m_playerObjId = readdword(m_player, 0x34)
- local m_object = getobject(m_playerObjId)
- local player_name = readstring(m_player, 0x4, 0x14)
- local player_team = readdword(m_player, 0x20)
- local player_interaction_seat = readword(m_player, 0x2A)
- local player_speed = readfloat(m_player, 0x6C)
- local player_objective_mode = readbyte(m_player, 0x74)
- local player_kills = readword(m_player, 0x9C)
- local player_assists = readword(m_player, 0xA4)
- local player_betrays = readword(m_player, 0xAC)
- local player_deaths = readword(m_player, 0xAE)
- local player_suicides = readword(m_player, 0xB0)
- local player_ping = readword(m_player, 0xDC)
- local player_weap_type = readword(m_player, 0x14C)
- local player_nade_type = readword(m_player, 0x14E)
- local obj_max_health = readfloat(m_object, 0xD8)
- local obj_max_shields = readfloat(m_object, 0xDC)
- local obj_health = readfloat(m_object, 0xE0)
- local obj_shields = readfloat(m_object, 0xE4)
- local obj_invis_mode = readbyte(m_object, 0x204)
- local obj_flashlight_mode = readbyte(m_object, 0x206)
- local obj_crouch_mode = readbyte(m_object, 0x208)
- local obj_primary_nades = readbyte(m_object, 0x31E)
- local obj_secondary_nades = readbyte(m_object, 0x31F)
- local obj_flashlight_level = readfloat(m_object, 0x344)
- local obj_invis_scale = readfloat(m_object, 0x37C)
- local obj_primary_weap_id = readdword(m_object, 0x2F8)
- local obj_secondary_weap_id = readdword(m_object, 0x2FC)
- local primary_weap = getobject(obj_primary_weap_id)
- local secondary_weap = getobject(obj_secondary_weap_id)
- local m_vehicle = getobject(readdword(m_object, 0x11C))
- if m_vehicle ~= 0 then
- if player_interaction_seat ~= 1 then
- primary_weap = getobject(readdword(m_vehicle, 0x2F8))
- secondary_weap = getobject(readdword(m_vehicle, 0x2FC))
- end
- m_object = m_vehicle
- end
- local obj_x_coord = readfloat(m_object, 0x5C)
- local obj_y_coord = readfloat(m_object, 0x60)
- local obj_z_coord = readfloat(m_object, 0x64)
- local primary_weap_heat = readfloat(primary_weap, 0x23C)
- local primary_weap_age = readfloat(primary_weap, 0x240)
- local primary_weap_ammo = readword(primary_weap, 0x2B6)
- local primary_weap_clip = readword(primary_weap, 0x2B8)
- local secondary_weap_heat = readfloat(secondary_weap, 0x23C)
- local secondary_weap_age = readfloat(secondary_weap, 0x240)
- local secondary_weap_ammo = readword(secondary_weap, 0x2B6)
- local secondary_weap_clip = readword(secondary_weap, 0x2B8)
- local teamsize = getteamsize(player_team)
- if player_team == 0 then
- player_team = "Red"
- elseif player_team == 1 then
- player_team = "Blue"
- end
- if player_objective_mode == 0x22 then
- player_objective_mode = "Hill"
- elseif player_objectivemode == 0x29 then
- player_objective_mode = "Ball"
- else
- player_objective_mode = "None"
- end
- if player_weap_type == 2 and player_objective_mode == "None" then
- player_objective_mode = "Flag"
- end
- player_betrays = player_betrays - player_suicides
- obj_x_coord = round(obj_x_coord)
- obj_y_coord = round(obj_y_coord)
- obj_z_coord = round(obj_z_coord)
- obj_max_health = round(obj_health * obj_max_health)
- obj_max_shields = round(obj_shields * obj_max_shields)
- obj_health = round(obj_health * 100)
- obj_shields = round(obj_shields * 100)
- if obj_invis_mode == 0x51 then
- obj_invis_mode = "Yes"
- else
- obj_invis_mode = "No"
- end
- if obj_flashlight_mode == 8 then
- obj_flashlight_mode = "On"
- else
- obj_flashlight_mode = "Off"
- end
- obj_flashlight_level = round(obj_flashlight_level * 100)
- obj_invis_scale = round(obj_invis_scale * 100)
- if obj_crouch_mode == 0 then
- obj_crouch_mode = "Standing"
- elseif obj_crouch_mode == 1 then
- obj_crouch_mode = "Crouching"
- elseif obj_crouch_mode == 2 then
- obj_crouch_mode = "Jumping"
- end
- if player_weap_type == 1 then
- primary_weap_heat = readfloat(secondary_weap, 0x23C)
- primary_weap_age = readfloat(secondary_weap, 0x240)
- primary_weap_ammo = readword(secondary_weap, 0x2B6)
- primary_weap_clip = readword(secondary_weap, 0x2B8)
- secondary_weap_heat = readfloat(primary_weap, 0x23C)
- secondary_weap_age = readfloat(primary_weap, 0x240)
- secondary_weap_ammo = readword(primary_weap, 0x2B6)
- secondary_weap_clip = readword(primary_weap, 0x2B8)
- end
- primary_weap_heat = round(primary_weap_heat * 100)
- primary_weap_age = round((1 - primary_weap_age) * 100)
- secondary_weap_heat = round(secondary_weap_heat * 100)
- secondary_weap_age = round((1 - secondary_weap_age) * 100)
- local primary_weap_info = "Primary Ammo: " .. primary_weap_clip .. " / " .. primary_weap_ammo
- local secondary_weap_info = "Secondary Ammo: " .. secondary_weap_clip .. " / " .. secondary_weap_ammo
- if primary_weap_age >= 0 and primary_weap_ammo == 0 and primary_weap_clip == 0 then
- primary_weap_info = "Primary Battery: " .. primary_weap_heat .. " / " .. primary_weap_age
- end
- if secondary_weap_age >= 0 and secondary_weap_ammo == 0 and secondary_weap_clip == 0 then
- secondary_weap_info = "Secondary Battery: " .. secondary_weap_heat .. " / " .. secondary_weap_age
- end
- local nade_info = "Frag Grenades: " .. obj_primary_nades .. " | " .. "Plasma Grenades: " .. obj_secondary_nades
- if player_nade_type == 1 then
- nade_info = "Plasma Grenades: " .. obj_secondary_nades .. " | " .. "Frag Grenades: " .. obj_primary_nades
- end
- hprintf("----------")
- hprintf("Name: " .. player_name .. " (" .. player_number .. ") | " .. "Team: " .. player_team .. " (" .. teamsize .. ") | " .. "Speed: " .. player_speed .. " | " .. "Location: " .. obj_x_coord .. ", " .. obj_y_coord .. ", " .. obj_z_coord)
- hprintf("Hash: " .. hash .. " | " .. "Ping: " .. player_ping .. " | " .. "Stance: " .. obj_crouch_mode)
- hprintf("Kills: " .. player_kills .. " | " .. "Assists: " .. player_assists .. " | " .. "Betrays: " .. player_betrays .. " | " .. "Suicides: " .. player_suicides .. " | " .. "Deaths: " .. player_deaths .. " | " .. "Objective: " .. player_objective_mode)
- hprintf("Health: " .. obj_health .. " (" .. obj_max_health .. ") | " .. "Shields: " .. obj_shields .. " (" .. obj_max_shields .. ") | " .. "Invis: " .. obj_invis_mode .. " (" .. obj_invis_scale .. ") | " .. "Light: " .. obj_flashlight_mode .. " (" .. obj_flashlight_level .. ")")
- hprintf(primary_weap_info .. " | " .. secondary_weap_info)
- hprintf(nade_info)
- hprintf("----------")
- end
- end
- return 1
- end
- function OnTeamDecision(cur_team)
- return cur_team
- end
- function OnPlayerJoin(player, team)
- end
- function OnPlayerLeave(player, team)
- end
- function OnPlayerKill(killer, victim, mode)
- end
- function OnKillMultiplier(player, multiplier)
- end
- function OnPlayerSpawn(player, m_objectId)
- end
- function OnPlayerSpawnEnd(player, m_objectId)
- end
- function OnTeamChange(relevant, player, team, dest_team)
- return 1
- end
- function OnObjectInteraction(player, m_ObjectId, tagType, tagName)
- return 1
- end
- function OnWeaponReload(player, weapon)
- return 1
- end
- function OnVehicleEntry(player)
- return 1
- end
- function OnDamageLookup(receiving_obj, causing_obj, tagdata, tagname)
- end
- function OnWeaponAssignment(player, object, count, tag)
- end
- function OnWeaponCreation(owningPlayer, owningObject, m_weapon, tag)
- end
- function round(num)
- under = math.floor(num)
- upper = math.floor(num) + 1
- underV = -(under - num)
- upperV = upper - num
- if (upperV > underV) then
- return under
- else
- return upper
- end
- end
- function readstring(address, offset, length)
- local char_table = {}
- local string = ""
- for i=0,length do
- if readbyte(address, (offset + (0x1 * i))) ~= 0 then
- table.insert(char_table, string.char(readbyte(address, (offset + (0x1 * i)))))
- end
- end
- for k,v in pairs(char_table) do
- string = string .. v
- end
- return string
- end
Advertisement
Add Comment
Please, Sign In to add comment