Trying to use this for a dynamic !CLASSNAME command. However, I think it's getting called twice on a single chat. I have Simple Colors, and Simple Me installed along with Core.
Code:
public Action:OnChatMessage(&author, Handle:recipients, String:name[], String:message[])
{
if (TFTeam:GetClientTeam(author) == TFTeam_Spectator)
{
new TFClassType:class = CheckChatStringForClass(message)
switch (class)
{
case TFClass_Unknown: return Plugin_Continue;
default: QueueForClass(author, GetQueueFromTeamClass(TFTeam:GetClientTeam(author), class));
}
new String:text[200];
text = "You chose class %i";
new Handle:pack;
CreateDataTimer(0.001, Timer_MeAction, pack, TIMER_FLAG_NO_MAPCHANGE);
WritePackCell(pack, author);
WritePackString(pack, text);
WritePackCell(pack, _:class);
return Plugin_Stop;
}
return Plugin_Continue;
}
My data timer gets fired twice. I put that same datatimer in a normal console command and it only fires once.