Ok I want to remove all recent guns, gunlabs. This includes pistols, AK-47, M16, etc. You know all the basic guns that doesn't work well.
It must be somewhere in this script, but I am way to new with scripting.
I am not sure if it is in that file or directory, put this is the file main.lua...
[code]/*---------------------------------------------------------
Variables
---------------------------------------------------------*/
local timeLeft = 10
local timeLeft2 = 10
local stormOn = false
local zombieOn = false
local maxZombie = 10
RPArrestedPlayersPositions = {}
VoteCopOn = false
/*---------------------------------------------------------
Zombie
---------------------------------------------------------*/
function ControlZombie()
timeLeft2 = timeLeft2 - 1
if timeLeft2 < 1 then
if zombieOn then
timeLeft2 = math.random(300,500)
zombieOn = false
timer.Stop("start2")
ZombieEnd()
else
timeLeft2 = math.random(150,300)
zombieOn = true
timer.Start("start2")
DB.RetrieveZombies()
ZombieStart()
end
end
end
function ZombieStart()
for k, v in pairs(player.GetAll()) do
if v:Alive() then
v:PrintMessage(HUD_PRINTCENTER, "WARNING: Zombies are approaching!")
v:PrintMessage(HUD_PRINTTALK, "WARNING: Zombies are approaching!")
end
end
end
function ZombieEnd()
for k, v in pairs(player.GetAll()) do
if v:Alive() then
v:PrintMessage(HUD_PRINTCENTER, "Zombies are leaving.")
v:PrintMessage(HUD_PRINTTALK, "Zombies are leaving.")
end
end
end
function PlayerDist(npcPos)
local playDis
local currPlayer
for k, v in pairs(player.GetAll()) do
local tempPlayDis = v:GetPos():Distance(npcPos:GetPos())
if playDis == nil then
playDis = tempPlayDis
currPlayer = v
end
if tempPlayDis < playDis then
playDis = tempPlayDis
currPlayer = v
end
end
return currPlayer
end
function LoadTable(ply)
ply:SetNWInt("numPoints", table.getn(zombieSpawns))
for k, v in pairs(zombieSpawns) do
local Sep = (string.Explode(" " ,v))
ply:SetNWVector("zPoints" .. k, Vector(tonumber(Sep[1]),tonumber(Sep[2]),tonumber(Sep[3])))
end
end
function ReMoveZombie(ply, index)
if ply:HasPriv(ADMIN) then
if not index or zombieSpawns[tonumber(index)] == nil then
Notify(ply, 1, 4, "Zombie Spawn " .. tostring(index) .. " does not exist.")
else
DB.RetrieveZombies()
Notify(ply, 1, 4, "You have removed this zombie spawn.")
table.remove(zombieSpawns,index)
DB.StoreZombies()
if ply:GetNWBool("zombieToggle") then
LoadTable(ply)
end
end
else
Notify(ply, 1, 4, "You need admin privileges in order to be able to remove zombie positions.")
end
return ""
end
AddChatCommand("/removezombie", ReMoveZombie)
function AddZombie(ply)
if ply:HasPriv(ADMIN) then
DB.RetrieveZombies()
table.insert(zombieSpawns, tostring(ply:GetPos()))
DB.StoreZombies()
if ply:GetNWBool("zombieToggle") then LoadTable(ply) end
Notify(ply, 1, 4, "You have added a zombie spawn.")
else
Notify(ply, 1, 6, "You need admin privileges in order to be able to add a zombie spawn.")
end
return ""
end
AddChatCommand("/addzombie", AddZombie)
function ToggleZombie(ply)
if ply:HasPriv(ADMIN) then
if not ply:GetNWBool("zombieToggle") then
DB.RetrieveZombies()
ply:SetNWBool("zombieToggle", true)
LoadTable(ply)
Notify(ply, 1, 4, "You will now be able to see zombie spawns.")
else
ply:SetNWBool("zombieToggle", false)
Notify(ply, 1, 4, "You will now be unable to see zombie spawns")
end
else
Notify(ply, 1, 6, "You need admin privileges in order to be able to see the zombie spawns.")
end
return ""
end
AddChatCommand("/showzombie", ToggleZombie)
function SpawnZombie()
timer.Start("move")
if GetAliveZombie() < maxZombie then
if table.getn(zombieSpawns) > 0 then
local zombieType = math.random(1, 4)
if zombieType == 1 then
local zombie1 = ents.Create("npc_zombie")
zombie1:SetPos(DB.RetrieveRandomZombieSpawnPos())
zombie1.nodupe = true
zombie1:Spawn()
zombie1:Activate()
elseif zombieType == 2 then
local zombie2 = ents.Create("npc_fastzombie")
zombie2:SetPos(DB.RetrieveRandomZombieSpawnPos())
zombie2.nodupe = true
zombie2:Spawn()
zombie2:Activate()
elseif zombieType == 3 then
local zombie3 = ents.Create("npc_antlion")
zombie3:SetPos(DB.RetrieveRandomZombieSpawnPos())
zombie3.nodupe = true
zombie3:Spawn()
zombie3:Activate()
elseif zombieType == 4 then
local zombie4 = ents.Create("npc_headcrab_fast")
zombie4:SetPos(DB.RetrieveRandomZombieSpawnPos())
zombie4.nodupe = true
zombie4:Spawn()
zombie4:Activate()
end
end
end
end
function GetAliveZombie()
local zombieCount = 0
for k, v in pairs(ents.FindByClass("npc_zombie")) do
zombieCount = zombieCount + 1
end
for k, v in pairs(ents.FindByClass("npc_fastzombie")) do
zombieCount = zombieCount + 1
end
for k, v in pairs(ents.FindByClass("npc_antlion")) do
zombieCount = zombieCount + 1
end
for k, v in pairs(ents.FindByClass("npc_headcrab_fast")) do
zombieCount = zombieCount + 1
end
return zombieCount
end
function ZombieMax(ply, args)
if ply:HasPriv(ADMIN) then
if not tonumber(args) then
Notify(ply, 1, 4, "The number entered is invalid.")
return ""
end
maxZombie = tonumber(args)
Notify(ply, 1, 4, "Max zombies is now set to "..args..".")
end
return ""
end
AddChatCommand("/zombiemax", ZombieMax)
function StartZombie(ply)
if ply:HasPriv(ADMIN) then
timer.Start("zombieControl")
Notify(ply, 1, 4, "Zombies are now enabled.")
end
return ""
end
AddChatCommand("/enablezombie", StartZombie)
function StopZombie(ply)
if ply:HasPriv(ADMIN) then
timer.Stop("zombieControl")
zombieOn = false
timer.Stop("start2")
ZombieEnd()
Notify(ply, 1, 4, "Zombies are now disabled.")
return ""
end
end
AddChatCommand("/disablezombie", StopZombie)
timer.Create("start2", 1, 0, SpawnZombie)
timer.Create("zombieControl", 1, 0, ControlZombie)
timer.Stop("start2")
timer.Stop("zombieControl")
/*---------------------------------------------------------
Meteor storm
---------------------------------------------------------*/
function StormStart()
for k, v in pairs(player.GetAll()) do
if v:Alive() then
v:PrintMessage(HUD_PRINTCENTER, "WARNING: Meteor storm approaching!")
v:PrintMessage(HUD_PRINTTALK, "WARNING: Meteor storm approaching!")
end
end
end
function StormEnd()
for k, v in pairs(player.GetAll()) do
if v:Alive() then
v:PrintMessage(HUD_PRINTCENTER, "Meteor storm passing.")
v:PrintMessage(HUD_PRINTTALK, "Meteor storm passing.")
end
end
end
function ControlStorm()
timeLeft = timeLeft - 1
if timeLeft < 1 then
if stormOn then
timeLeft = math.random(300,500)
stormOn = false
timer.Stop("start")
StormEnd()
else
timeLeft = math.random(60,90)
stormOn = true
timer.Start("start")
StormStart()
end
end
end
function StartShower()
timer.Adjust("start", math.random(.1,1), 0, StartShower)
for k, v in pairs(player.GetAll()) do
if math.random(0, 2) == 0 then
if v:Alive() then
AttackEnt(v)
end
end
end
end
function AttackEnt(ent)
meteor = ents.Create("meteor")
meteor.nodupe = true
meteor:Spawn()
meteor:SetTarget(ent)
end
function StartStorm(ply)
if ply:HasPriv(ADMIN) then
timer.Start("stormControl")
Notify(ply, 1, 4, "Meteor Storms are now enabled.")
end
return ""
end
AddChatCommand("/enablestorm", StartStorm)
function StopStorm(ply)
if ply:HasPriv(ADMIN) then
timer.Stop("stormControl")
stormOn = false
timer.Stop("start")
StormEnd()
Notify(ply, 1, 4, "Meteor Storms are now disabled.")
return ""
end
end
AddChatCommand("/disablestorm", StopStorm)
timer.Create("start", 1, 0, StartShower)
timer.Create("stormControl", 1, 0, ControlStorm)
timer.Stop("start")
timer.Stop("stormControl")
/*------------------------------------------
[QUOTE=charlfever;23143183]Ok I want to remove all recent guns, gunlabs. This includes pistols, AK-47, M16, etc. You know all the basic guns that doesn't work well.
It must be somewhere in this script, but I am way to new with scripting.
I am not sure if it is in that file or directory, put this is the file main.lua... [/QUOTE]
They're in the file addentities.lua
Sorry, you need to Log In to post a reply to this thread.