PHP Code:
public Action:OnSay(client, args)
{
if (!client)return Plugin_Continue;
decl String:text[512];
GetCmdArgString(text, sizeof(text));
new start;
new len = strlen(text);
if (text[len - 1] == '"')
{
text[len - 1] = '\0';
start = 1;
}
decl String:shortcut[32], String:textclient[64];
new index = BreakString(text[start], shortcut, sizeof(shortcut));
BreakString(text[index], textclient, sizeof(textclient));
new size = GetArraySize(g_Shortcuts);
for (new i; i != size; ++i)
{
GetArrayString(g_Shortcuts, i, text, sizeof(text));
if (strcmp(shortcut, text, false) == 0)
{
QueryClientConVar(client, "cl_disablehtmlmotd", ConVarQueryFinished:ClientConVar, client);
decl String:title[256];
decl String:steamId[64];
decl String:userId[16];
decl String:name[64];
decl String:clientIp[32];
GetArrayString(g_Titles, i, title, sizeof(title));
GetArrayString(g_Links, i, text, sizeof(text));
//GetClientAuthString( client, steamId, sizeof(steamId) );
GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId));
FormatEx(userId, sizeof(userId), "%u", GetClientUserId(client));
GetClientName(client, name, sizeof(name));
GetClientIP(client, clientIp, sizeof(clientIp));
/* ReplaceString( title, sizeof(title), "{SERVER_IP}", g_ServerIp);
ReplaceString( title, sizeof(title), "{SERVER_PORT}", g_ServerPort);
ReplaceString( title, sizeof(title), "{STEAM_ID}", steamId);
ReplaceString( title, sizeof(title), "{USER_ID}", userId);
ReplaceString( title, sizeof(title), "{NAME}", name);
ReplaceString( title, sizeof(title), "{IP}", clientIp); */
ReplaceString(text, sizeof(text), "{SERVER_IP}", g_ServerIp);
ReplaceString(text, sizeof(text), "{SERVER_PORT}", g_ServerPort);
ReplaceString(text, sizeof(text), "{STEAM_ID}", steamId);
ReplaceString(text, sizeof(text), "{USER_ID}", userId);
ReplaceString(text, sizeof(text), "{NAME}", name);
ReplaceString(text, sizeof(text), "{IP}", clientIp);
ReplaceString(text, sizeof(text), "{TEXT}", textclient);
if (StrEqual(title, "none", false))
{
StreamPanel("Webshortcuts", text, client);
}
else if (StrEqual(title, "full", false))
{
FixMotdCSGO_fullsize(text);
ShowMOTDPanel(client, "Script by Franc1sco franug", text, MOTDPANEL_TYPE_URL);
}
else
{
FixMotdCSGO(text, title);
ShowMOTDPanel(client, "Script by Franc1sco franug", text, MOTDPANEL_TYPE_URL);
}
}
}
return Plugin_Continue;
}