Thanks, but it didn't work out.
Code:
public void OnPluginStart()
{
HookUserMessage(GetUserMessageId("TextMsg"), Event_TextMsg, true);
}
public Action Event_TextMsg(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)
{
char Text[128];
PbReadString(msg, "params", Text, sizeof(Text), 0);
if(StrContains(Text, "is joining the Counter-Terrorist force") != -1) // change saveplayer with your pattern
{
return Plugin_Handled;
}
else if(StrContains(Text, "is joining the Terrorist force") != -1) // change saveplayer with your pattern
{
return Plugin_Handled;
}
else if(StrContains(Text, "is joining the Spectators") != -1) // change saveplayer with your pattern
{
return Plugin_Handled;
}
return Plugin_Continue;
}
Still getting the messages! Is my code correct?
(Also I think there would be a problem for people who are running the game not in English.)