Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QE = QE or {}
- QE.modes = {}
- QE.loadouts = {}
- // DO NOT EDIT ABOVE TEXT
- ----------------------------------------------------------------------------------------------------------------
- QE.Font = "Roboto"
- QE.HeaderTextColor = Color(0, 0, 0)
- QE.HeaderBGColor = Color(255, 255, 255)
- QE.MainTextColor = Color(255,255,255)
- QE.MainBGColor = Color(0, 0, 0)
- QE.JoinBGColor = Color(0, 200, 0, 255)
- QE.JoinTextColor = Color(200, 200, 200)
- QE.IgnoreBGColor = Color(200, 0, 0, 255)
- QE.IgnoreTextColor = Color(200, 200, 200)
- ----------------------------------------------------------------------------------------------------------------
- QE.AutoEvent = {
- enabled = true,
- events = {"deathmatch","parkour"}, // will randomly choose the events
- minplayers = 20, // minimum amount of players on server
- time = 1220 // time in seconds
- }
- QE.StaffGroups = {"superadmin","manager"} // To create/stop events
- ----------------------------------------------------------------------------------------------------------------
- QE.modes["deathmatch"] = {
- enabled = true, // Enables/Disables the event
- name = "Deathmatch", // Pretty name
- desc = "Eliminate as many players as possible!", // Description
- loadouts = {"rifle","sniper","knife","shotgun","machine","rocket"}, // Add/remove loadouts (make them using QE.loadouts) set to {"none"} to have no weapons
- maxtime = 90, // Max event time
- waittime = 30, // Waits for players to join
- minplayers = 2, // Minimum amount of players to start event
- maxplayers = 15, // Maximum amount of players that can join
- onparticipate = function(ply) // Custom function when the event starts
- ply.QE_DMKills = 0
- ply:SetHealth(100)
- ply:SetArmor(0)
- ply:StripWeapons()
- v:SendLua([[surface.PlaySound( "buttons/button9.wav" )]])
- end,
- onkill = function(vic, ply) // Custom function when a player kills someone
- if IsValid(vic) and IsValid(ply) then
- if !(vic == ply) then // Do not allow suicide
- ply.QE_DMKills = ply.QE_DMKills + 1
- end
- end
- QE.modes["deathmatch"].onplyspawn(vic)
- end,
- onplyspawn = function(ply) // Custom function when a player spawns everytime
- ply:SetPos(table.Random(QE.modes["deathmatch"].teleportpositions)) // Respawn them
- ply:SetHealth(100)
- ply:SetArmor(0)
- ply:StripWeapons() // Strip weapons
- ply:Give(table.Random(QE.loadouts[QE.currentevent.loadout or "none"].weaps) or "") // Give one random weapon
- QE.loadouts[QE.currentevent.loadout].onloadout(ply) // custom function
- end,
- onstart = function(participants) // Custom function when the event starts
- end,
- onend = function(participants) // Custom function when the event ends
- local best, highest = NULL, 0
- for _, v in pairs (participants) do
- if !IsValid(v) then continue end
- v:StripWeapons()
- v:Spawn()
- if (!v.QE_DMKills or v.QE_DMKills == 0) then continue end
- if (highest == 0 or v.QE_DMKills > highest) then
- best = v
- highest = v.QE_DMKills
- end
- end
- if (IsValid(best)) then
- local amt = math.random(25000,50000)
- best:addMoney(amt)
- DarkRP.notify(player.GetAll(), 0, 5, best:Nick() .. " has won the Deathmatch with " .. highest .. " kills! Reward: $" .. string.Comma(amt))
- else
- DarkRP.notify(player.GetAll(), 0, 5, "No one wins the Deathmatch!")
- end
- end,
- oncancel = function(participants) // Custom function when the event cancels by staff
- end,
- teleportpositions = { // Teleport positions type "getpos" in console to get player position
- Vector(2976.468506, -5945.855469, -41.880142),
- Vector(3385.623291, -6179.163086, -22.481255),
- Vector(3613.636230, -6020.683594, -134.968750),
- Vector(3922.730225, -5961.432617, -41.880150),
- Vector(3869.025146, -6273.938965, -134.968750),
- Vector(3749.051270, -6563.485352, -134.968750),
- Vector(3933.369629, -6751.860352, -134.968750),
- Vector(3804.500000, -6988.078613, -134.968750),
- Vector(3968.981934, -7271.991211, -41.883163),
- Vector(3576.687988, -7129.098145, -22.5116588),
- Vector(3384.483398, -7274.186523, -134.968750),
- Vector(2987.271240, -7291.209961, -41.880142),
- Vector(3008.608398, -6951.621094, -134.968750),
- Vector(3037.470459, -6585.736328, -134.968750),
- Vector(3107.503906, -6290.811523, -134.968750),
- Vector(2983.352051, -5937.495117, -41.880150),
- }
- }
- QE.modes["parkour"] = {
- enabled = true,
- name = "Parkour",
- desc = "First person to beat the parkour wins!",
- loadouts = {"none"}, // CANNOT BE BLANK, set to "none" if you don't want weapons
- maxtime = 90,
- waittime = 30,
- minplayers = 2,
- maxplayers = 15,
- onparticipate = function(ply)
- ply:StripWeapons()
- end,
- onkill = function(vic, ply)
- end,
- onplyspawn = function(ply)
- end,
- onstart = function(participants)
- PARKOUR_ENDING = ents.Create("event_parkour")
- PARKOUR_ENDING:SetPos(Vector(-254.443146, -1339.720703, -79.968750))
- PARKOUR_ENDING:Spawn()
- for k,v in pairs(participants) do
- if IsValid(v) then
- v:SendLua([[surface.PlaySound( "buttons/button9.wav" )]])
- end
- end
- end,
- onend = function(participants)
- for k,v in pairs(participants) do
- if IsValid(v) then
- v.InEvent = false
- v:Spawn()
- end
- end
- local winner = PARKOUR_WINNER
- if (IsValid(winner)) then
- local amt = math.random(25000,50000)
- winner:addMoney(amt)
- DarkRP.notify(player.GetAll(), 0, 5, winner:Nick() .. " has finished the Parkour! Reward: $" .. string.Comma(amt))
- else
- DarkRP.notify(player.GetAll(), 0, 5, "No one has finished the Parkour!")
- end
- SafeRemoveEntity(PARKOUR_ENDING)
- end,
- oncancel = function(participants)
- SafeRemoveEntity(PARKOUR_ENDING)
- end,
- teleportpositions = {
- Vector(2934.373047, -5394.358398, -134.966232),
- Vector(2931.143311, -5313.195801, -134.966232),
- }
- }
- ----------------------------------------------------------------------------------------------------------------
- QE.loadouts["rifle"] = {
- enabled = true, // Enables/Disables the loadout
- name = "Rifle only", // Pretty name
- weaps = {"m9k_acr", "m9k_ak47", "m9k_ak74", "m9k_amd65", "m9k_val", "m9k_g36", "m9k_scar", "m9k_famas", "m9k_m4a1"}, // Weapon classes (chosen randomly)
- onloadout = function(ply) // Custom function for setting ammo, etc.
- end
- }
- QE.loadouts["sniper"] = {
- enabled = true,
- name = "Sniper only",
- weaps = {"m9k_dragunov", "m9k_svu", "m9k_sl8", "m9k_svt40", "m9k_psg1"},
- onloadout = function(ply)
- end
- }
- QE.loadouts["knife"] = {
- enabled = true,
- name = "Knife only",
- 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"},
- onloadout = function(ply)
- end
- }
- QE.loadouts["shotgun"] = {
- enabled = true,
- name = "Shotgun only",
- weaps = {"m9k_m3", "m9k_browningauto5", "m9k_ithacam37", "m9k_mossberg590", "m9k_jackhammer", "m9k_remington870", "m9k_spas12", "m9k_striker12", "m9k_usas"},
- onloadout = function(ply)
- end
- }
- QE.loadouts["machine"] = {
- enabled = true,
- name = "Machine gun only",
- weaps = {"m9k_ares_shrike", "m9k_fg42", "m9k_minigun", "m9k_m1918bar", "m9k_m249lmg", "m9k_m60", "m9k_pkm"},
- onloadout = function(ply)
- end
- }
- QE.loadouts["rocket"] = {
- enabled = true,
- name = "Rocket launcher only",
- weaps = {"m9k_m202", "m9k_ex41", "m9k_milkormgl"},
- onloadout = function(ply)
- end
- }
- ----------------------------------------------------------------------------------------------------------------
- // DONT EDIT BELOW TEXT
- QE.loadouts["none"] = {
- enabled = true,
- name = "No Weapons",
- weaps = {},
- onloadout = function(ply)
- end
- }
- QE.currentevent = {
- mode = "",
- loadout = "",
- starttime = 0,
- endtime = 0,
- waittime = 0,
- participants = {}
- }
- function QE:IsPrep()
- return (QE.currentevent.starttime + QE.currentevent.waittime > CurTime()) or false
- end
- function QE:TimeLeft()
- return (math.Round(math.Clamp((QE.currentevent.endtime - CurTime())+QE.currentevent.waittime,0,math.huge))) or 0
- end
- function QE:IsEventActive()
- return (QE:TimeLeft() > 0) or false
- end
- function QE:CurrentParticipants()
- return (QE.currentevent.participants) or {}
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement