Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #pragma semicolon 1
- #pragma newdecals required
- KeyValues gK_ConnectSystem;
- public Plugin:myinfo =
- {
- name = "|Staff Tools| AutoRR",
- description = "The Staff 2018",
- author = "The Staff",
- version = "2.0",
- url = "www.thestaff.net"
- };
- public void OnMapStart()
- {
- gK_ConnectSystem = new KeyValues("connectsystem");
- char[] sFile = new char[PLATFORM_MAX_PATH];
- BuildPath(Path_SM, sFile, PLATFORM_MAX_PATH, "configs/connectsystem.cfg");
- gK_ConnectSystem.ImportFromFile(sFile);
- }
- public void OnMapEnd() {
- delete gK_ConnectSystem;
- }
- public void OnClientPutInServer(int client)
- {
- if (!IsFakeClient(client))
- {
- char[] sSteamId = new char[MAX_NAME_LENGTH];
- GetClientAuthId(client, AuthId_Steam2, sSteamId, MAX_NAME_LENGTH);
- if (gK_ConnectSystem.JumpToKey(sSteamId, false))
- {
- char[] sFormat = new char[PLATFORM_MAX_PATH];
- gK_ConnectSystem.GetString("sound", sFormat, PLATFORM_MAX_PATH);
- if (sFormat[0] != '\0')
- {
- if (sFormat[0] != '*')
- Format(sFormat, PLATFORM_MAX_PATH, "*%s", sFormat);
- EmitSoundToAll(sFormat);
- }
- gK_ConnectSystem.GetString("message", sFormat, PLATFORM_MAX_PATH);
- if (sFormat[0] != '\0')
- {
- FilterColors(sFormat);
- PrintToChatAll(" %s", sFormat);
- }
- }
- gK_ConnectSystem.Rewind();
- }
- }
- void FilterColors(char[] sString)
- {
- ReplaceString(sString, PLATFORM_MAX_PATH, "{red}", "\x02", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{green}", "\x04", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{olive}", "\x06", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{purple}", "\x03", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{yellow}", "\x09", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{blue}", "\x0B", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{pink}", "\x0E", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{grey}", "\x08", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{lightred}", "\x07", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{white}", "\x01", false);
- ReplaceString(sString, PLATFORM_MAX_PATH, "{orange}", "\x10", false);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement