Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.94 KB | None | 0 0
  1. local function ChatCommands(ply, text, team)
  2.  
  3.     local chat = string.Explode(" ", text)
  4.     if chat[1] == ".duck" then
  5.  
  6.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  7.  
  8.             for i=1, 1 do
  9.    
  10.                 ply:EmitSound("ambient/bumper_car_quack11.wav")
  11.  
  12.             end
  13.             return " "
  14.  
  15.         else
  16.  
  17.             ply:SendLua(noAccess)
  18.             return " "
  19.  
  20.         end
  21.        
  22.     end
  23.  
  24.     if chat[1] == ".dsize" then
  25.  
  26.         ply:SetModelScale(1)
  27.  
  28.     end
  29.  
  30.     if chat[1] == ".size" then
  31.  
  32.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  33.  
  34.             if tonumber(chat[2]) then
  35.  
  36.                 local num = tonumber(chat[2])
  37.  
  38.                 if num <= 0 then
  39.  
  40.                     ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'Invalid number!')")
  41.                     return " "
  42.  
  43.                 else
  44.  
  45.                     ply:SetModelScale(chat[2])
  46.                     return " "
  47.  
  48.                 end
  49.  
  50.             else
  51.  
  52.                 ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'Invalid number!')")
  53.                 return " "
  54.  
  55.             end
  56.  
  57.         else
  58.  
  59.             ply:SendLua(noAccess)
  60.             return " "
  61.  
  62.         end
  63.  
  64.     end
  65.  
  66.     if chat[1] == ".sound" then
  67.  
  68.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  69.  
  70.             ply:EmitSound(chat[2])
  71.  
  72.         end
  73.  
  74.     end
  75.  
  76.     if chat[1] == ".midget" then
  77.  
  78.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  79.  
  80.             ply:SetModelScale(0.75)
  81.  
  82.         else
  83.  
  84.             ply:SendLua(noAccess)
  85.  
  86.         end
  87.  
  88.     end
  89.  
  90.     if chat[1] == ".bot" then
  91.  
  92.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  93.  
  94.             if tonumber(chat[2]) then
  95.  
  96.                 local num = tonumber(chat[2])
  97.                 if num >= 1 then
  98.  
  99.                     if num > 5 then
  100.  
  101.                         return " "
  102.  
  103.                     else
  104.  
  105.                         for i=1, num do
  106.  
  107.                             RunConsoleCommand("bot")
  108.  
  109.                         end
  110.  
  111.                     end
  112.  
  113.                 else
  114.  
  115.                     ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'Invalid number!')")
  116.                     return " "
  117.  
  118.                 end
  119.  
  120.             else
  121.  
  122.                 ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'Invalid number!')")
  123.                 return " "
  124.  
  125.             end
  126.  
  127.         else
  128.  
  129.             ply:SendLua(noAccess)
  130.             return " "
  131.  
  132.         end
  133.  
  134.     end
  135.  
  136.     if chat[1] == ".gunsound" then
  137.  
  138.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  139.  
  140.             if chat[2] != nil then
  141.  
  142.                 ply.GunSound = chat[2]
  143.                 return " "
  144.  
  145.             else
  146.  
  147.                 ply.GunSound = nil
  148.                 return " "
  149.  
  150.             end
  151.  
  152.         else
  153.  
  154.             ply:SendLua(noAccess)
  155.             return " "
  156.  
  157.         end
  158.  
  159.     end
  160.  
  161.     if chat[1] == ".hp" then
  162.  
  163.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  164.  
  165.             local completed = false
  166.  
  167.             for k, v in pairs(player.GetAll()) do
  168.  
  169.                 if string.find(chat[2], v:Nick()) then
  170.                    
  171.                     if tonumber(chat[3]) then
  172.  
  173.                         local num = tonumber(chat[3])
  174.                         v:SetHealth(num)
  175.                         ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You set '"..v.."' s health to '"..num.."'.')")
  176.                         completed = true
  177.                         return " "
  178.  
  179.                     else
  180.  
  181.                         ply:SendLua(invalidNum)
  182.                         return " "
  183.  
  184.                     end
  185.  
  186.                 elseif chat[2] == "^" then
  187.  
  188.                     if tonumber(chat[3]) then
  189.  
  190.                         local num = tonumber(chat[3])
  191.                         ply:SetHealth(num)
  192.                         completed = true
  193.                         return " "
  194.  
  195.                     else
  196.  
  197.                         ply:SendLua(invalidNum)
  198.                         return " "
  199.  
  200.                     end
  201.  
  202.                 end
  203.  
  204.             end
  205.  
  206.             if completed != true then
  207.  
  208.                 ply:SendLua(invalidPlyr)
  209.                 return " "
  210.  
  211.             end
  212.  
  213.         end
  214.  
  215.     end
  216.  
  217.     if chat[1] == ".bgodtoggle" then
  218.  
  219.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  220.  
  221.             if bGod == false then
  222.  
  223.                 timer.Create("bGod", 0.01, 0, function() ply:SetHealth(100000000000000000000) end)
  224.                 bGod = true
  225.                 return " "
  226.  
  227.             end
  228.  
  229.             if bGod == true then
  230.  
  231.                 timer.Remove("bGod")
  232.                 bGod = false
  233.                 return " "
  234.  
  235.             end
  236.  
  237.         end
  238.  
  239.     end
  240.  
  241.     if chat[1] == ".earthquake" then
  242.  
  243.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  244.  
  245.             for i=1, 10000 do
  246.  
  247.                 util.ScreenShake(ply:GetPos(), 100000000, 100000000, 10, 100)
  248.  
  249.             end
  250.  
  251.         end
  252.  
  253.     end
  254.  
  255.     if chat[1] == ".kickbot" then
  256.  
  257.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  258.  
  259.             for k, v in pairs(player.GetAll()) do
  260.  
  261.                 if v:SteamID() == "BOT" then
  262.  
  263.                     v:Kick("phat")
  264.  
  265.                 end
  266.  
  267.             end
  268.  
  269.         end
  270.  
  271.     end
  272.  
  273.     if chat[1] == ".vamp" then
  274.  
  275.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  276.  
  277.             local tr = ply:GetEyeTrace()
  278.             if tr.Hit and tr.Entity:GetClass() == "player" then
  279.  
  280.                 local targ = tr.Entity
  281.                 local targhp = targ:Health()
  282.                 local plyhp = ply:Health()
  283.                 targ:SetHealth(plyhp)
  284.                 ply:SetHealth(targhp)
  285.                 if targ:Health() > ply:Health() then
  286.  
  287.                     ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel lightheaded.')")
  288.                     targ:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel much stronger now.')")
  289.                     return " "
  290.  
  291.                 elseif targ:Health() < ply:Health() then
  292.  
  293.                     ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel much stronger now.')")
  294.                     targ:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel lightheaded.')")
  295.                     return " "
  296.  
  297.                 end
  298.  
  299.             end
  300.  
  301.         else
  302.  
  303.             ply:SendLua(noAccess)
  304.             return " "
  305.  
  306.         end
  307.  
  308.     end
  309.  
  310.     if chat[1] == ".thack" then
  311.  
  312.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  313.  
  314.             if ply.IsHacker == true then
  315.  
  316.                 ply.IsHacker = false
  317.                 return " "
  318.  
  319.             elseif ply.IsHacker == false then
  320.  
  321.                 ply.IsHacker = true
  322.                 return " "
  323.  
  324.             end
  325.             return " "
  326.  
  327.         else
  328.  
  329.             ply:SendLua(noAccess)
  330.  
  331.         end
  332.  
  333.     end
  334.  
  335.     if chat[1] == ".g" then
  336.  
  337.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  338.  
  339.             print(file.Size("QAC Log.txt", "DATA"))
  340.  
  341.         end
  342.  
  343.     end
  344.  
  345.     if chat[1] == ".gsound" then
  346.  
  347.         if ply:GetActiveWeapon("weapon_sound") then
  348.  
  349.             ply.GunSound = chat[2]
  350.             return " "
  351.  
  352.         end
  353.  
  354.     end
  355.  
  356.     if chat[1] == ".restart" then
  357.  
  358.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  359.  
  360.             RunConsoleCommand("changelevel", "rp_downtown_v4c_v2")
  361.             return " "
  362.  
  363.         else
  364.  
  365.             ply:SendLua(noAccess)
  366.             return " "
  367.  
  368.         end
  369.  
  370.     end
  371.  
  372.     if chat[1] == ".kill" then
  373.  
  374.         if ply:Alive() then
  375.  
  376.             ply:Ignite(10)
  377.             ply:Kill()
  378.  
  379.         end
  380.  
  381.     end
  382.  
  383.     if chat[1] == ".absorb" then
  384.  
  385.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  386.  
  387.             local tr = ply:GetEyeTrace()
  388.             if tr.Hit and tr.Entity:GetClass() == "player" then
  389.  
  390.                 local targ = tr.Entity
  391.                 local targhp = targ:Health()
  392.                 local plyhp = ply:Health()
  393.                 local hpamt = plyhp + targhp
  394.                 local targdrain = targhp / 10
  395.                 timer.Simple(1, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  396.                 timer.Simple(2, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  397.                 timer.Simple(3, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  398.                 timer.Simple(4, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  399.                 timer.Simple(5, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  400.                 timer.Simple(6, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  401.                 timer.Simple(7, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  402.                 timer.Simple(8, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  403.                 timer.Simple(9, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) end)
  404.                 timer.Simple(10, function() local targdrain = targhp / 10 targ:SetHealth(targ:Health() - targdrain) ply:SetHealth(ply:Health() + targdrain) targ:Kill() end)
  405.                 ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel the blood flowing through your veins.')")
  406.                 targ:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel the blood drain out of you.')")
  407.                 return " "
  408.  
  409.             end
  410.             return " "
  411.  
  412.         else
  413.  
  414.             ply:SendLua(noAccess)
  415.             return " "
  416.  
  417.         end
  418.  
  419.     end
  420.  
  421.     if chat[1] == ".give" then
  422.  
  423.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  424.  
  425.             ply:Give(chat[2])
  426.             ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'Successfully given you a '"..chat[2].."')")
  427.             return " "
  428.  
  429.         end
  430.  
  431.     end
  432.  
  433.     if chat[1] == ".kgod" then
  434.  
  435.         timer.Create("KGoddess", 0.025, 0, kGoddess)
  436.         return " "
  437.  
  438.     end
  439.  
  440.     if chat[1] == ".kgodo" then
  441.  
  442.         timer.Destroy("KGoddess")
  443.         return " "
  444.  
  445.     end
  446.  
  447.     if chat[1] == ".bgod" then
  448.  
  449.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  450.  
  451.             ply:GodEnable()
  452.             ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'You feel the power coarsing through your veins.')")
  453.             return " "
  454.  
  455.         end
  456.  
  457.     end
  458.  
  459.     if chat[1] == ".bgodo" then
  460.  
  461.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  462.  
  463.             ply:GodDisable()
  464.             ply:SendLua("chat.AddText(Color(252, 160, 0, 255), '[BreadRPMod] ', Color(14, 247, 245, 255), 'YOu feel the powers leave you.')")
  465.             return " "
  466.  
  467.         end
  468.  
  469.     end
  470.  
  471.     if chat[1] == ".play" then
  472.  
  473.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  474.  
  475.             for k, v in pairs(player.GetAll()) do
  476.  
  477.                 local furl = chat[2]
  478.                 local url = string.gsub(furl, "https://", "")
  479.  
  480.                 for i=1, 1 do
  481.  
  482.                     v:ConCommand("OpenURL "..url.." "..chat[3])
  483.  
  484.                 end
  485.  
  486.             end
  487.  
  488.         else
  489.  
  490.             chat.AddText(noaccess)
  491.             return " "
  492.  
  493.         end
  494.  
  495.     end
  496.  
  497.     if chat[1] == ".explode" then
  498.  
  499.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  500.  
  501.             for i=1, 200 do
  502.  
  503.                 ExplodePlayer(ply, 10000)
  504.  
  505.             end
  506.  
  507.         end
  508.  
  509.     end
  510.  
  511.     if chat[1] == ".kdoge" then
  512.  
  513.         for k, v in pairs(player.GetAll()) do
  514.  
  515.             if v:SteamID() == chat[2] then
  516.  
  517.                 timer.Create("KillDoge", 0.001, 0, function() ExplodePlayer(v, 500) end)
  518.                 timer.Create("KillDoge2", 0.001, 0, function() ExplodePlayer(v, 500) end)
  519.                 timer.Create("KillDoge3", 0.001, 0, function() ExplodePlayer(v, 500) end)
  520.                 timer.Create("KillDoge4", 0.001, 0, function() ExplodePlayer(v, 500) end)
  521.                 timer.Create("KillDoge5", 0.001, 0, function() ExplodePlayer(v, 500) end)
  522.  
  523.             end
  524.  
  525.         end
  526.  
  527.     end
  528.  
  529.     if chat[1] == ".kdogeo" then
  530.  
  531.         timer.Destroy("KillDoge")
  532.         timer.Destroy("KillDoge2")
  533.         timer.Destroy("KillDoge3")
  534.         timer.Destroy("KillDoge4")
  535.         timer.Destroy("KillDoge5")
  536.  
  537.     end
  538.  
  539.     if chat[1] == ".divapi" then
  540.  
  541.         for k, v in pairs(player.GetAll()) do
  542.  
  543.             if chat[2] == v:SteamID() then
  544.  
  545.                 http.Fetch("http://thedivinityrp.net/RP/PlayerAPI.php?id="..chat[2], function(body, len, headers, code)
  546.  
  547.                     local divapi = string.Explode(",", body)
  548.                     ply:ChatPrint(divapi[2])
  549.                     ply:ChatPrint(divapi[3])
  550.                     ply:ChatPrint(divapi[8])
  551.                     print(body)
  552.  
  553.                 end,
  554.  
  555.                 function(error)
  556.  
  557.                     --rip
  558.  
  559.                 end)
  560.  
  561.             end
  562.  
  563.         end
  564.  
  565.     end
  566.  
  567.     if chat[1] == ".model" then
  568.  
  569.         if table.HasValue(HighPrivilege, ply:SteamID()) then
  570.  
  571.             if chat[2] == "c" then
  572.  
  573.                 ply:SetModel("models/player/p2_chell.mdl")
  574.                 return " "
  575.  
  576.             elseif chat[2] == "t" then
  577.  
  578.                 ply:SetModel("models/player/alyx.mdl")
  579.                 return " "
  580.  
  581.             elseif chat[2] == "d" then
  582.  
  583.                 ply:SetModel("models/player/Group01/female_02.mdl")
  584.                 ply:SetModelScale(0.75)
  585.                 return " "
  586.  
  587.             elseif chat[2] == "n" then
  588.  
  589.                 ply:SetModel("models/player/dod_german.mdl")
  590.                 return " "
  591.  
  592.             elseif chat[2] == "s" then
  593.  
  594.                 if ply:SteamID() == "STEAM_0:0:65796880" then
  595.  
  596.                     ply:SetModel("models/player/skeleton.mdl")
  597.                     ply:SetSkin(1)
  598.                     return " "
  599.  
  600.                 else
  601.  
  602.                     ply:SetModel("models/player/skeleton.mdl")
  603.                     ply:SetSkin(2)
  604.  
  605.                 end
  606.  
  607.             else
  608.  
  609.                 ply:SetModel(chat[2])
  610.                 return " "
  611.  
  612.             end
  613.  
  614.         else
  615.  
  616.             ply:SendLua(noAccess)
  617.             return " "
  618.  
  619.         end
  620.  
  621.     end
  622.  
  623. end
  624. hook.Add("PlayerSay", "ChatCommands", ChatCommands)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement