Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.05 KB | None | 0 0
  1. QE = QE or {}
  2.  
  3. QE.modes = {}
  4. QE.loadouts = {}
  5. // DO NOT EDIT ABOVE TEXT
  6.  
  7. ----------------------------------------------------------------------------------------------------------------
  8. QE.Font = "Roboto"
  9.  
  10. QE.HeaderTextColor = Color(0, 0, 0)
  11. QE.HeaderBGColor = Color(255, 255, 255)
  12.  
  13. QE.MainTextColor = Color(255,255,255)
  14. QE.MainBGColor = Color(0, 0, 0)
  15.  
  16. QE.JoinBGColor = Color(0, 200, 0, 255)
  17. QE.JoinTextColor = Color(200, 200, 200)
  18.  
  19. QE.IgnoreBGColor = Color(200, 0, 0, 255)
  20. QE.IgnoreTextColor = Color(200, 200, 200)
  21. ----------------------------------------------------------------------------------------------------------------
  22. QE.AutoEvent = {
  23.     enabled = true,
  24.     events = {"deathmatch","parkour"}, // will randomly choose the events
  25.     minplayers = 20, // minimum amount of players on server
  26.     time = 1220 // time in seconds
  27. }
  28.  
  29. QE.StaffGroups = {"superadmin","manager"} // To create/stop events
  30. ----------------------------------------------------------------------------------------------------------------
  31. QE.modes["deathmatch"] = {
  32.     enabled = true, // Enables/Disables the event
  33.     name = "Deathmatch", // Pretty name
  34.     desc = "Eliminate as many players as possible!", // Description
  35.     loadouts = {"rifle","sniper","knife","shotgun","machine","rocket"}, // Add/remove loadouts (make them using QE.loadouts) set to {"none"} to have no weapons
  36.     maxtime = 90, // Max event time
  37.     waittime = 30, // Waits for players to join
  38.     minplayers = 2, // Minimum amount of players to start event
  39.     maxplayers = 15, // Maximum amount of players that can join
  40.     onparticipate = function(ply) // Custom function when the event starts
  41.         ply.QE_DMKills = 0
  42.         ply:SetHealth(100)
  43.         ply:SetArmor(0)
  44.         ply:StripWeapons()
  45.         v:SendLua([[surface.PlaySound( "buttons/button9.wav" )]])
  46.     end,
  47.     onkill = function(vic, ply) // Custom function when a player kills someone
  48.         if IsValid(vic) and IsValid(ply) then
  49.             if !(vic == ply) then // Do not allow suicide
  50.                 ply.QE_DMKills = ply.QE_DMKills + 1
  51.             end
  52.         end
  53.         QE.modes["deathmatch"].onplyspawn(vic)
  54.     end,
  55.     onplyspawn = function(ply) // Custom function when a player spawns everytime
  56.         ply:SetPos(table.Random(QE.modes["deathmatch"].teleportpositions)) // Respawn them
  57.         ply:SetHealth(100)
  58.         ply:SetArmor(0)
  59.         ply:StripWeapons() // Strip weapons
  60.         ply:Give(table.Random(QE.loadouts[QE.currentevent.loadout or "none"].weaps) or "") // Give one random weapon
  61.         QE.loadouts[QE.currentevent.loadout].onloadout(ply) // custom function
  62.     end,
  63.     onstart = function(participants) // Custom function when the event starts
  64.     end,
  65.     onend = function(participants) // Custom function when the event ends
  66.         local best, highest = NULL, 0
  67.         for _, v in pairs (participants) do
  68.             if !IsValid(v) then continue end
  69.             v:StripWeapons()
  70.             v:Spawn()
  71.             if (!v.QE_DMKills or v.QE_DMKills == 0) then continue end
  72.  
  73.             if (highest == 0 or v.QE_DMKills > highest) then
  74.                 best = v
  75.                 highest = v.QE_DMKills
  76.             end
  77.         end
  78.  
  79.         if (IsValid(best)) then
  80.             local amt = math.random(25000,50000)
  81.             best:addMoney(amt)
  82.             DarkRP.notify(player.GetAll(), 0, 5, best:Nick() .. " has won the Deathmatch with " .. highest .. " kills! Reward: $" .. string.Comma(amt))
  83.         else
  84.             DarkRP.notify(player.GetAll(), 0, 5, "No one wins the Deathmatch!")
  85.         end
  86.     end,
  87.     oncancel = function(participants) // Custom function when the event cancels by staff
  88.     end,
  89.     teleportpositions = { // Teleport positions type "getpos" in console to get player position
  90.         Vector(2976.468506, -5945.855469, -41.880142),
  91.         Vector(3385.623291, -6179.163086, -22.481255),
  92.         Vector(3613.636230, -6020.683594, -134.968750),
  93.         Vector(3922.730225, -5961.432617, -41.880150),
  94.         Vector(3869.025146, -6273.938965, -134.968750),
  95.         Vector(3749.051270, -6563.485352, -134.968750),
  96.         Vector(3933.369629, -6751.860352, -134.968750),
  97.         Vector(3804.500000, -6988.078613, -134.968750),
  98.         Vector(3968.981934, -7271.991211, -41.883163),
  99.         Vector(3576.687988, -7129.098145, -22.5116588),
  100.         Vector(3384.483398, -7274.186523, -134.968750),
  101.         Vector(2987.271240, -7291.209961, -41.880142),
  102.         Vector(3008.608398, -6951.621094, -134.968750),
  103.         Vector(3037.470459, -6585.736328, -134.968750),
  104.         Vector(3107.503906, -6290.811523, -134.968750),
  105.         Vector(2983.352051, -5937.495117, -41.880150),
  106.     }
  107. }
  108. QE.modes["parkour"] = {
  109.     enabled = true,
  110.     name = "Parkour",
  111.     desc = "First person to beat the parkour wins!",
  112.     loadouts = {"none"}, // CANNOT BE BLANK, set to "none" if you don't want weapons
  113.     maxtime = 90,
  114.     waittime = 30,
  115.     minplayers = 2,
  116.     maxplayers = 15,
  117.     onparticipate = function(ply)
  118.         ply:StripWeapons()
  119.     end,
  120.     onkill = function(vic, ply)
  121.     end,
  122.     onplyspawn = function(ply)
  123.     end,
  124.     onstart = function(participants)
  125.         PARKOUR_ENDING = ents.Create("event_parkour")
  126.         PARKOUR_ENDING:SetPos(Vector(-254.443146, -1339.720703, -79.968750))
  127.         PARKOUR_ENDING:Spawn()
  128.         for k,v in pairs(participants) do
  129.             if IsValid(v) then
  130.                 v:SendLua([[surface.PlaySound( "buttons/button9.wav" )]])
  131.             end
  132.         end
  133.     end,
  134.     onend = function(participants)
  135.         for k,v in pairs(participants) do
  136.             if IsValid(v) then
  137.                 v.InEvent = false
  138.                 v:Spawn()
  139.             end
  140.         end
  141.         local winner = PARKOUR_WINNER
  142.         if (IsValid(winner)) then
  143.             local amt = math.random(25000,50000)
  144.             winner:addMoney(amt)
  145.             DarkRP.notify(player.GetAll(), 0, 5, winner:Nick() .. " has finished the Parkour! Reward: $" .. string.Comma(amt))
  146.         else
  147.             DarkRP.notify(player.GetAll(), 0, 5, "No one has finished the Parkour!")
  148.         end
  149.         SafeRemoveEntity(PARKOUR_ENDING)
  150.     end,
  151.     oncancel = function(participants)
  152.         SafeRemoveEntity(PARKOUR_ENDING)
  153.     end,
  154.     teleportpositions = {
  155.         Vector(2934.373047, -5394.358398, -134.966232),
  156.         Vector(2931.143311, -5313.195801, -134.966232),
  157.     }
  158. }
  159. ----------------------------------------------------------------------------------------------------------------
  160. QE.loadouts["rifle"] = {
  161.     enabled = true, // Enables/Disables the loadout
  162.     name = "Rifle only", // Pretty name
  163.     weaps = {"m9k_acr", "m9k_ak47", "m9k_ak74", "m9k_amd65", "m9k_val", "m9k_g36", "m9k_scar", "m9k_famas", "m9k_m4a1"}, // Weapon classes (chosen randomly)
  164.     onloadout = function(ply) // Custom function for setting ammo, etc.
  165.     end
  166. }
  167. QE.loadouts["sniper"] = {
  168.     enabled = true,
  169.     name = "Sniper only",
  170.     weaps = {"m9k_dragunov", "m9k_svu", "m9k_sl8", "m9k_svt40", "m9k_psg1"},
  171.     onloadout = function(ply)
  172.     end
  173. }
  174. QE.loadouts["knife"] = {
  175.     enabled = true,
  176.     name = "Knife only",
  177.     weaps = {"csgo_bayonet_tiger", "csgo_butterfly_crimsonwebs", "csgo_butterfly_damascus", "csgo_butterfly_tiger", "csgo_huntsman_damascus", "csgo_karambit_crimsonwebs", "csgo_karambit_fade", "csgo_karambit_tiger", "csgo_m9_crimsonwebs"},
  178.     onloadout = function(ply)
  179.     end
  180. }
  181. QE.loadouts["shotgun"] = {
  182.     enabled = true,
  183.     name = "Shotgun only",
  184.     weaps = {"m9k_m3", "m9k_browningauto5", "m9k_ithacam37", "m9k_mossberg590", "m9k_jackhammer", "m9k_remington870", "m9k_spas12", "m9k_striker12", "m9k_usas"},
  185.     onloadout = function(ply)
  186.     end
  187. }
  188. QE.loadouts["machine"] = {
  189.     enabled = true,
  190.     name = "Machine gun only",
  191.     weaps = {"m9k_ares_shrike", "m9k_fg42", "m9k_minigun", "m9k_m1918bar", "m9k_m249lmg", "m9k_m60", "m9k_pkm"},
  192.     onloadout = function(ply)
  193.     end
  194. }
  195. QE.loadouts["rocket"] = {
  196.     enabled = true,
  197.     name = "Rocket launcher only",
  198.     weaps = {"m9k_m202", "m9k_ex41", "m9k_milkormgl"},
  199.     onloadout = function(ply)
  200.     end
  201. }
  202. ----------------------------------------------------------------------------------------------------------------
  203.  
  204.  
  205.  
  206.  
  207.  
  208. // DONT EDIT BELOW TEXT
  209. QE.loadouts["none"] = {
  210.     enabled = true,
  211.     name = "No Weapons",
  212.     weaps = {},
  213.     onloadout = function(ply)
  214.     end
  215. }
  216.  
  217. QE.currentevent = {
  218.     mode = "",
  219.     loadout = "",
  220.     starttime = 0,
  221.     endtime = 0,
  222.     waittime = 0,
  223.     participants = {}
  224. }
  225.  
  226. function QE:IsPrep()
  227.     return (QE.currentevent.starttime + QE.currentevent.waittime > CurTime()) or false
  228. end
  229. function QE:TimeLeft()
  230.     return (math.Round(math.Clamp((QE.currentevent.endtime - CurTime())+QE.currentevent.waittime,0,math.huge))) or 0
  231. end
  232. function QE:IsEventActive()
  233.     return (QE:TimeLeft() > 0) or false
  234. end
  235.  
  236. function QE:CurrentParticipants()
  237.     return (QE.currentevent.participants) or {}
  238. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement