Ok I've been trying to make a chat triggered motd display but I am having some problems. I make it so when a person says !motd it displays the contents of rules.txt.
I want it to read rules.txt but server side. When I test the plugin with a dedicated server having rules.txt, but the client doesn't, when they say !motd nothing shows up. The only way I fixed around it is having the client download rules.txt when they join but there has to be a way to display it to them without them actually having the file. Am I going the wrong way about this?
Here's the code, bare with because it's my 1st one
.
Code:
public OnPluginStart()
{
RegConsoleCmd("say", Command_OnSay);
}
public Action:Command_OnSay(client, args)
{
decl String:text[192];
GetCmdArgString(text, sizeof(text));
new startidx;
if (text[strlen(text)-1] == '"')
{
text[strlen(text)-1] = '\0';
startidx = 1;
}
if (strcmp(text[startidx], "!motd", false) == 0)
{
ShowMotd(client);
}
return Plugin_Continue;
}
public Action:ShowMotd(client)
{
ShowMOTDPanel(client, "Server rules", "rules.txt", MOTDPANEL_TYPE_FILE);
return Plugin_Handled;
}