• Team Evening Being Dumb :P .
    7 replies, posted
PROBLEM: Everytime a person dies he is set to another random team ( being the other team from the one he was previously on ). Here is the code for the evening teams :P [lua] //Evening Teams local VTCG = math.random( 1, 2 ) local GAN = team.NumPlayers( 1 ) --Do we need that long variable? local WHI = team.NumPlayers( 2 ) --Do we need that long variable? if GAN > WHI then ply:SetTeam( 2 ) elseif WHI > GAN then ply:SetTeam( 1 ) elseif WHI == GAN then ply:SetTeam( VTCG ) end end [/lua] Also this may be it but not 100% sure the initial spawn is setting you to team 1 [lua] function GM:PlayerInitialSpawn( ply ) ply:PrintMessage( HUD_PRINTTALK, "Welcome, " .. ply:Name() .. "!" ) ply:SetTeam( 1 ) end [/lua] Thanks for the help :) :P
wat
[QUOTE=stapler2025;45851217]wat[/QUOTE] Haha dont know how to read?
[QUOTE=Vizik;45851222]Haha dont know how to read?[/QUOTE] <generic image macro here> Haha dont know how to tell us what your actual problem is?
Dude i stated "Everytime a person dies he is set to another random team ( being the other team from the one he was previously on ). " Thats the problem. But here ill edit if for future preferences
[QUOTE=Vizik;45851023]PROBLEM: Everytime a person dies he is set to another random team ( being the other team from the one he was previously on ). Here is the code for the evening teams :P [lua] //Evening Teams local VTCG = math.random( 1, 2 ) local GAN = team.NumPlayers( 1 ) --Do we need that long variable? local WHI = team.NumPlayers( 2 ) --Do we need that long variable? if GAN > WHI then ply:SetTeam( 2 ) elseif WHI > GAN then ply:SetTeam( 1 ) elseif WHI == GAN then ply:SetTeam( VTCG ) end end [/lua] Also this may be it but not 100% sure the initial spawn is setting you to team 1 [lua] function GM:PlayerInitialSpawn( ply ) ply:PrintMessage( HUD_PRINTTALK, "Welcome, " .. ply:Name() .. "!" ) ply:SetTeam( 1 ) end [/lua] Thanks for the help :) :P[/QUOTE] Attempting to understand, but I believe the top bit is placed in function GM:PlayerSpawn(ply) no? If so, then that is causing them to change teams each round. Should show us what is calling the team change script.
[QUOTE=MadkillerMax;45851285] Should show us what is calling the team change script.[/QUOTE] Not sure what you mean buy this!? And yes it is under that function, so to fix this i will have to remove it from that function!?
[QUOTE=Vizik;45851302]Not sure what you mean buy this!? And yes it is under that function, so to fix this i will have to remove it from that function!?[/QUOTE] move the code [lua]local VTCG = math.random( 1, 2 ) local GAN = team.NumPlayers( 1 ) --Do we need that long variable? local WHI = team.NumPlayers( 2 ) --Do we need that long variable? if GAN > WHI then ply:SetTeam( 2 ) elseif WHI > GAN then ply:SetTeam( 1 ) elseif WHI == GAN then ply:SetTeam( VTCG ) end[/lua] inside the function GM:PlayerInitialSpawn( ply ) This will say that when the player FIRST spawns(not every spawn) they will select a team. You should be able to remove the function GM:PlayerSpawn( ply ) if that was all that was in it.
Sorry, you need to Log In to post a reply to this thread.