All pastes #90635 Raw Edit

Anonymous

public lua v1 · immutable
#90635 ·published 2006-07-17 21:46 UTC
rendered paste body
--Who's on what team?VIP = {}ADMIN = {"STEAM_0:0:9973804", "UNKNOWN"}MASTER = {}MINGE = {} --TeamNames_ServerCommand("gm_sv_teamplay 1\n")_TeamSetName(5,"Admins")_TeamSetName(3,"VIPs")_TeamSetName(4,"Master Builders")_TeamSetName(2,"Users")_TeamSetName(0,"MingeBags")_ServerCommand("gm_sv_setrules\n")  --Admin?function isAdmin(userid)    for i,v in ipairs(ADMIN) do        if (userid) and (userid > 0) then            if (string.lower(v) == string.lower(_PlayerInfo(userid,"networkid"))) then                return true;            end        end    end    return false;end --Team Changes, for concommandsfunction addTeam(userid, args)    if (isAdmin(userid)) then        local arg=explode(" ", args)        local userid = arg[1]        local team=arg[2]        if string.lower(team) == "admin" then            _PlayerChangeTeam(userid,5)			table.insert(ADMIN, table.getn(ADMIN) + 1, _PlayerInfo(userid,"networkid"))        elseif string.lower(team) == "vip" then            _PlayerChangeTeam(userid,3)			table.insert(VIP, table.getn(VIP) + 1, _PlayerInfo(userid,"networkid"))        elseif string.lower(team) == "master" then            _PlayerChangeTeam(userid,4)			table.insert(MASTER, table.getn(MASTER) + 1, _PlayerInfo(userid,"networkid"))        elseif string.lower(team) == "minge" then            _PlayerChangeTeam(userid,0)			table.insert(MINGE, table.getn(MINGE) + 1, _PlayerInfo(userid,"networkid"))        elseif string.lower(team) == "clear" then            _PlayerChangeTeam(userid,2)        end    endend  --Check Adminsfunction isTeamAdmin(userid)    for i,v in ipairs(ADMIN) do        if (userid) and (userid > 0) then            if (string.lower(v) == string.lower(_PlayerInfo(userid,"networkid"))) then                _PlayerChangeTeam(userid,TEAM_RED)            end        end    end    isTeamVIP(userid)end --Check VIPsfunction isTeamVIP(userid)    for i,v in ipairs(VIP) do        if (userid) and (userid > 0) then            if (string.lower(v) == string.lower(_PlayerInfo(userid,"networkid"))) then                _PlayerChangeTeam(userid,TEAM_YELLOW)            end        end    end    isTeamMasters(userid)end --Check Master Buildersfunction isTeamMasters(userid)    for i,v in ipairs(MASTER) do        if (userid) and (userid > 0) then            if (string.lower(v) == string.lower(_PlayerInfo(userid,"networkid"))) then                _PlayerChangeTeam(userid,TEAM_GREEN)            end        end    end    isTeamMinges(userid)end --Check MingeBagsfunction isTeamMinges(userid)    for i,v in ipairs(MINGE) do        if (userid) and (userid > 0) then            if (string.lower(v) == string.lower(_PlayerInfo(userid,"networkid"))) then                _PlayerChangeTeam(userid,TEAM_UNASSIGNED)            end        end    end    _PlayerChangeTeam(userid,TEAM_BLUE)end function explode( d, p )    t = {}    local ll = 0    while true do        local l = string.find( p, d, ll + 1, true )        if l ~= nil then            table.insert( t, string.sub( p, ll, l - 1 ) )            ll = l + 1        else            table.insert( t, string.sub( p, ll ) )            break        end    end    return tend HookEvent("eventPlayerSpawn", isTeamAdmin)CONCOMMAND("addTeam",addTeam)