Lunatix Jan 29, 2019 @ 3:56am
Sourcemod chat trigger
I searched how to create a command for my server that you write in the chat and it will trigger a message like for example : !info and it will show "The server is hosted by Lunatix".
How do you do that exactly ?
I didn't find any simle explanation for that on internet.
Last edited by Lunatix; Jan 29, 2019 @ 3:56am
< >
Showing 1-2 of 2 comments
Peter Brev Jan 29, 2019 @ 9:16am 
#include <sourcemod> #define PLUGIN_NAME "Server Info Display" #define PLUGIN_AUTHOR "Peter Brev For Lunatix" #define PLUGIN_VERSION "1.0.0.0" #define PLUGIN_DESCRIPTION "Displays the server info" #define PLUGIN_URL "https://steamcommunity.com/discussions/forum/1/1743358239852221573/" #define TAG "[INFO]" #define CTAG "\x07cc3300" #define CLIME "\x0700ff15" #define TEXT "The server is hosted by Lunatix." public Plugin myinfo = { name = PLUGIN_NAME, author = PLUGIN_AUTHOR, description = PLUGIN_DESCRIPTION, version = PLUGIN_VERSION, url = PLUGIN_URL, }; public void OnPluginStart() { CreateConVar("sm_info_version", "1.0.0.0", "Display the current info fetcher version. Used for organization purposes.", FCVAR_NOTIFY|FCVAR_SPONLY); RegConsoleCmd("sm_info", Command_Info, "sm_info - Prints Server Info"); } public Action Command_Info(int client, int args) { if (args < 1) { ReplyToCommand(client, "%s%s %s%s", CTAG, TAG, CLIME, TEXT); return Plugin_Handled; } return Plugin_Handled; }

http://www.sourcemod.net/compiler.php?go=dl&id=757715

Untested. Let me know if something went wrong.
Lunatix Dec 24, 2019 @ 6:19am 
Thank you.
Last edited by Lunatix; Dec 24, 2019 @ 6:19am
< >
Showing 1-2 of 2 comments
Per page: 1530 50

Date Posted: Jan 29, 2019 @ 3:56am
Posts: 2