ok thank you and the main problem of my gamemode for garrysmod is that for some reason the teams arnt loading and i know not everyone that understands normal lua will be able to help me with this but here it goes and i have a couple of problems heres the 1st
1st problem which probly causes the 2nd
the teams wont work when you look at team menu it show everyone on team Unassigned and since Friendly fire is off because this is a team deathmatch game mode noone can kill
CODE
function GM:PlayerInitialSpawn(ply)
if team.NumPlayers(TEAM_BLUE) <= team.NumPlayers(TEAM_RED) then
ply:SetTeam(TEAM_BLUE)
else
ply:SetTeam(TEAM_RED)
end
self.BaseClass:PlayerInitialSpawn(ply)
end
function GM:PlayerLoadout(ply)
return
end
2nd problem
For some reason it does not want to print the part about changing teams on game join and the f4 doesnt work which f4=showspare2
CODE
function GM:KeyPress(p, key)
if ( key == ShowSpare2 ) then
if ( p:Team( )== TEAM_BLUE ) then
p:SetTeam( TEAM_RED )
p:Kill( )
p:PrintMessage(HUD_PRINTTALK,"you don't want to be in the Red team? Press 'F4' to be one again!"); -- eg: Aliens (blue)
p:SprintEnable ()
p:AddFrags(1)
else
p:SetTeam( TEAM_BLUE )
p:Kill( )
p:PrintMessage(HUD_PRINTTALK,"you don't want to be in the Blue team? Press 'F4' to be one again!"); -- eg: Predator(red)
p:SprintDisable ()
p:AddFrags(1)
end
end
self.BaseClass:KeyPress(p, key)
end
Edit: this might also be where the teams problem comes from but i dont think so
CODE
TEAM_RED = 1
TEAM_BLUE = 2
team.SetUp(TEAM_RED, "Red Team", Color(255, 0, 0, 255)) -- RED TEAM, It appear in scores
team.SetUp(TEAM_BLUE, "Blue Team", Color(0, 0, 255, 255)) -- BLUE TEAM, It appear in scores
This post has been edited by A208: 19 May, 2009 - 03:05 PM