ESK0 / ServerAdvertisement3

Very useful plugin for your server with which you can print messages to players. Messages are stored in file.
38 stars 16 forks source link

Automated response #10

Closed crashzk closed 4 years ago

crashzk commented 5 years ago

It would be interesting if the plugin had the automated response function.

HOW IT WILL WORK

I would set up a message in the plugin configuration file, example:

[...]
"2"
    {
      "pt" "Visit our Site - siteexample.com"
      "type" "T"
      "trigger" "!site"
    }

The Trigger function would be an example of what you could use to use this function in the plugin.

EXAMPLE OF A PLUGIN WITH THE FOLLOWING FUNCTION

I do not know if it helps but I found a plugin that does this already, but it would be perfect if you could implement it in ServerAdvertisement3.

#include <sourcemod>

public OnPluginStart()
{    
    RegConsoleCmd("sm_groupsteam", Command_GrupoSteam);
    RegConsoleCmd("sm_discord", Command_Discord);
}

public Action Command_GrupoSteam(int client, int args)
{
    if (IsValidClient(client))
    PrintToChat(client, "Grupo Steam: https://steamcommunity.com/groups/LINK_GRUPOSTEAM");
}

public Action Command_Discord(int client, int args)
{
    if (IsValidClient(client))
    PrintToChat(client, "Discord: https://LINK_DISCORD");
}

stock bool IsValidClient(int client)
{
    if (!( 1 <= client <= MaxClients ) || !IsClientInGame(client))
    return false;

    if (IsFakeClient(client))
    return false;

    return true;
}
ESK0 commented 5 years ago

Nice idea, will be added probably.