He was throwing things out there that you should consider...
if the command "sm_ct" is issued by a console user (someone from HLSW for example), then the following error would be thrown:
Code:
L 02/12/2014 - 08:23:27: Info (map "de_dust2_only_b") (file "errors_20140212.log")
L 02/12/2014 - 08:23:27: [SM] Native "ClientCommand" reported: Client index 0 is invalid
L 02/12/2014 - 08:23:27: [SM] Displaying call stack trace for plugin "teamcommands.smx":
L 02/12/2014 - 08:23:27: [SM] [0] Line 49, /home/groups/alliedmodders/forums/files/2/4/4/4/7/0/130517.attach::TCTurnClientToCounterTerrorist()
Using something like this should help:
PHP Code:
YourCommandCallback(client, args)
{
if (!IsValidPlayer(client))
{
return Plugin_Handled;
}
// Rest of your code here
}
bool:IsValidPlayer(client)
{
if (!(1 <= client <= MaxClients) || !IsClientConnected(client))
{
return false;
}
return IsClientInGame(client);
}
Also, you have semicolons on all but 1 line - using #pragma semicolon 1 might be a good idea to help you a tad
__________________