• Teams Not spawing any weapons or the right player model
    7 replies, posted
[CODE]AddCSLuaFile("cl_init.lua") AddCSLuaFile("shared.lua") include("shared.lua") function GM:PlayerConnect( name, ip ) print("Player: " .. name .. ", has joined the game.") end function GM:PlayerInitialSpawn( ply ) print("Player: " .. ply:Nick() .. ", has spawned.") end function GM:PlayerAuthed( ply, steamID, uniqueID ) print("Player: " .. ply:Nick() .. ", has gotten authed.") end function GM:PlayerInitialSpawn( ply ) ply:SetWalkSpeed( 150 ) ply:SetRunSpeed( 500 ) ply:SetNoCollideWithTeammates( class.TeammateNoCollide ) ply:SetTeam( 3 ) print( "Someone Connected!") Game.ConsoleCommand("TeamMenu") end function GM:PlayerSpawn( ply ) if ply:Team() == 1 then ply:Give("snowball_thrower_kyle") end function GM:PlayerSpawn( ply ) if ply:Team() == 2 then ply:Give("snowball_thrower_kyle") end function GM:PlayerSpawn( ply ) if ply:Team() == 3 then ply:Give("snowball_thrower_kyle") ply:SetRunSpeed( 1000 ) end function team_1( ply ) ply:SetTeam( 1 ) Make the player join team 3 ply:Spawn() ply:Kill() end function team_2( ply ) ply:SetTeam( 2 ) Make the player join team 4 ply:Spawn() ply:Kill() end end --And after the two previous console commands add concommand.Add( "team_1", team_1 ) Add the command to set the players team to team 3 concommand.Add( "team_2", team_2 ) Add the command to set the players team to team 4 [/CODE]
You can only have one for each gamemode function. If you make another it will override the previous one you defined. You can do this multiple times and not override the others by using hook.Add
where do i put the hook.Add
you can move everything from all GM:PlayerSpawn() is one like so... function GM:PlayerSpawn( ply ) if ply:Team() == 1 then ply:Give("snowball_thrower_kyle") end if ply:Team() == 2 then ply:Give("snowball_thrower_kyle") end if ply:Team() == 3 then ply:Give("snowball_thrower_kyle") ply:SetRunSpeed( 1000 ) end end
[QUOTE=AtomicTACO;45483099]you can move everything from all GM:PlayerSpawn() is one like so... function GM:PlayerSpawn( ply ) if ply:Team() == 1 then ply:Give("snowball_thrower_kyle") end if ply:Team() == 2 then ply:Give("snowball_thrower_kyle") end if ply:Team() == 3 then ply:Give("snowball_thrower_kyle") ply:SetRunSpeed( 1000 ) end end[/QUOTE] That is kind of stupid, better done like this: [code] function GM:PlayerSpawn( ply ) if ply:Team() == 3 then ply:SetRunSpeed( 1000 ) end ply:Give("snowball_thrower_kyle") end[/code]
Thanks :D Still dosent work
Why do you have ply:Spawn () and ply:Kill () that is just idiotic
its just a testing thing i put there for testing the command
Sorry, you need to Log In to post a reply to this thread.