Problem with Chat Commands

So I have quite the peculiar problem with Chat Commands that I’m hoping someone can shed some light on.

So I’m testing out player classes in a custom gamemode and attempting to create a console command and a chat command to change your player class. So far this is what my gamemode files look like…

init.lua



include( "player_class/player_citizen.lua" )
include( "player_class/player_cp.lua" )
include( "player_class/player_overwatch.lua" )
include( "server/concommands.lua")
include( "server/classchatcommands.lua" )

AddCSLuaFile( "player_class/player_citizen.lua" )
AddCSLuaFile( "player_class/player_cp.lua" )
AddCSLuaFile( "player_class/player_overwatch.lua" )

DEFINE_BASECLASS( "gamemode_base" )

function GM:PlayerSpawn( ply )
    
	BaseClass.PlayerSpawn( self, ply )
	player_manager.RunClass( ply, "Spawn" )
	
end

function GM:PlayerInitialSpawn( ply )

         BaseClass.PlayerInitialSpawn( self, ply )
         player_manager.SetPlayerClass( ply, "player_citizen" )

end


cl_init.lua



include( "player_class/player_citizen.lua" )
include( "player_class/player_cp.lua" )
include( "player_class/player_overwatch.lua" )


gamemode/server/concommands.lua



function ClassCitizen( ply )
    player_manager.SetPlayerClass( ply, "player_citizen" )
	ply:ConCommand("kill")
end
concommand.Add( "class_citizen", ClassCitizen )

function ClassCP( ply )
    player_manager.SetPlayerClass( ply, "player_cp" )
	ply:ConCommand("kill")
end
concommand.Add( "class_cp", ClassCP)

function ClassOverwatch( ply )
    player_manager.SetPlayerClass( ply, "player_overwatch" )
	ply:ConCommand("kill")
end
concommand.Add( "class_overwatch", ClassOverwatch )


gamemode/server/classchatcommands.lua



function CPCommand( ply, text )

	if (string.lower(text) == "!cp") then 
		ply:ConCommand("class_cp")
		return ""
	end
	
end
hook.Add( "PlayerSay", "CPCommand", CPCommand )

function CitizenCommand( ply, text )

	if (string.lower(text) == "!citizen") then 
		ply:ConCommand("class_citizen")
		return ""
	end
	
end
hook.Add( "PlayerSay", "CitizenCommand", CitizenCommand )

function OverwatchCommand( ply, text )

	if (string.lower(text) == "!overwatch") then 
		ply:ConCommand("class_overwatch")
		return ""
	end
	
end
hook.Add( "PlayerSay", "OverwatchCommand", OverwatchCommand )


What is peculiar is that all the console commands work perfectly, but only the chat command for !citizen will actually work.

Do ply:SetTeam() in the concommands and set class in the beginning of GM:PlayerSpawn according to ply:Team().

Nope… it didn’t work, and the same thing happens. All the Console Commands work perfectly but only the !citizen chat command does anything.

init.lua



function GM:PlayerSpawn( ply )
    
	BaseClass.PlayerSpawn( self, ply )
	player_manager.RunClass( ply, "Spawn" )
	
	if ply:Team() == 1 then
	player_manager.SetPlayerClass( ply, "player_citizen" )
	end
	if ply:Team() == 2 then
	player_manager.SetPlayerClass( ply, "player_cp" )
	end
	if ply:Team() == 3 then
	player_manager.SetPlayerClass( ply, "player_overwatch" )
	end

end


concommands.lua



function ClassCitizen( ply )
    ply:SetTeam( 1 )
	ply:ConCommand("kill")
end
concommand.Add( "class_citizen", ClassCitizen )

function ClassCP( ply )
    ply:SetTeam( 2 )
	ply:ConCommand("kill")
end
concommand.Add( "class_cp", ClassCP)

function ClassOverwatch( ply )
    ply:SetTeam( 3 )
	ply:ConCommand("kill")
end
concommand.Add( "class_overwatch", ClassOverwatch )


classchatcommands.lua



function CitizenCommand( ply, text )

	if (string.lower(text) == "!citizen") then 
		ply:ConCommand("class_citizen")
		return ""
	end
	
end
hook.Add( "PlayerSay", "CitizenCommand", CitizenCommand )

function CPCommand( ply, text )

	if (string.lower(text) == "!cp") then 
		ply:ConCommand("class_cp")
		return ""
	end
	
end
hook.Add( "PlayerSay", "CPCommand", CPCommand )

function OverwatchCommand( ply, text )

	if (string.lower(text) == "!overwatch") then 
		ply:ConCommand("class_overwatch")
		return ""
	end
	
end
hook.Add( "PlayerSay", "OverwatchCommand", OverwatchCommand )


[editline]3rd June 2013[/editline]

I reverted it back to the way I had it and it just started working… so solved I guess??? This whole thing has confused me, but I’ll bring up any further issues.