AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
|
01-07-2020
, 06:19
[CSGO] "sm_say" Change "(ALL)"
|
#1
|
Hi people.
So on my CS Source server I had changed sm_say "(ALL)" to "(ADMIN)" with the same color as the old Mani Admin Plugin style of "ADMIN CHAT", but on my CS GO server in the code where I'm meant to change "(ALL)" it shows as something different.
So in my CS Source basechat.sp it is as follows:
PHP Code:
void SendChatToAll(int client, const char[] message)
{
char nameBuf[MAX_NAME_LENGTH];
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i))
{
continue;
}
FormatActivitySource(client, i, nameBuf, sizeof(nameBuf));
PrintToChat(i, "\x06(ADMIN) %s: \x01%s", nameBuf, message);
}
}
void DisplayCenterTextToAll(int client, const char[] message)
{
char nameBuf[MAX_NAME_LENGTH];
for (int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i))
{
continue;
}
FormatActivitySource(client, i, nameBuf, sizeof(nameBuf));
PrintCenterText(i, "%s: %s", nameBuf, message);
}
}
void SendChatToAdmins(int from, const char[] message)
{
int fromAdmin = CheckCommandAccess(from, "sm_chat", ADMFLAG_CHAT);
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && (from == i || CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT)))
{
PrintToChat(i, "\x04(%sADMIN CHAT) %N: \x01%s", fromAdmin ? "" : "TO ", from, message);
}
}
}
void SendDialogToOne(int client, int color, const char[] text, any ...)
{
char message[100];
VFormat(message, sizeof(message), text, 4);
KeyValues kv = new KeyValues("Stuff", "title", message);
kv.SetColor("color", g_Colors[color][0], g_Colors[color][1], g_Colors[color][2], 255);
kv.SetNum("level", 1);
kv.SetNum("time", 10);
CreateDialog(client, kv, DialogType_Msg);
delete kv;
}
void SendPrivateChat(int client, int target, const char[] message)
{
if (!client)
{
PrintToServer("(Private to %N) %N: %s", target, client, message);
}
else if (target != client)
{
PrintToChat(client, "\x04(Private to %N) %N: \x01%s", target, client, message);
}
PrintToChat(target, "\x04(Private to %N) %N: \x01%s", target, client, message);
LogAction(client, -1, "\"%L\" triggered sm_psay to \"%L\" (text %s)", client, target, message);
}
For the one now it shows as follows:
PHP Code:
void SendChatToAdmins(int from, const char[] message)
{
int fromAdmin = CheckCommandAccess(from, "sm_chat", ADMFLAG_CHAT);
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && (from == i || CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT)))
{
if (g_GameEngine == Engine_CSGO)
PrintToChat(i, " \x01\x0B\x04%t: \x01%s", fromAdmin ? "Chat admins" : "Chat to admins", from, message);
else
PrintToChat(i, "\x04%t: \x01%s", fromAdmin ? "Chat admins" : "Chat to admins", from, message);
}
}
}
void SendDialogToOne(int client, int color, const char[] text, any ...)
{
char message[100];
VFormat(message, sizeof(message), text, 4);
KeyValues kv = new KeyValues("Stuff", "title", message);
kv.SetColor("color", g_Colors[color][0], g_Colors[color][1], g_Colors[color][2], 255);
kv.SetNum("level", 1);
kv.SetNum("time", 10);
CreateDialog(client, kv, DialogType_Msg);
delete kv;
}
void SendPrivateChat(int client, int target, const char[] message)
{
if (!client)
{
PrintToServer("(Private to %N) %N: %s", target, client, message);
}
else if (target != client)
{
if (g_GameEngine == Engine_CSGO)
PrintToChat(client, " \x01\x0B\x04%t: \x01%s", "Private say to", target, client, message);
else
PrintToChat(client, "\x04%t: \x01%s", "Private say to", target, client, message);
}
if (g_GameEngine == Engine_CSGO)
PrintToChat(target, " \x01\x0B\x04%t: \x01%s", "Private say to", target, client, message);
else
PrintToChat(target, "\x04%t: \x01%s", "Private say to", target, client, message);
LogAction(client, target, "\"%L\" triggered sm_psay to \"%L\" (text %s)", client, target, message);
}
For the CSGO engine it's different to what I am familiar to and because I'm unfamiliar with the newer version of SM I'm unsure which part I need to modify to change the name from (ALL) to (ADMIN) and (ADMIN CHAT) to (ADMINS). That and the fact that I've not done any C++ in a year and a half. Could you kindly point me in the right direction?
Thanks!
__________________
|
|