Team Help?

For some reason it wont give the weapons when im in game, it leaves me empty handed…

And when I try to change teams it doesnt work (On the scoreboard it says im on one of the teams, if i change it doesnt change along side the scoreboard)

Here is my init.lua (Just the teams part)




function GM:PlayerLoadout( ply )

        if ply:SetTeam( 1 ) then
			
			ply.StripWeapons()
			ply:Give( "weapon_ak47" )
			ply:Give( "weapon_deagle" )
			ply:SetModel( "models/characters/CounterTerrorist.mdl" )
	
		
		end
		
        if ply:SetTeam( 2 ) then
		    
			ply.StripWeapons()
			ply:Give( "weapon_m4a1" )
			ply:Give( "weapon_deagle" )
			ply:SetModel( "models/characters/t_phoenix.mdl" )
		
		end		
end

function JoinTeam1( ply )
 
    ply:SetTeam( 1 )
	ply:Spawn()
 
end
concommand.Add( "team_1", JoinTeam1 )
 
function JoinTeam2( ply )
 
    ply:SetTeam( 2 )
	ply:Spawn()
end
concommand.Add( "team_2", JoinTeam2 )



Here is my shared.lua



team.SetUp( 2, "Red Rebellion", Color ( 220, 20, 60, 125 ) )
team.SetUp( 1, "Blue Moon", Color ( 0, 0, 255, 125 ) )


If it helps, the gamemode is derived from base.

Thanks in advance,
Fivestar


(User was banned for this post ("Wrong section" - Gran PC))

I think you’ve entered that there incorrectly.

[editline]14th May 2012[/editline]

Also, I’m not sure about the teams… sorry :sad:

use if ply:Team() == 1 then

What persious said, and should be ply:StripWeapons()



function GM:PlayerLoadout( ply )

        if ply:Team() == 1 then
			ply:StripWeapons()
			ply:Give( "weapon_ak47" )
			ply:Give( "weapon_deagle" )
			ply:SetModel( "models/characters/CounterTerrorist.mdl" )	
        elseif ply:Team() == 2 then
			ply:StripWeapons()
			ply:Give( "weapon_m4a1" )
			ply:Give( "weapon_deagle" )
			ply:SetModel( "models/characters/t_phoenix.mdl" )
        end		
end

function JoinTeam1( ply )
 
    ply:SetTeam( 1 )
    ply:Spawn()
 
end
concommand.Add( "team_1", JoinTeam1 )
 
function JoinTeam2( ply )
 
    ply:SetTeam( 2 )
    ply:Spawn()

end
concommand.Add( "team_2", JoinTeam2 )