Author Topic: Use this in Flood lol  (Read 155 times)

0 Members and 1 Guest are viewing this topic.

Offline Krasher

  • -=RND Help Center=-
  • WaffleBBQrz
  • ******
  • Posts: 2764
  • Karma: +75/-47
  • Gender: Male
  • PM me if you have questions.
    • View Profile
    • Forum Page
Use this in Flood lol
« on: February 07, 2010, 06:51:36 PM »
Here this is a script made for Fort Wars: Source That i have leaked for joo gaiz.
Modify it fur flood!
(put it in the init.lua :P)
Code: [Select]
ballcarrier = 0
EntTeam = {}
TEAMCOLOR = {}
TEAMCOLOR[1] = "50 150 255"
TEAMCOLOR[2] = "255 200 0"
TEAMCOLOR[3] = "50 255 150"
TEAMCOLOR[4] = "255 100 100"

function GAMEMODE:ShowHelp(ply)
umsg.Start( "showhelp", ply)
umsg.End()
end

function GAMEMODE:ShowTeam(ply)
umsg.Start( "showteam", ply)
umsg.End()
end

function GAMEMODE:ShowSpare1(ply)
if !ply:IsAdmin() and !ply:IsSuperAdmin() then return end
umsg.Start( "showadminpanel",ply)
umsg.End()
end

function GAMEMODE:ShowSpare2(ply)
if DM_MODE == false then ply:PrintMessage(4,"You can only use that menu during deathmatch!") return end
umsg.Start("buymenu",ply)
umsg.End()
end

function PickTeam(ply, command, args)
if !args[1] or !ply.changeteams then return false end
if EVEN_TEAMS then
if NUM_TEAMS == 4 then
if tonumber(args[1]) == 1 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 2 then
if team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_YELLOW)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 3 then
if team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_GREEN)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 4 then
if team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_RED)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
end
elseif NUM_TEAMS == 3 then
if tonumber(args[1]) == 1 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 2 then
if team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_YELLOW)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 3 then
if team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_GREEN)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
end
elseif NUM_TEAMS == 2 then
if tonumber(args[1]) == 1 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
elseif tonumber(args[1]) == 2 then
if team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_YELLOW)
ply.spawn = nil
ply:Kill()
ply.changeteams = false
else
ply:PrintMessage(4, "Teams would be too uneven if you switched.")
end
end
end
else
ply:SetTeam(tonumber(args[1]))
end
for i,v in ipairs(TEAMCOLOR) do
if ply:Team() == i then
ply:Fire("color",v,0)
ply.changeteams = false
end
end
end
concommand.Add("changeteam",PickTeam)

function RefillTeams() --admin changed number of teams
for index,ply in pairs(player.GetAll()) do
ply:SetTeam(0)
ply.spawn = nil
if ply:Alive() then
ply:Kill()
end
if NUM_TEAMS == 4 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_YELLOW)
elseif team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_GREEN)
elseif team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_RED)
end
elseif NUM_TEAMS == 3 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) then
ply:SetTeam(TEAM_YELLOW)
elseif team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_GREEN)
end
elseif NUM_TEAMS == 2 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_YELLOW)
end
end
for i,v in ipairs(TEAMCOLOR) do
if ply:Team() == i then
ply:Fire("color",v,0)
end
end
end
end


function SendMoney(ply)
umsg.Start("getmoney",ply)
umsg.Long(ply.money)
umsg.End()
end

function GAMEMODE:PlayerInitialSpawn(ply)
if CHOOSETEAM == false then --this looks very crappy to me but i am lazy so i am gonna leave it
if NUM_TEAMS == 4 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_YELLOW)
elseif team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_GREEN)
elseif team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_GREEN) and
team.NumPlayers(TEAM_RED) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_RED)
end
elseif NUM_TEAMS == 3 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_GREEN) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) and
team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_GREEN) then
ply:SetTeam(TEAM_YELLOW)
elseif team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_YELLOW) and
team.NumPlayers(TEAM_GREEN) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_GREEN)
end
elseif NUM_TEAMS == 2 then
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_YELLOW) then
ply:SetTeam(TEAM_BLUE)
elseif team.NumPlayers(TEAM_YELLOW) <= team.NumPlayers(TEAM_BLUE) then
ply:SetTeam(TEAM_YELLOW)
end
end

for i,v in ipairs(TEAMCOLOR) do
if ply:Team() == i then
ply:Fire("color",v,0)
end
end
else
ply:Spectate()
umsg.Start( "joinmenu", ply)
umsg.End()
end

if DM_MODE then
umsg.Start("changetodm", ply)
umsg.End()
else
umsg.Start("changetobuild", ply)
umsg.End()
end
ply.money = STARTING_MONEY
ply.changeteams = true
SendMoney(ply)
end
-Admin Application-

Follow the rules or I will you.