mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 21:33:02 +05:00
Compare commits
2 commits
148352596f
...
45c2c77bc3
Author | SHA1 | Date | |
---|---|---|---|
45c2c77bc3 | |||
d7d9a16250 |
6 changed files with 66 additions and 77 deletions
|
@ -124,26 +124,7 @@ end
|
|||
|
||||
function PLAYER:Loadout()
|
||||
if GetGlobalBool("GM_DATATHEFT") or GetGlobalBool("GM_DEATHMATCH") then
|
||||
if GetConVar("Beatrun_RandomMWLoadouts"):GetBool() then
|
||||
for i = 0, 1 do
|
||||
local randomSWEP = getRandomMGBaseWeapon()
|
||||
local w = self.Player:Give(randomSWEP.ClassName)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then self.Player:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then self.Player:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
else
|
||||
for _, v in ipairs(BEATRUN_GAMEMODES_LOADOUTS[math.random(#BEATRUN_GAMEMODES_LOADOUTS)]) do
|
||||
local w = self.Player:Give(v)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then self.Player:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then self.Player:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
end
|
||||
Beatrun_GiveGMWeapon(self.Player)
|
||||
else
|
||||
self.Player:RemoveAllAmmo()
|
||||
end
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
local vmatrixmeta = FindMetaTable("VMatrix")
|
||||
local playermeta = FindMetaTable("Player")
|
||||
|
||||
CreateConVar("Beatrun_RandomMWLoadouts", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
|
||||
CreateConVar("Beatrun_RandomARC9Loadouts", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
|
||||
|
||||
BEATRUN_GAMEMODES_LOADOUTS = {
|
||||
{"weapon_357", "weapon_ar2"}
|
||||
}
|
||||
|
@ -86,4 +89,61 @@ function playermeta:notUsingRH(wep)
|
|||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Beatrun_GiveAmmo(weapon, ply)
|
||||
if weapon:GetPrimaryAmmoType() ~= -1 then ply:GiveAmmo(10000, weapon:GetPrimaryAmmoType(), true) end
|
||||
if weapon:GetSecondaryAmmoType() ~= -1 then ply:GiveAmmo(5, weapon:GetSecondaryAmmoType(), true) end
|
||||
end
|
||||
|
||||
function Beatrun_getRandomMWBaseSWEP()
|
||||
local allWep = weapons.GetList()
|
||||
local wepIndex = math.random(#allWep)
|
||||
local wep = allWep[wepIndex]
|
||||
|
||||
if wep.Base == "mg_base" and not wep.AdminOnly then
|
||||
return wep
|
||||
else
|
||||
return Beatrun_getRandomMWBaseSWEP()
|
||||
end
|
||||
end
|
||||
|
||||
function Beatrun_getRandomARC9SWEP()
|
||||
local allWep = weapons.GetList()
|
||||
local wepIndex = math.random(#allWep)
|
||||
local wep = allWep[wepIndex]
|
||||
|
||||
if wep.Base == "arc9_cod2019_base" and not wep.AdminOnly then
|
||||
return wep
|
||||
else
|
||||
return Beatrun_getRandomARC9SWEP()
|
||||
end
|
||||
end
|
||||
|
||||
function Beatrun_GiveGMWeapon(ply)
|
||||
if GetConVar("Beatrun_RandomMWLoadouts"):GetBool() and not GetConVar("Beatrun_RandomARC9Loadouts"):GetBool() then
|
||||
for i = 0, 1 do
|
||||
local swep = Beatrun_getRandomMWBaseSWEP()
|
||||
local w = ply:Give(swep.ClassName)
|
||||
|
||||
timer.Simple(1, function()
|
||||
Beatrun_GiveAmmo(w, ply)
|
||||
end)
|
||||
end
|
||||
elseif GetConVar("Beatrun_RandomARC9Loadouts"):GetBool() and not GetConVar("Beatrun_RandomMWLoadouts"):GetBool() then
|
||||
for i = 0, 1 do
|
||||
-- We don't need ammo because ARC9 got the infinite ammo option!
|
||||
|
||||
local swep = Beatrun_getRandomARC9SWEP()
|
||||
ply:Give(swep.ClassName)
|
||||
end
|
||||
elseif not GetConVar("Beatrun_RandomARC9Loadouts"):GetBool() and not GetConVar("Beatrun_RandomMWLoadouts"):GetBool() then
|
||||
for _, b in ipairs(BEATRUN_GAMEMODES_LOADOUTS[math.random(#BEATRUN_GAMEMODES_LOADOUTS)]) do
|
||||
local w = v:Give(b)
|
||||
|
||||
timer.Simple(1, function()
|
||||
Beatrun_GiveAmmo(w, ply)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -22,26 +22,7 @@ if SERVER then
|
|||
v:Spawn()
|
||||
end
|
||||
|
||||
if GetConVar("Beatrun_RandomMWLoadouts"):GetBool() then
|
||||
for i = 0, 1 do
|
||||
local randomSWEP = getRandomMGBaseWeapon()
|
||||
local w = v:Give(randomSWEP.ClassName)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then v:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then v:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
else
|
||||
for _, b in ipairs(BEATRUN_GAMEMODES_LOADOUTS[math.random(#BEATRUN_GAMEMODES_LOADOUTS)]) do
|
||||
local w = v:Give(b)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then v:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then v:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
end
|
||||
Beatrun_GiveGMWeapon(v)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,20 +2,6 @@ if SERVER then
|
|||
util.AddNetworkString("Deathmatch_Start")
|
||||
util.AddNetworkString("Deathmatch_Sync")
|
||||
|
||||
CreateConVar("Beatrun_RandomMWLoadouts", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
|
||||
|
||||
function getRandomMGBaseWeapon()
|
||||
local allWep = weapons.GetList()
|
||||
local wepIndex = math.random(#allWep)
|
||||
local wep = allWep[wepIndex]
|
||||
|
||||
if wep.Base == "mg_base" and not wep.AdminOnly then
|
||||
return wep
|
||||
else
|
||||
return getRandomMGBaseWeapon()
|
||||
end
|
||||
end
|
||||
|
||||
function Beatrun_StartDeathmatch()
|
||||
if GetGlobalBool("GM_DEATHMATCH") then return end
|
||||
if Course_Name ~= "" then return end
|
||||
|
@ -31,26 +17,7 @@ if SERVER then
|
|||
v:Spawn()
|
||||
end
|
||||
|
||||
if GetConVar("Beatrun_RandomMWLoadouts"):GetBool() then
|
||||
for i = 0, 1 do
|
||||
local randomSWEP = getRandomMGBaseWeapon()
|
||||
local w = v:Give(randomSWEP.ClassName)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then v:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then v:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
else
|
||||
for _, b in ipairs(BEATRUN_GAMEMODES_LOADOUTS[math.random(#BEATRUN_GAMEMODES_LOADOUTS)]) do
|
||||
local w = v:Give(b)
|
||||
|
||||
timer.Simple(1, function()
|
||||
if w:GetPrimaryAmmoType() ~= -1 then v:GiveAmmo(10000, w:GetPrimaryAmmoType(), true) end
|
||||
if w:GetSecondaryAmmoType() ~= -1 then v:GiveAmmo(5, w:GetSecondaryAmmoType(), true) end
|
||||
end)
|
||||
end
|
||||
end
|
||||
Beatrun_GiveGMWeapon(v)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
VERSION_GLOBAL = "1.0.18"
|
||||
VERSION_GLOBAL = "1.0.20"
|
||||
VERSION_LATEST = ""
|
||||
VERSION_CHECKED = false
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
1.0.18
|
||||
1.0.20
|
Loading…
Reference in a new issue