Garry's Mod

Garry's Mod

Murder
ThatCrazyGuy 2015 年 6 月 26 日 下午 6:20
mu_jointeam problems
Hi there,

I've been trying to create a bind that allows you to toggle between spectators and players, but i'm having trouble gettting toggle between the two.

So far it changes them to the spectator or player when pressed, but it doesn't change them back to the other team when it's pressed again.

Here's the code I've written up.
function ChangeTeam( ply ) if ply:Team(2) then ply:ConCommand( "mu_jointeam 1" ) elseif ply:Team(1) then ply:ConCommand( "mu_jointeam 2" ) end end hook.Add("ShowTeam", "ChangeTeam", ChangeTeam)

Any help with this would be greatly appreciated!

Thanks :D
< >
正在显示第 1 - 2 条,共 2 条留言
Mechanical Mind  [开发者] 2015 年 6 月 28 日 下午 8:59 
ply:Team() == 2 instead of ply:Team(2)
ThatCrazyGuy 2015 年 6 月 29 日 上午 8:23 
Ok thanks man. :D
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50