Advertisement
superzilla

Commandsv2

Feb 24th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 41.81 KB | None | 0 0
  1. --By: Superzilla, Older versions by Soap and Superzilla
  2. --antiname = false -- requires client side modification, prevents players from joining with the same name
  3. hide_speed = 5 -- self explanatory
  4. falldamage = 0.375 --Is a percentage
  5. vehidamage = 0 --Is a percentage
  6. weapontotal = 3 --Total weapons. (If enabled third weapon will be a plasma pistol)
  7. sprotect = 5 -- spawn protection time, in seconds, (0 to disable)
  8. mdamage = 1 -- Modified damage, 1 to turn off, othersise use a decimal (ex, mdamage = .75 would reduce damage by 75%, mdamage = 2 would double damage)
  9. -----Chat Settings-----
  10. chatFilter = true -- to add words to filter open your chatFilter.txt in your server's profile path.
  11. -----Custom Nades-----
  12. cnades = 1 -- custom nades on (1) or off (0). If you have infinate nades on, turn this off (0), or if you want to use gametype default, turn this off.
  13. fragamount = 3 -- how many frag nades the player is to spawn with. More than 4 may cause errors.
  14. plasmaamount = 2 -- how many plasma nades the player is to spawn with. More than 4 may cause errors.
  15. -----Command Aliases-----
  16. commandAlias = {} -- Don't touch this line
  17. ----Example: commandAlias[numbergoeshere] = {"real command", "what you want it to work as"}
  18.     commandAlias[1] = {"sv_kick", "sv_k"}
  19.     commandAlias[2] = {"sv_admin_add", "sv_a"}
  20.     commandAlias[3] = {"sv_admin_cur", "sv_viewadmins"}
  21.     commandAlias[4] = {"sv_map", "sv_m"}
  22.     commandAlias[5] = {"sv_mapcycle_begin", "sv_mc"}
  23.     commandAlias[6] = {"sv_map_reset", "sv_reset"}
  24.     commandAlias[7] = {"sv_players", "sv_pl"}
  25.     commandAlias[8] = {"sv_ban", "sv_b"}
  26.     commandAlias[9] = {"sv_falldmg", "sv_falldamage"}
  27.     commandAlias[10] = {"sv_pnades", "sv_setplasmas"}
  28.     commandAlias[11] = {"sv_teleport_pl", "sv_tp"}
  29.     commandAlias[10] = {"sv_fnades", "sv_setfrags"}
  30.     commandAlias[11] = {"sv_unipban", "sv_ipunban"}
  31.  
  32.  
  33. -- Don't touch below here, if you do, and you're a noob, you probably just screwed up something...
  34. jacking = {}
  35. t_boslist = {}
  36. pastplayer = {}
  37. protected = {}
  38. weapdespawning = {}
  39. messages = {}
  40. flamebrains = {}
  41. hidden = {} -- hidden players
  42. flying = {}
  43. muted = {} -- muted players
  44. damagequery = {} --players who have damagequery on
  45. scriptName = "sCommands"
  46. scriptVersion = "2"
  47. t_ipbanlist = {}
  48. filteredWords = {}
  49. camera_size = 0x30
  50. camera_base = 0x69C2F8
  51. command_execute = false
  52.  
  53. T_publicCmdHandler = true --Set this defalut to true if you want this script to handle @<command> text commands
  54. T_adminCmdHandler = true --Set this default to true if you want this script to handle /<command> text commands
  55. T_rAdminCmdHandler = false --Set this default to true if you want this script to handle \<command> text commands
  56. handledCommands = { --[[Commands that this script should handle by default]]--
  57.     "sv_hide",
  58.     "sv_unhide",
  59.     "sv_myobj",
  60.     "sv_splatterdmg",
  61.     "sv_falldmg",
  62.     "sv_damageq",
  63.     "sv_mdamage",
  64.     "sv_pnades",
  65.     "sv_fnades",
  66.     "sv_cnades",
  67.     "sv_ipban",
  68.     "sv_ipbanlist",
  69.     "sv_unipban",
  70.     "sv_superban",
  71.     "sv_commandAlias",
  72.     "sv_k",
  73.     "sv_a",
  74.     "sv_viewadmins",
  75.     "sv_m",
  76.     "sv_mc",
  77.     "sv_reset",
  78.     "sv_pl",
  79.     "sv_b",
  80.     "sv_falldamage",
  81.     "sv_setplasmas",
  82.     "sv_tp",
  83.     "sv_setfrags",
  84.     "sv_ipunban",
  85.     "sv_addfilter",
  86.     "sv_fly",
  87.     "sv_camq",
  88.     "sv_hsay",
  89.     "sv_bos",
  90.     "sv_boslist",
  91.     "sv_unbos",
  92.     "sv_viewip",
  93.     "sv_weapontotal"
  94. }
  95.  
  96. --[[r_names = {} -- the feature that corresponds with this table needs client side modification
  97.     r_names[1] = {"Bieber",false}
  98.     r_names[2] = {"Minaj",false}
  99.     r_names[3] = {"Timberlake",false}
  100.     r_names[4] = {"Pelosi",false}
  101.     r_names[5] = {"McCain",false}
  102.     r_names[6] = {"Bush",false}
  103.     r_names[7] = {"Obama",false}
  104.     r_names[8] = {"Boo Boo",false}
  105.     r_names[9] = {"LeBeouf",false}
  106.     r_names[10] = {"Lil Wayne",false}
  107.     r_names[11] = {"Carey",false}
  108.     r_names[12] = {"Ferril",false}
  109.     r_names[13] = {"Colbert",false}
  110.     r_names[14] = {"Sanchez",false}
  111.     r_names[15] = {"Dynamite",false}
  112.     r_names[16] = {"JayZ",false}--]]
  113.  
  114. --Objects Table (for handling purposes) (also origionally from wizard's scriptoid)
  115.     objects = {}
  116.         -- Bipeds
  117.         objects[1] = {"cyborg", "bipd", "characters\\cyborg_mp\\cyborg_mp"}
  118.  
  119.         -- Equipment
  120.         objects[2] = {"camo", "eqip", "powerups\\active camouflage"}
  121.         objects[3] = {"health", "eqip", "powerups\\health pack"}
  122.         objects[4] = {"overshield", "eqip", "powerups\\over shield"}
  123.         objects[5] = {"fnade", "eqip", "weapons\\frag grenade\\frag grenade"}
  124.         objects[6] = {"pnade", "eqip", "weapons\\plasma grenade\\plasma grenade"}
  125.  
  126.         -- Vehicles
  127.         objects[7] = {"shee", "vehi", "vehicles\\banshee\\banshee_mp"}
  128.         objects[8] = {"turret", "vehi", "vehicles\\c gun turret\\c gun turret_mp"}
  129.         objects[9] = {"ghost", "vehi", "vehicles\\ghost\\ghost_mp"}
  130.         objects[10] = {"rhog", "vehi", "vehicles\\rwarthog\\rwarthog"}
  131.         objects[11] = {"tank", "vehi", "vehicles\\scorpion\\scorpion_mp"}
  132.         objects[12] = {"hog", "vehi", "vehicles\\warthog\\mp_warthog"}
  133.  
  134.         -- Weapons
  135.         objects[13] = {"rifle", "weap", "weapons\\assault rifle\\assault rifle"}
  136.         objects[14] = {"ball", "weap", "weapons\\ball\\ball"}
  137.         objects[15] = {"flag", "weap", "weapons\\flag\\flag"}
  138.         objects[16] = {"flamethrower", "weap", "weapons\\flamethrower\\flamethrower"}
  139.         objects[17] = {"needler", "weap", "weapons\\needler\\mp_needler"}
  140.         objects[18] = {"pistol", "weap", "weapons\\pistol\\pistol"}
  141.         objects[19] = {"ppistol", "weap", "weapons\\plasma pistol\\plasma pistol"}
  142.         objects[20] = {"prifle", "weap", "weapons\\plasma rifle\\plasma rifle"}
  143.         objects[21] = {"frg", "weap", "weapons\\plasma_cannon\\plasma_cannon"}
  144.         objects[22] = {"rocket", "weap", "weapons\\rocket launcher\\rocket launcher"}
  145.         objects[23] = {"shotgun", "weap", "weapons\\shotgun\\shotgun"}
  146.         objects[24] = {"sniper", "weap", "weapons\\sniper rifle\\sniper rifle"}
  147.  
  148.         -- Projectiles
  149.         objects[25] = {"sheebolt", "proj", "vehicles\\banshee\\banshee bolt"}
  150.         objects[26] = {"sheerod", "proj", "vehicles\\banshee\\mp_banshee fuel rod"}
  151.         objects[27] = {"turretbolt", "proj", "vehicles\\c gun turret\\mp gun turret"}
  152.         objects[28] = {"ghostbolt", "proj", "vehicles\\ghost\\ghost bolt"}
  153.         objects[29] = {"tankshot", "proj", "vehicles\\scorpion\\bullet"}
  154.         objects[30] = {"tankshell", "proj", "vehicles\\scorpion\\tank shell"}
  155.         objects[31] = {"hogshot", "proj", "vehicles\\warthog\\bullet"}
  156.         objects[32] = {"rifleshot", "proj", "weapons\\assault rifle\\bullet"}
  157.         objects[33] = {"flame", "proj", "weapons\\flamethrower\\flame"}
  158.         objects[34] = {"needlershot", "proj", "weapons\\needler\\mp_needle"}
  159.         objects[35] = {"pistolshot", "proj", "weapons\\pistol\\bullet"}
  160.         objects[36] = {"ppistolbolt", "proj", "weapons\\plasma pistol\\bolt"}
  161.         objects[37] = {"priflebolt", "proj", "weapons\\plasma rifle\\bolt"}
  162.         objects[38] = {"priflecbolt", "proj", "weapons\\plasma rifle\\charged bolt"}
  163.         objects[39] = {"rocketproj", "proj", "weapons\\rocket launcher\\rocket"}
  164.         objects[40] = {"shottyshot", "proj", "weapons\\shotgun\\pellet"}
  165.         objects[41] = {"snipershot", "proj", "weapons\\sniper rifle\\sniper bullet"}
  166.  
  167.  
  168. function GetRequiredVersion()
  169.     return 10057
  170. end
  171.  
  172.  
  173. function OnScriptLoad(process)
  174.  
  175.     profilepath = getprofilepath()
  176.     registertimer(30, "hide")
  177.     registertimer(1000*60*5, "servertimer")
  178.     registertimer(500, "HprintTimer")
  179.     --registertimer(10, "fly")
  180.  
  181.     if falldamage == 0 then --DEFINATELY DONT TOUCH THIS IF
  182.         falldamage = 0.00001 --IF YOU TOUCH THIS YOU WILL BE SORRY
  183.     end --IF YOU SCREW ANYTHING UP, I TOLD YOU SO
  184.     --[[If the server has a falldamage of 0 then the player can't exit]]--
  185.  
  186.     commandsHandler()
  187.     filterLoad()
  188.     ipbanlist(0)
  189.     boslist(1)
  190.  
  191. end
  192.  
  193.  
  194. function OnScriptUnload()
  195.     filterSave()
  196. end
  197.  
  198.  
  199. function OnNewGame(map)
  200. end
  201.  
  202.  
  203. function OnGameEnd(mode)
  204.  
  205. end
  206.  
  207.  
  208. function OnServerChat(player, chattype, message)
  209.  
  210.     local response = 1 --returns this variable when this function has completed. 1 means that the message should go through, 0 to block it.
  211.     local hash = gethash(player) --sets local variable hash to the player's hash who has done the message
  212.     local name = getname(player) --sets local variable name to the player's name who has done the message
  213.  
  214.     local first_character = string.sub(message, 1, 1) --see if this is a /, \, or @ command
  215.  
  216.     if first_character == "@" and T_publicCmdHandler == true then -- public commands, if the first character is @ and this script handles public commands then
  217.         local message = string.sub(message, 2) --gets the command (after the @)
  218.         local count = gettokencount(message, " ") --gets the amount of words/paramaters.
  219.         local t = {} --local table t
  220.  
  221.         -- insert the tokens (words) into a table
  222.         for i=1,count do --i=1 then after i reaches local variable count stop the loop
  223.             local word = gettoken(message, " ", i - 1) -- sets local variable "word" to token i-1 with a space separating the tokens
  224.             word = string.lower(word) --converts the string to all lowercase
  225.             word = word:gsub('"', "") --sets local variable "word" to word without the quotes.
  226.             table.insert(t, word) --puts local variable "word"
  227.         end --end of the code to loop
  228.  
  229.         if t[1] == "suicide" then --if t[1] (the command) is suicide then
  230.             kill(player) -- kill the player
  231.         end
  232.  
  233.         response = 0 --set response to 0 (don't send to public chat)
  234.  
  235.     elseif first_character == "/" and T_adminCmdHandler == true then -- admin commands, if the first character is / and this script handles admin commands then
  236.         if string.sub(message, 2, player) ~= "reloadscripts" then --if the command (everything after the 1st character) isn't reloadscripts then
  237.             svcmd("sv_" .. string.sub(message, 2), player) --execute the command with sv_ appended to the beggining.
  238.         else
  239.             privateSay(player, "You cannot use this command.") --private console message
  240.         end
  241.  
  242.         response = 0 --set response to 0 (don't send to public chat)
  243.  
  244.     elseif chatFilter == true then
  245.         local count = gettokencount(message, " ") --gets the amount of words/paramaters.
  246.  
  247.         -- insert the tokens (words) into a table
  248.         for i=1,count do --i=1 then after i reaches local variable count stop the loop
  249.             local word = gettoken(message, " ", i - 1) -- sets local variable "word" to token i-1 with a space separating the tokens
  250.             word = string.lower(word) --converts the string to all lowercase
  251.             word = word:gsub('"', "")
  252.             word = word:gsub("_", "")
  253.             word = word:gsub("-", "")
  254.  
  255.             for i,v in ipairs(filteredWords) do
  256.                 if word == v then response = 0 end
  257.             end
  258.         end --end of the code to loop
  259.  
  260.  
  261.  
  262.     end
  263.  
  264.  
  265.  
  266.     return response
  267. end
  268.  
  269.  
  270. function OnServerCommand(player, command)
  271.  
  272.     local handledcommand = false
  273.     local response = 1 --returns this variable when this function has completed. 1 means that the command should go through, 0 to block it.
  274.     local hash = gethash(player) --sets local variable hash to the player's hash who has done the command
  275.     local name = getname(player) --sets local variable hash to the player's hash who has done the command
  276.  
  277.     local toksize = getcmdtokencount(command) --same as count in OnServerChat except words in-between quotes are counted as one.
  278.     local cmd = getcmdtoken(command, 0) --Command being executed
  279.     local t = {}
  280.  
  281.     -- insert the tokens (words) into a table
  282.     for i=1,toksize do --i=1 then after i reaches local variable "toksize" stop the loop
  283.         local word = getcmdtoken(command, i-1)
  284.         table.insert(t, word)
  285.     end
  286.  
  287.  
  288.     for i = 1 , #handledCommands--[[Amount of handled commands]] do --loop through all of the handled commands.
  289.         if t[1] == handledCommands[i] then -- if t[1] (the command) is a handled command
  290.             if t[1] == "sv_hide" then response = hidecommand(player,hash)-- hide command
  291.             elseif t[1] == "sv_unhide" then response = unhidecommand(player,hash)-- unhide command
  292.             elseif t[1] == "sv_myobj" then response = myobj(player,hash) --myobj command
  293.             elseif t[1] == "sv_splatterdmg" then response = splatterdmgCommand(player, hash,t[2])--splatterdmg command
  294.             elseif t[1] == "sv_falldmg" then response = falldmgCommand(player,hash,t[2]) --falldmg command
  295.             elseif t[1] == "sv_damageq" then response = damageqCommand(player,hash) --damage query command
  296.             elseif t[1] == "sv_mdamage" then response = mdamageCommand(player,hash, t[2]) --falldmg command
  297.             elseif t[1] == "sv_pnades" then response = pnadesCommand(player,hash, t[2])
  298.             elseif t[1] == "sv_fnades" then response = fnadesCommand(player,hash, t[2])
  299.             elseif t[1] == "sv_cnades" then response = cnadesCommand(player,hash)
  300.             elseif t[1] == "sv_ipban" then response = ipbanCommand(player, hash, t[2])
  301.             elseif t[1] == "sv_ipbanlist" then response = ipbanlistCommand(player, hash)
  302.             elseif t[1] == "sv_unipban" then response = unipbanCommand(player, hash, t[2])
  303.             elseif t[1] == "sv_superban" then response = superbanCommand(player, hash, t[2])
  304.             elseif t[1] == "sv_addfilter" then response = addfilterCommand(player, hash, t[2])
  305.             elseif t[1] == "sv_camq" then response = cameQueryCommand(player)
  306.             elseif t[1] == "sv_hsay" then response = hsayCommand(player, t[2])
  307.             elseif t[1] == "sv_bos" then response = bosCommand(t[2])
  308.             elseif t[1] == "sv_unbos" then response = unbosCommand(t[2])
  309.             elseif t[1] == "sv_boslist" then response = boslistCommand(player, hash)
  310.             elseif t[1] == "sv_viewip" then response = viewipCommand(t[2])
  311.             elseif t[1] == "sv_weapontotal" then response = weapontotalCommand(t[2])
  312.             --elseif t[1] == "sv_fly" then response = flycommand(player, hash) -- requires client side modification
  313.             --elseif t[1] == "sv_samename" then response = samename(t[2] - 1) -- requires client side modification
  314.             --elseif t[1] == "sv_antiname" then response = antinameCommand() -- requires client side modification
  315.             --elseif t[1] == "sv_sj" then response = sjCommand(player, t[2])-- requires client side modification
  316.             else
  317.                 for ib = 1, table.getn(commandAlias) do
  318.                     if commandAlias[ib][2] == t[1] then
  319.                         if commandAlias[ib][2] == handledCommands[i] then
  320.                             local rebuiltCommand = commandAlias[ib][1] .. string.sub(command, string.len(commandAlias[ib][2]) + 1)
  321.                             response = 0
  322.                             svcmd(rebuiltCommand, player)
  323.                         end
  324.                     end
  325.                 end
  326.             end
  327.         end
  328.     end
  329.  
  330.     if response ~= 0 and response ~= 1 then
  331.         privateSay(player, response)
  332.         saidsomething = true
  333.         response = 0
  334.     end
  335.  
  336.     return response
  337. end
  338.  
  339.  
  340. function OnTeamDecision(cur_team)
  341. end
  342.  
  343.  
  344. function OnPlayerJoin(player, team)
  345.     local pip = getip(player)
  346.     local hash = gethash(player)
  347.  
  348.     for i,v in ipairs(t_ipbanlist) do
  349.         for k,p in ipairs(t_ipbanlist[i]) do
  350.             if p == pip then svcmd("sv_kick " .. player + 1) end
  351.         end
  352.     end
  353.     for i,v in ipairs(t_boslist) do
  354.         for k,p in ipairs(t_boslist[i]) do
  355.             if p == hash then svcmd("sv_ban " .. player + 1 .. " 0") end
  356.         end
  357.     end
  358.     --if antiname == true then samename(player) end -- Requires client modification
  359. end
  360.  
  361.  
  362. function OnPlayerLeave(player, team)
  363.     local currentPlayers = getplayers()
  364.     if currentPlayers == 0 then svcmd("sv_map_reset") end -- do a map reset to fix any bugs.
  365.     local hash = gethash(player)
  366.     hidden[hash] = nil
  367.     pastplayer[player+1] = {getname(player), gethash(player)}
  368.     --[[for i,v in ipairs(r_names) do -- Requires client modification
  369.         if r_names[i][2] == player then
  370.             r_names[i][2] = false
  371.         end
  372.     end--]]
  373. end
  374.  
  375.  
  376. function OnPlayerKill(killer, victim, mode)
  377.  
  378.     if protected[hash] ~= nil then  -- if they have been in the list
  379.         protected[hash] = nil --then remove them from protected list
  380.     end
  381.  
  382. end
  383.  
  384.  
  385. function OnKillMultiplier(player, multiplier)
  386. end
  387.  
  388.  
  389. function OnPlayerSpawn(player, m_objectId)
  390.     local hash = gethash(player)
  391.     if sprotect ~= 0 then
  392.         registertimer(sprotect * 1000, "spawnprotect", hash) --initiate spawn protection
  393.         spawnprotect(1, 0, hash)
  394.     end
  395. end
  396.  
  397.  
  398. function OnPlayerSpawnEnd(player, m_objectId)
  399.  
  400.     if weapontotal == 3 then
  401.         local weapobj3 = createobject(objects[19][2], objects[19][3], 0, 1, false, 0, 0, 0)
  402.         assignweapon(player, weapobj3)
  403.         table.insert(weapdespawning, weapobj3) -- created weapons can't be destroyed automatically, putting them in a table
  404.     end
  405.  
  406.     local m_obj = getobject(m_objectId)
  407.  
  408.     if cnades == 1 then
  409.         writebyte(m_obj, 0x31E, fragamount)
  410.         writebyte(m_obj, 0x31F, plasmaamount)
  411.     end
  412.  
  413.  
  414. end
  415.  
  416. function OnTeamChange(relevant, player, team, dest_team)
  417.     return 1
  418. end
  419.  
  420. function OnObjectInteraction(player, m_ObjectId, tagType, tagName)
  421.     damagesay(tagName, tagType)
  422.  
  423.     local hash = gethash(player)
  424.     local response = 1
  425.  
  426.     return response
  427. end
  428.  
  429.  
  430. function OnWeaponReload(player, weapon)
  431.     return 1
  432. end
  433.  
  434.  
  435. function OnVehicleEntry(relevant, player, vehicleId, vehicle_tag, seat)
  436.  
  437.     local hash = gethash(player)
  438.     local response = 1
  439.  
  440.     if hidden[hash] ~= nil then
  441.         response = 0
  442.     end
  443.  
  444.     return response
  445. end
  446.  
  447.  
  448. function OnVehicleEject(player, forceEject)
  449.     return 1
  450. end
  451.  
  452.  
  453. function OnDamageLookup(receiving_obj, causing_obj, tagdata, tagname)
  454.     damagesay(tagname, tagdata)
  455.  
  456.     local _min_dmg = readfloat(tagdata, 0x1D0)
  457.     local _max_dmg_min = readfloat(tagdata, 0x1D4)
  458.     local _max_dmg_max = readfloat(tagdata, 0x1D8)
  459.  
  460.     if tagname == "globals\\vehicle_collision" or --if damage is by vehicle/splatter
  461.         tagname == "globals\\vehicle_kiled_unit" then
  462.  
  463.             local min_dmg = readfloat(tagdata, 0x1D0)
  464.             local max_dmg_min = readfloat(tagdata, 0x1D4) --vv
  465.             local max_dmg_max = readfloat(tagdata, 0x1D8) ----vv
  466.  
  467.             writefloat(tagdata, 0x1D0, min_dmg * vehidamage) --vv
  468.             writefloat(tagdata, 0x1D4, max_dmg_min * vehidamage) --set damage to %age
  469.             writefloat(tagdata, 0x1D8, max_dmg_max * vehidamage) --^^
  470.     end
  471.  
  472.     if causing_obj ~= 0xFFFFFFFF then --if damage by player
  473.         local causer = objecttoplayer(causing_obj) --causer memory id
  474.         local causerhash = gethash(causer) --causer hash
  475.         local receiver = objecttoplayer(receiving_obj) -- reciever memory id
  476.         local recieverhash = gethash(receiver) --reciever hash
  477.  
  478.         if hidden[causerhash] ~= nil then --and causer is hidden
  479.  
  480.             writefloat(tagdata, 0x1D0, 0) --vv
  481.             writefloat(tagdata, 0x1D4, 0) --disable damage
  482.             writefloat(tagdata, 0x1D8, 0) --^^
  483.  
  484.         elseif protected[recieverhash] == 1 and sprotect ~= 0 then -- if reciever is protected
  485.  
  486.             writefloat(tagdata, 0x1D0, 0) --vv
  487.             writefloat(tagdata, 0x1D4, 0) --disable damage
  488.             writefloat(tagdata, 0x1D8, 0) --^^
  489.  
  490.         end
  491.     end
  492.  
  493.     if hidden[recieverhash] ~= nil then --if reciever is hidden
  494.  
  495.         writefloat(tagdata, 0x1D0, 0) --vv
  496.         writefloat(tagdata, 0x1D4, 0) --disable damage
  497.         writefloat(tagdata, 0x1D8, 0) --^^
  498.  
  499.     end
  500.  
  501.     if mdamage ~= 1 and tagname ~= "globals\\falling" then
  502.         local min_dmg = readfloat(tagdata, 0x1D0)
  503.         local max_dmg_min = readfloat(tagdata, 0x1D4) --vv
  504.         local max_dmg_max = readfloat(tagdata, 0x1D8) ----vv
  505.         writefloat(tagdata, 0x1D0, min_dmg * mdamage) --vv
  506.         writefloat(tagdata, 0x1D4, max_dmg_min * mdamage) --set damage to %age
  507.         writefloat(tagdata, 0x1D8, max_dmg_max * mdamage) --^^
  508.     end
  509.  
  510.     if tagname == "globals\\falling" then --if damage is by falldamage
  511.  
  512.         local min_dmg = readfloat(tagdata, 0x1D0)
  513.         local max_dmg_min = readfloat(tagdata, 0x1D4) --vv
  514.         local max_dmg_max = readfloat(tagdata, 0x1D8) ----vv
  515.  
  516.         writefloat(tagdata, 0x1D0, min_dmg * falldamage) --set damage to %age
  517.         writefloat(tagdata, 0x1D4, max_dmg_min * falldamage)----^^
  518.         writefloat(tagdata, 0x1D8, max_dmg_max * falldamage)--^^
  519.     end
  520.  
  521.     if tagname == "globals\\falling"  and max_dmg_max == 0 then --if damage is by falldamage
  522.  
  523.         local min_dmg = readfloat(tagdata, 0x1D0)
  524.         local max_dmg_min = readfloat(tagdata, 0x1D4) --vv
  525.         local max_dmg_max = readfloat(tagdata, 0x1D8) ----vv
  526.  
  527.         writefloat(tagdata, 0x1D0, _min_dmg * .0001) --set damage to %age
  528.         writefloat(tagdata, 0x1D4, _max_dmg_min * .0001)----^^
  529.         writefloat(tagdata, 0x1D8, _max_dmg_max * .0001)--^^
  530.     end
  531. end
  532.  
  533.  
  534. function OnWeaponAssignment(player, object, count, tag)
  535. end
  536.  
  537.  
  538. function OnObjectCreation(m_objectId, player_owner, tag)
  539.     local m_object = getobject(m_objectId)
  540.     local obj_type = readbyte(m_object, 0xB4)
  541.     damagesay(tag, obj_type)
  542. end
  543. ---------- Custom Functions ----------
  544. function writestring(string, address, offset, spacing, endian)
  545.  
  546.         local char_table = {}
  547.         address = address + offset
  548.  
  549.         if spacing == nil then
  550.                 spacing = 0x1
  551.         end
  552.  
  553.         for word in string:gmatch(".") do
  554.                 table.insert(char_table, string.byte(word))
  555.         end
  556.  
  557.         local length = table.getn(char_table)
  558.  
  559.         if endian == 1 then
  560.                 for i=0,length do
  561.                         writebyte(address, spacing * i, char_table[length - i])
  562.                 end
  563.         else
  564.                 for i=0,length do
  565.                         writebyte(address, spacing * i, char_table[i + 1])
  566.                 end
  567.         end
  568.  
  569. end
  570.  
  571. function servertimer(id, count)
  572.     svcmd("sv_teams_balance")
  573.     return 1
  574. end
  575.  
  576. hashToPlayer = function(hash) -- Made by wizard
  577.  
  578.     for i = 0, 15 do
  579.         if gethash(i) == hash then
  580.             return i
  581.         end
  582.     end
  583.  
  584.     return nil
  585. end
  586.  
  587. function spawnprotect(id, count, hash)
  588.     if protected[hash] == nil or protected[hash] == 0 then --if player isn't in protected list
  589.         if count == 0 then --first millisecond the function is called
  590.             protected[hash] = 1 --then add player to protected list
  591.         end
  592.     end
  593.     if protected[hash] == 1 then --if player is in protected list
  594.         if count == 1 then -- if they have been in the list
  595.             protected[hash] = 0 --then remove them from protected list
  596.             return 0
  597.         end
  598.     end
  599.     if count > 1 and protected[hash] ~= nil then
  600.         protected[hash] = 0
  601.         return 0
  602.     end
  603.     if count >= 1 then return 0 end
  604. end
  605.  
  606. function getplayers() --returns how many players are in server
  607.     local playeramount = 0
  608.  
  609.     for i = 0,15 do
  610.         if getplayer(i) ~= nil then
  611.             playeramount = playeramount + 1
  612.         end
  613.     end
  614.     return playeramount
  615. end
  616.  
  617. function damagesay(damage, dtype)
  618.     for player = 0, 15 do
  619.  
  620.         local hash = gethash(player)
  621.  
  622.         if damagequery[hash] == 1 then
  623.             privateSay(player, damage .. " " .. dtype)
  624.         end
  625.     end
  626. end
  627.  
  628. function hide(id, count) --le other part of hide
  629.  
  630.     for player = 0, 15 do
  631.  
  632.         local hash = gethash(player)
  633.  
  634.         if hidden[hash] ~= nil then
  635.  
  636.             local m_player = getplayer(player)
  637.             local m_objectId = getplayerobjectid(player)
  638.             local m_object = getobject(m_objectId)
  639.  
  640.             local x = 0.678638
  641.             local y = -164.587585
  642.             local z = 15.038022
  643.  
  644.             writefloat(m_player, 0xF8, 0) -- Moves the visibility of the player somewhere else
  645.             writefloat(m_player, 0xFC, 0) -- Moves the visibility of the player somewhere else
  646.             writefloat(m_player, 0x100, 0) -- Moves the visibility of the player somewhere else
  647.             writefloat(m_object, 0x170, x) -- Moves the coords that the player will be damaged to
  648.             writefloat(m_object, 0x174, y) -- Moves the coords that the player will be damaged to
  649.             writefloat(m_object, 0x178, z) -- Moves the coords that the player will be damaged to
  650.  
  651.         end
  652.  
  653.     end
  654.  
  655.     return 1
  656. end
  657. ---------- Say Functions ----------
  658. Say = function(message) -- Made by Wizard
  659.     message = message or "Hollie!"
  660.     for i = 0,15 do
  661.         if getplayer(i) ~= nil then
  662.             privateSay(i, message)
  663.         end
  664.     end
  665. end
  666.  
  667. privateSay = function(player, message, time) -- Made by Wizard
  668.  
  669.     time = time or 5
  670.     local hash = gethash(player)
  671.     if hash ~= nil then
  672.         if messages[hash] == nil then messages[hash] = {} end
  673.         table.insert(messages[hash], {["message"] = message, ["time"] = time})
  674.     end
  675. end
  676.  
  677. HprintTimer = function(id, count) -- Made by Wizard
  678.  
  679.     if messages ~= {} then
  680.         for k,v in pairs(messages) do
  681.             if messages[k] ~= {} then
  682.                 for key,value in ipairs(messages[k]) do
  683.                     messages[k][key].time = messages[k][key].time - 0.5
  684.                     if messages[k][key].time < 0 then
  685.                         table.remove(messages[k], key)
  686.                     end
  687.                 end
  688.             end
  689.         end
  690.  
  691.         for k,v in pairs(messages) do
  692.             if #messages[k] > 0 then
  693.                 local player = hashToPlayer(k)
  694.                 for i = 1, 30 do
  695.                     hprintf(" ", player)
  696.                 end
  697.                 for key,value in ipairs(messages[k]) do
  698.                     hprintf(messages[k][key].message, player)
  699.                 end
  700.             end
  701.         end
  702.     end
  703.  
  704.     return 1
  705. end
  706. ------------
  707. ---------- Chat Filter Section ----------
  708. function filterLoad()
  709.     local file = io.open(profilepath .. "\\chatFilter.txt", "r")
  710.     if file == nil then
  711.         file = io.open(profilepath .. "\\chatFilter.txt","w")
  712.         file:close()
  713.         file = io.open(profilepath .. "\\chatFilter.txt", "r")
  714.     end
  715.  
  716.     local i = 1
  717.     for line in file:lines() do
  718.         sLine = tostring(line)
  719.         filteredWords[i] = sLine
  720.         i = i+1
  721.     end
  722. end
  723.  
  724. function filterSave()
  725.     local file = io.open(profilepath .. "\\chatFilter.txt", "w")
  726.     for i,v in ipairs(filteredWords) do
  727.         file:write(v .. "\n")
  728.     end
  729.     file:flush()
  730.     file:close()
  731. end
  732. ---------- Phasor Markup Section ----------
  733. function commandsHandler()
  734.     local pcm = io.open(profilepath .."\\commands.pmf", "r") --opens commands.pmf, a text file.
  735.     if pcm ~= nil then --If that file exists, then
  736.  
  737.         local locationFound = false --script found
  738.         local foundIn = 0 --line script found in
  739.         local foundEnd = false --found end of script
  740.         local commandsFound = false --commands of the script found
  741.         local commandsEnd = false -- end of commands found
  742.         local totalCommands = 0 --total commands
  743.  
  744.         local i = 1 --set local variable i to 1
  745.         for line in pcm:lines() do -- for every line in pcm
  746.             local sLine = tostring(line) --convert the line to a string
  747.  
  748.             if locationFound == false and foundEnd == false then --if the script hasn't been found or hasn't finished then
  749.                 if string.find(sLine, "script: " .. scriptName .. " " .. scriptVersion) ~= nil then --if this line starts the script
  750.                     locationFound = true --set the locationfound to true
  751.                 end
  752.             elseif locationFound == true and foundEnd == false then --if we're in the script then
  753.                 if string.find(sLine, "T_publicCmdHandler") ~= nil then --if T_publicCmdHandler is found then
  754.  
  755.                     if string.find(sLine, "true") ~= nil then -- set T_publicCmdHandler to true
  756.                         T_publicCmdHandler = true
  757.                     else
  758.                         T_publicCmdHandler = false
  759.                     end
  760.  
  761.                 elseif string.find(sLine, "T_adminCmdHandler") ~= nil then --
  762.  
  763.                     if string.find(sLine, "true") ~= nil then
  764.                         T_adminCmdHandler = true
  765.                     else
  766.                         T_adminCmdHandler = false
  767.                     end
  768.  
  769.                 elseif string.find(sLine, "T_rAdminCmdHandler") ~= nil then
  770.  
  771.                     if string.find(sLine, "true") ~= nil then
  772.                         T_rAdminCmdHandler = true
  773.                     else
  774.                         T_rAdminCmdHandler = false
  775.                     end
  776.  
  777.                 elseif string.find(sLine, "commands:") ~= nil and commandsFound == false then
  778.  
  779.                     commandsFound = true
  780.                     handledCommands = {}
  781.  
  782.                 elseif commandsFound == true and commandsEnd == false then --if in the commands section then
  783.  
  784.                     local commandStLoc = string.find(sLine, "sv_") --see if line contains a command
  785.                     if  commandStLoc ~= nil then --if it does then
  786.                         totalCommands = totalCommands + 1 --increase totalCommands
  787.                         handledCommands[totalCommands] = string.sub(sLine, commandStLoc) --add command to handled command list
  788.                     end
  789.  
  790.                 elseif string.find(sLine, "endCommands:") ~= nil and commandsfount == true then --if end of commands found then
  791.  
  792.                     commandsEnd = true
  793.  
  794.                 elseif string.find(sLine, "endScript:") ~= nil and locationFound == true then --if end of script found then
  795.  
  796.                     foundEnd = true
  797.  
  798.                 end
  799.             end
  800.         i = i + 1 --increase i
  801.         end
  802.     else
  803.         --say("commands.pmf could not be opened.")
  804.     end
  805. end
  806. -------------------------------------------------
  807. function ipbanlist(mode)
  808.     if mode == 0 then --load file
  809.         local textFile = io.open(profilepath .. "\\ipbanlist.txt", "r")
  810.  
  811.         if textFile == nil then
  812.             textFile = io.open(profilepath .. "\\ipbanlist.txt","w")
  813.             textFile:close()
  814.             textFile = io.open(profilepath .. "\\ipbanlist.txt", "r")
  815.         end
  816.  
  817.         if textFile ~= nil then
  818.             local i = 1
  819.             for line in textFile:lines() do
  820.                 local sLine = tostring(line)
  821.                 local comma = string.find(sLine, ",")
  822.                 if comma ~= nil then
  823.                     local name = string.sub(sLine, 1, comma - 1)
  824.                     local ipaddr = string.sub(sLine, comma + 1)
  825.                     t_ipbanlist[i] = {name,ipaddr}
  826.                 end
  827.                 i = i + 1
  828.             end
  829.         end
  830.         textFile:close()
  831.     elseif mode == 1 then -- save file
  832.         local textFile = io.open(profilepath .. "\\ipbanlist.txt", "w")
  833.             for i,v in ipairs(t_ipbanlist) do
  834.                 if t_ipbanlist[i] ~= nil then
  835.                     local linetowrite = t_ipbanlist[i][1] .. "," .. t_ipbanlist[i][2] .. "\n"
  836.                     textFile:write(linetowrite)
  837.                 end
  838.             end
  839.         textFile:flush()
  840.         textFile:close()
  841.     end
  842. end
  843.  
  844. function boslist(mode)
  845.     if mode == 0 then --load file
  846.         local textFile = io.open(profilepath .. "\\boslist.txt", "r")
  847.  
  848.         if textFile == nil then
  849.             textFile = io.open(profilepath .. "\\boslist.txt","w")
  850.             textFile:close()
  851.             textFile = io.open(profilepath .. "\\boslist.txt", "r")
  852.         end
  853.  
  854.         if textFile ~= nil then
  855.             local i = 1
  856.             for line in textFile:lines() do
  857.                 local sLine = tostring(line)
  858.                 local comma = string.find(sLine, ",")
  859.                 if comma ~= nil then
  860.                     local daname = string.sub(sLine, 1, comma - 1)
  861.                     local dahash = string.sub(sLine, comma + 1)
  862.                     t_boslist[i] = {daname,dahash}
  863.                 end
  864.                 i = i + 1
  865.             end
  866.         end
  867.         textFile:close()
  868.     elseif mode == 1 then -- save file
  869.         local textFile = io.open(profilepath .. "\\boslist.txt", "w")
  870.             for i,v in ipairs(t_boslist) do
  871.                 if t_boslist[i] ~= nil then
  872.                     local linetowrite = t_boslist[i][1] .. "," .. t_boslist[i][2] .. "\n"
  873.                     textFile:write(linetowrite)
  874.                 end
  875.             end
  876.         textFile:flush()
  877.         textFile:close()
  878.     end
  879. end
  880. ----------------------
  881. ---- Require Mods ----
  882. ----------------------
  883.  
  884. --[[function samename(player) -- requires client side modification
  885.     local m_player = getplayer(player)
  886.     local m_objectId = getplayerobjectid(player)
  887.     local m_object = getobject(m_objectId)
  888.     for i,v in ipairs(r_names) do
  889.         if r_names[i][2] == player then
  890.             return "Player already using fixed name"
  891.         end
  892.         if r_names[i][2] == false then
  893.             writestring(r_names[i][1],m_player, 0x4, 0x14)
  894.             writestring(r_names[i][1],m_player, 0x48, 0x14)
  895.             writestring(r_names[i][1],0x745D4A, 0x20 * player, 0x14)
  896.             r_names[i][2] = player
  897.         end
  898.     end
  899. end--]]
  900. --[[function fly(id, count) --le other part of fly -- requires client side modification
  901.  
  902.     for player = 0, 15 do
  903.         local hash = gethash(player)
  904.  
  905.         local m_objectId = getplayerobjectid(player)
  906.         local m_object = getobject(m_objectId)
  907.  
  908.         if flying[hash][1] == true then
  909.             local x = flying[hash][3]
  910.             local y = flying[hash][4]
  911.             local z = flying[hash][5]
  912.  
  913.             writefloat(flying[hash][2], 0x5C, 0)
  914.             writefloat(0x69C2F8  + player*0x30, 0x1C, x)
  915.             writefloat(0x69C2F8  + player*0x30, 0x20, y)
  916.             writefloat(0x69C2F8 + player*0x30, 0x24, z)
  917.         end
  918.     end
  919. end --]]
  920.  
  921. ---------- Command Section ----------
  922. ---------- BoS Commands ----------
  923. function bosCommand(ptbos)
  924.     boslist(0)
  925.     response = 0
  926.  
  927.     if string.len(ptbos) ~= 32 and string.len(ptbos) <= 2 then
  928.         ptbos = tonumber(ptbos, 10)
  929.         if ptbos <= 16 and ptbos >= 1 then
  930.             if pastplayer[ptbos] ~= nil then
  931.                 local name = pastplayer[ptbos][1]
  932.                 local hash = pastplayer[ptbos][2]
  933.                 local found = false
  934.                 for i = 1, table.getn(t_ipbanlist) do
  935.                     if t_boslist[i][2] == hash then
  936.                         found = true
  937.                         break
  938.                     end
  939.                 end
  940.                 if found == false then
  941.                     if t_boslist[1] == nil then
  942.                         t_boslist[1] = {name,hash}
  943.                     else
  944.                         t_boslist[table.getn(t_boslist) + 1] = {name,hash}
  945.                     end
  946.                     boslist(1)
  947.                     response = name .. " is to be banned on sight."
  948.                 else
  949.                     response = "Player already to be banned on sight."
  950.                 end
  951.             end
  952.         else
  953.             response = "Invalid player number"
  954.         end
  955.     elseif string.len(ptbos) == 32 then
  956.         local name = "N/A"
  957.         local hash = pastplayer[ptbos][2]
  958.         local found = false
  959.  
  960.         for i = 1, #t_ipbanlist do
  961.             if t_boslist[i][2] == hash then
  962.                 found = true
  963.                 break
  964.             end
  965.         end
  966.         if found == false then
  967.             if t_boslist[1] == nil then
  968.                 t_boslist[1] = {name,hash}
  969.             else
  970.                 t_boslist[#t_boslist + 1] = {name,hash}
  971.             end
  972.             boslist(1)
  973.             response = "The hash, \"" .. hash .. "\" is to banned on sight."
  974.         else
  975.             response = "Player already to be banned on sight."
  976.         end
  977.     else
  978.         response = "Invalid player number/hash"
  979.     end
  980.     return response
  981. end
  982.  
  983. function unbosCommand(pln)
  984.     local response = "Invalid Number"
  985.     boslist(0)
  986.     pln = tonumber(pln,10)
  987.     local plname = ""
  988.     local plip = ""
  989.     for i,v in ipairs(t_boslist) do
  990.         if pln == i then
  991.             plname = t_boslist[i][1]
  992.             plh = t_boslist[i][2]
  993.             t_boslist[pln] = nil
  994.             response = "Successfully removed hash: " .. plh .. " or Name: " .. plname .. "."
  995.         end
  996.     end
  997.     boslist(1)
  998.     return response
  999. end
  1000.  
  1001. function boslistCommand(player, hash)
  1002.     local response = 0
  1003.     boslist(0)
  1004.     if #t_boslist > 0 then
  1005.         for i,v in ipairs(t_boslist) do
  1006.             response = "[Number] , [Name] , [Hash]\n"
  1007.             response = response .. i .. " , " .. t_boslist[i][1] .. " , " .. t_boslist[i][2] .. "\n"
  1008.         end
  1009.     else
  1010.         return "Boslist empty"
  1011.     end
  1012.     return response
  1013. end
  1014.  
  1015. ------------------------------------------
  1016. function viewipCommand(pln)
  1017.     local response = 0
  1018.     pln = tonumber(pln) - 1
  1019.     if gethash(pln) ~= nil then
  1020.         response = "Player's IP: " .. getip(pln)
  1021.     else
  1022.         response = "Invalid Player Number"
  1023.     end
  1024.     return response
  1025. end
  1026.  
  1027. function reloadfilter(player, hash)
  1028.     filterLoad()
  1029.     return "Reloaded successfully!"
  1030. end
  1031.  
  1032. function addfilterCommand(player, hash, wta)
  1033.     words = table.getn(filteredWords)
  1034.     table.insert(filteredWords, tostring(wta))
  1035.     response = wta .. " was added successfully!"
  1036.     return response
  1037. end
  1038.  
  1039. function flycommand(player, hash)
  1040.     local response = 0
  1041.     local m_objectId = getplayerobjectid(player)
  1042.     local m_object = getobject(m_objectId)
  1043.     if flying[hash] == nil then
  1044.         local shee = createobject(objects[7][2], objects[7][3], 0, 1, false, 0, 0, 0)
  1045.         flying[hash] = {true, shee, readfloat(m_object, 0x5C), readfloat(m_object, 0x60),readfloat(m_object, 0x64)}
  1046.         entervehicle(player, shee, 0)
  1047.         writefloat(m_object, 0x5c, flying[hash][3])
  1048.         writefloat(m_object, 0x60, flying[hash][4])
  1049.         writefloat(m_object, 0x64, flying[hash][5])
  1050.         response = "BRAHAHADHSGFDFGDFHJKFDLH\n ME GUSTAN EL FLYING."
  1051.     end
  1052.     return response
  1053. end
  1054. --- Hide Command Section ---
  1055. function hidecommand(player,hash)
  1056.     local response = 0
  1057.     if hidden[hash] == nil then --if player isn't hidden
  1058.  
  1059.         local id = resolveplayer(player) --gets player id
  1060.         local m_objectId = getplayerobjectid(player) --gets object id
  1061.         local m_object = getobject(m_objectId) --gets memory address
  1062.  
  1063.         -- store player coords for later use
  1064.         hidden[hash] = {readfloat(m_object, 0x5C), readfloat(m_object, 0x60), readfloat(m_object, 0x64)}
  1065.  
  1066.         setspeed(player, hide_speed) --set player speed to hide speed.
  1067.  
  1068.         response = "*** YOU ARE NOW COMPLETELY INVISIBLE ***\n"
  1069.         response = response .. "Do not kill or disrupt the flow of the game while hidden.\n"
  1070.         response = response .. "FYI, shooting or throwing nades doesn't do any damage, so don't even try. It's disrupting\n"
  1071.         response = response .. "and it's abuse. Not to mention you're wasting ammo."
  1072.  
  1073.     end
  1074.     return response
  1075. end
  1076.  
  1077. function unhidecommand(player,hash)
  1078.     local response = 0
  1079.     setspeed(player, 1)
  1080.  
  1081.     -- teleport player back to original location
  1082.     svcmd("sv_teleport " .. player + 1 .. " " .. hidden[hash][1] .. " " .. hidden[hash][2] .. " " .. hidden[hash][3])
  1083.  
  1084.     -- clear data
  1085.     hidden[hash] = nil
  1086.  
  1087.     response = "You have been unhidden, and teleported back to your original location!"
  1088.  
  1089.     return response
  1090. end
  1091.  
  1092. function myobj(player,hash)
  1093.     local response = 0
  1094.     local m_player = getplayer(player) --gets player id
  1095.     local m_objectId = getplayerobjectid(player) --gets object id
  1096.     local m_object = getobject(m_objectId) --gets memory address
  1097.     response = m_player .. "\n"
  1098.     response = response .. m_objectId "\n"
  1099.     response = response .. m_object
  1100.     return response
  1101. end
  1102.  
  1103. function splatterdmgCommand(player,hash, dmg)
  1104.     local response = 0
  1105.     vehidamage = dmg
  1106.     response = "Splatter damage has been set to " .. dmg * 100 .. "%"
  1107.     return response
  1108. end
  1109.  
  1110. function falldmgCommand(player,hash, dmg)
  1111.     local response = 0
  1112.     local falldamagetmp = dmg
  1113.     if falldamagetmp == 0 then
  1114.         falldamage = 0.00001
  1115.     else
  1116.         falldamage = falldamagetmp
  1117.     end
  1118.  
  1119.     response = "Fall damage has been set to " .. dmg * 100 .. "%"
  1120.     return response
  1121. end
  1122.  
  1123. function damageqCommand(player,hash, dmg)
  1124.     local response = 0
  1125.     if damagequery[hash] == nil or damagequery[hash] == 0 then
  1126.         damagequery[hash] = 1
  1127.         response = "Damage Query has been turned on"
  1128.     elseif damagequery[hash] == 1 then
  1129.         damagequery[hash] = 0
  1130.         response = "Damage Query has been turned off"
  1131.     end
  1132.     return response
  1133. end
  1134.  
  1135. function mdamageCommand(player, hash, dmg)
  1136.     mdamage = dmg
  1137.     privateSay(player, "Fall damage has been set to " .. dmg * 100 .. "%")
  1138. end
  1139.  
  1140. function cnadesCommand(player, hash)
  1141.     local response = 0
  1142.     local truefalse = false
  1143.     if cnades == 1 then
  1144.         cnades = 0
  1145.         truefalse = false
  1146.         response = "Custom nades off."
  1147.     else
  1148.         cnades = 1
  1149.         truefalse = true
  1150.         response = "Custom nades on."
  1151.     end
  1152.     return response
  1153. end
  1154.  
  1155. function pnadesCommand(player, hash, amt)
  1156.     local response = 0
  1157.     plasmaamount = amt
  1158.     response = "Players will now spawn with " .. amt .. " plasma grenades"
  1159.     return response
  1160. end
  1161.  
  1162. function mdamageCommand(player, hash, dmg)
  1163.     mdamage = dmg
  1164.     local response = "Fall damage has been set to " .. dmg * 100 .. "%"
  1165.     return response
  1166. end
  1167.  
  1168. function ipbanCommand(player, hash, ptb)
  1169.     ipbanlist(0)
  1170.     local ptb = tonumber(ptb,10) - 1
  1171.     local pip = getip(ptb)
  1172.     local pnm = getname(ptb)
  1173.     if pnm ~= nil then
  1174.         local found = false
  1175.         for i = 1, table.getn(t_ipbanlist) do
  1176.             if t_ipbanlist[i][2] == pip then
  1177.                 found = true
  1178.                 break
  1179.             end
  1180.         end
  1181.         if found == false then
  1182.             if t_ipbanlist[1] == nil then
  1183.                 t_ipbanlist[1] = {pnm,pip}
  1184.             else
  1185.                 t_ipbanlist[table.getn(t_ipbanlist) + 1] = {pnm,pip}
  1186.             end
  1187.             ipbanlist(1)
  1188.         end
  1189.         ptb = ptb + 1
  1190.         svcmd("sv_kick " .. ptb, player)
  1191.         return "Successfully banned IP: " .. pip .. " or Name: " .. pnm .. "."
  1192.     end
  1193.     return "Invalid Player Number"
  1194. end
  1195.  
  1196. function ipbanlistCommand(player, hash)
  1197.     local response = 0
  1198.     ipbanlist(0)
  1199.     response = "[Number] , [Name] , [IP]\n"
  1200.     if t_ipbanlist ~= {} then
  1201.         for i,v in ipairs(t_ipbanlist) do
  1202.             response = response .. i .. " , " .. t_ipbanlist[i][1] .. " , " .. t_ipbanlist[i][2] .. "\n"
  1203.         end
  1204.     else
  1205.         resposne = "IP banlist is empty."
  1206.     end
  1207.     return response
  1208. end
  1209.  
  1210. function unipbanCommand(player, hash, pln)
  1211.     local response = "Invalid Number"
  1212.     ipbanlist(0)
  1213.     pln = tonumber(pln,10)
  1214.     local plname = ""
  1215.     local plip = ""
  1216.     for i,v in ipairs(t_ipbanlist) do
  1217.         if pln == i then
  1218.             plname = t_ipbanlist[i][1]
  1219.             plip = t_ipbanlist[i][2]
  1220.             t_ipbanlist[pln] = nil
  1221.             response = "Successfully removed IP: " .. plip .. " or Name: " .. plname .. "."
  1222.         end
  1223.     end
  1224.     ipbanlist(1)
  1225.     return response
  1226. end
  1227.  
  1228. function superbanCommand(player, hash, pn)
  1229.     ipbanCommand(player, hash, pn)
  1230.     svcmd("sv_ban " .. pn .. " 0", player)
  1231. end
  1232.  
  1233. function cameQueryCommand(player)
  1234.     local camera_xy = readfloat(camera_base + player*camera_size, 0x0)
  1235.     local camera_z = readfloat(camera_base + player*camera_size, 0x4)
  1236.     local camera_x_aim = readfloat(camera_base + player*camera_size, 0x1C)
  1237.     local camera_y_aim = readfloat(camera_base + player*camera_size, 0x20)
  1238.     local camera_z_aim = readfloat(camera_base + player*camera_size, 0x24)
  1239.  
  1240.     local response = "c_xy: " .. camera_xy
  1241.     response = response .. "\nc_z: " .. camera_z
  1242.     response = response .. "\nc_x_a: " .. camera_x_aim
  1243.     response = response .. "\nc_y_a: " .. camera_y_aim
  1244.     response = response .. "\nc_z_a: " .. camera_z_aim
  1245.  
  1246.     return response
  1247. end
  1248.  
  1249. function hsayCommand(player, msg)
  1250.     Say(msg)
  1251.     return 0
  1252. end
  1253.  
  1254. function weapontotalCommand(num)
  1255.     num = tonumber(num, 10)
  1256.     if num < 4 then
  1257.         weapontotal = num
  1258.         return "Weapon total now at " .. num .. "."
  1259.     end
  1260. end
  1261.  
  1262. --[[function antinameCommand() --Requires client side modification
  1263.     if antiname == false then
  1264.         antiname = true
  1265.         return "Users will be prevented from having the same names when joining a server"
  1266.     else
  1267.         antiname = false
  1268.         return "Users will be allowed to have the same names when joining a server"
  1269.     end
  1270. end--]]
  1271.  
  1272. --[[ Sightjack commands -- require client side modification
  1273. function sjCommand(player, jacked)
  1274.     local response = 0
  1275.     local hash = gethash(player)
  1276.     jacked = jacked - 1
  1277.  
  1278.     if gethash(jacked) ~= nil then
  1279.         local jackedName = getname(jacked)
  1280.  
  1281.         if jacking[hash] == nil then
  1282.             jacking[hash] = registertimer(30, "sightjack", player, jacked)
  1283.             response = "You are now sightjacking " .. jackedName .. "."
  1284.         else
  1285.             removetimer(jacking[hash])
  1286.             jacking[hash] = nil
  1287.             jacking[hash] = registertimer(30, "sightjack", player, jacked)
  1288.             response = "You are now sightjacking " .. jackedName .. "."
  1289.         end
  1290.     else
  1291.         response = "Incorrect player number"
  1292.     end
  1293.  
  1294.     return response
  1295. end
  1296.  
  1297. function sightjack(id, count, jacker, jacked)
  1298.     if gethash(jacker) ~= nil and gethash(jacked) ~= nil then
  1299.         local x = readfloat(0x69C2F8  + jacked*0x30, 0x1C)
  1300.         local y = readfloat(0x69C2F8  + jacked*0x30, 0x20)
  1301.         local z = readfloat(0x69C2F8  + jacked*0x30, 0x24)
  1302.         writefloat(0x69C2F8  + jacker*0x30, 0x1C, x)
  1303.         writefloat(0x69C2F8  + jacker*0x30, 0x20, y)
  1304.         writefloat(0x69C2F8 + jacker*0x30, 0x24, z)
  1305.         return 1
  1306.     else
  1307.         privateSay(jacker, "Sightjacked player no longer in server")
  1308.         return 0
  1309.     end
  1310. end --]]--[[ Sightjack commands -- require client side modification
  1311. function sjCommand(player, jacked)
  1312.     local response = 0
  1313.     local hash = gethash(player)
  1314.     jacked = jacked - 1
  1315.  
  1316.     if gethash(jacked) ~= nil then
  1317.         local jackedName = getname(jacked)
  1318.  
  1319.         if jacking[hash] == nil then
  1320.             jacking[hash] = registertimer(30, "sightjack", player, jacked)
  1321.             response = "You are now sightjacking " .. jackedName .. "."
  1322.         else
  1323.             removetimer(jacking[hash])
  1324.             jacking[hash] = nil
  1325.             jacking[hash] = registertimer(30, "sightjack", player, jacked)
  1326.             response = "You are now sightjacking " .. jackedName .. "."
  1327.         end
  1328.     else
  1329.         response = "Incorrect player number"
  1330.     end
  1331.  
  1332.     return response
  1333. end
  1334.  
  1335. function sightjack(id, count, jacker, jacked)
  1336.     if gethash(jacker) ~= nil and gethash(jacked) ~= nil then
  1337.         local x = readfloat(0x69C2F8  + jacked*0x30, 0x1C)
  1338.         local y = readfloat(0x69C2F8  + jacked*0x30, 0x20)
  1339.         local z = readfloat(0x69C2F8  + jacked*0x30, 0x24)
  1340.         writefloat(0x69C2F8  + jacker*0x30, 0x1C, x)
  1341.         writefloat(0x69C2F8  + jacker*0x30, 0x20, y)
  1342.         writefloat(0x69C2F8 + jacker*0x30, 0x24, z)
  1343.         return 1
  1344.     else
  1345.         privateSay(jacker, "Sightjacked player no longer in server")
  1346.         return 0
  1347.     end
  1348. end --]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement