One of my admins wrote this function, I think it would make a nice addition.
He doesn't have an account on here so I'm posting this on his behalf.
Credits to
Mitch for code / testing:
PHP Code:
RegAdminCmd("sm_addhappy", Command_Addhappy, ADMFLAG_BAN, "Adds a happy phrase to happy_phrases.ini");
public Action:Command_Addhappy(client, args)
{
if(args < 1)
{
ReplyToCommand(client, "[SM] Usage: sm_addhappy <phrase>");
return Plugin_Handled;
}
new String:szhappyphrase[64];
GetCmdArgString(szhappyphrase, sizeof(szhappyphrase));
new String:szFile[256];
BuildPath(Path_SM, szFile, sizeof(szFile), "configs/happy_phrases.ini");
new Handle:hFile = OpenFile(szFile, "at");
WriteFileLine(hFile, "%s", szhappyphrase);
CloseHandle(hFile);
g_phraseCount = BuildPhrases();
return Plugin_Handled;
}
__________________