Well, it's not a module but a modification of uteam, it's working, but Megiddo i can't use the PlayerLoadout as i want :/
Anyway, into uteam.lua, replace the UTeam.setTeam function by this one:
function UTeam.setTeam( ply )
if not UTeam.checkGamemode() then return end
for k,v in ipairs( UTeam.teams ) do
if ply:IsUserGroup( v.group ) then
ply:SetTeam( UTeam.BASETEAMINDEX + k )
if v.hp then ply:SetHealth( v.hp ) end
if v.armor then ply:SetArmor( v.armor ) end
if v.model then timer.Simple( 0.1, ply.SetModel, ply, player_manager.TranslatePlayerModel( v.model ) )end
if v.weapons then
timer.Simple( 0.1, function(ply, v)
ply:StripWeapons()
for _,v in pairs(v.weapons) do
ply:Give( v )
end
ply:SelectWeapon(v.weapons[1])
end, ply, v)
end
if v.plytable then
timer.Simple( 0.1, function(ply, v)
for _,v in pairs(v.plytable) do
k = string.sub( v, 1, string.find( v, ":" ) - 1 )
v = string.sub( v, string.find( v, ":" ) + 1 )
ply:GetTable()[k] = tonumber(v) or v
end
end, ply, v)
end
break
end
end
end
hook.Add( "PlayerSpawn", "UTeamSetTeam", UTeam.setTeam )
Now you can add this in your UTeam.txt, for example:
"5"
{
"name" "[Client]"
"group" "user"
"model" "kleiner"
"color"
{
"r" "100"
"g" "100"
"b" "200"
"a" "255"
}
"weapons"
{
"1" "weapon_physgun"
"2" "gmod_tool"
"3" "gmod_camera"
}
}
The first weapon is the one the player will spawn with. In this example, the player will spawn with the physgun as selected weapon. Hope that helps (i love coding)
JamminR, why "tested and working" in bold
I test what i script :p