GM:ShowClassChooser does not work

Why does it not work?

[lua]
function PlayerChangedTeam( ply, oldteam, newteam )
Msg("[GMOD:RPG] Ran PlayerChangedTeam()")
if newteam ~= TEAM_SPECTATOR and team.GetClass( newteam ) == “Default” then
Msg("[GMOD:RPG] Showing class chooser")
GM:ShowClassChooser( newteam )
end
end

hook.Add( “OnPlayerChangedTeam”, “OnPlayerTeamChange”, PlayerChangedTeam)
[/lua]

That function doesn’t call, and when i try calling

[lua]
function ClassChooser( ply )
GM:ShowClassChooser( ply:Team() )
end
concommand.Add(“choose_class”, ClassChooser)

[/lua]

It does nothing but says “Unknown Command”.

There are no lua errors reported either.

help please?

edit: Also, I’m deriving from fretta.

snip[URL=“http://wiki.garrysmod.com/?title=Gamemode.ShowTeam”]

actually. you are wrong.

**[Gamemode.ShowClassChooser

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ShowClassChooser)**

snip

[editline]3rd January 2011[/editline]

This is on the client right?

Also, use GAMEMODE: instead of GM:

Yes, this is on the client.

I tried changing the hook to

[lua]
function PlayerChangedTeam( ply, oldteam, newteam )
if newteam ~= TEAM_SPECTATOR and team.GetClass( newteam ) == “Default” then
GM:ShowClassChooser( newteam )
end
end

hook.Add( “TeamChangeNotification”, “OnPlayerTeamChange”, PlayerChangedTeam)
[/lua]

But it still did nothing. I’m using this in cl_init.lua btw.

I really would like this to be resolved before I continue with my project.

Ok, I’ve tried a few things. Firstly, I found **[Gamemode.ShowClassChooser

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.ShowClassChooser)** in cl_gmchanger.lua. I also tried running the console command changeclass. which, as you can see:



INIParser:new - File stargate/gatespawner_maps/gm_bigcity.ini does not exist!
INIParser:parse - File stargate/config.ini successfully parsed
Timer Error: [addons\stargate\lua\autorun\server\gate_spawner.lua:16] attempt to index field 'config' (a nil value)
InstantDeath joined Red Team
] changeclass
=================================================
Simple Prop Protection: 350 props belong to world
=================================================


Did nothing.

edit: Noticed the GAMEMODE.SelectClass var. Tried adding that to shared.lua . Still nothing.