Отлов определенных слов в чате

DanZa

Участник
Сообщения
82
Реакции
11
C-подобный:
public void OnPluginStart()
{
    HookEvent("player_say", PlayerSay);
}

public Action PlayerSay(Event hEvent, const char[] sEvent, bool bdb)
{
    int client = GetClientOfUserId(hEvent.GetInt("userid"));
    char text[256];
    hEvent.GetString("text", text, sizeof(text));
 
    if(0 < client <= MaxClients && IsClientInGame(client))
        if(strcmp(text, "like", true) == 0)
            ClientCommand(client, "sm_like");
    return Plugin_Continue;
}
Спасибо, работает))
 
Сверху Снизу