ConnectAnnounce: undo last commit
This commit is contained in:
parent
181bd09b2e
commit
91a51dce36
@ -50,7 +50,7 @@ public void OnPluginStart()
|
||||
RegAdminCmd("sm_joinmsg", Command_JoinMsg, ADMFLAG_CUSTOM1, "Sets a custom message which will be shown upon connecting to the server");
|
||||
RegAdminCmd("sm_resetjoinmsg", Command_ResetJoinMsg, ADMFLAG_CUSTOM1, "Resets your custom connect message");
|
||||
|
||||
RegAdminCmd("sm_hide_connect_csays", OnToggleHideCsays, ADMFLAG_CUSTOM1, "Toggle blocking connect csay messages");
|
||||
RegConsoleCmd("sm_hide_connect_csays", OnToggleHideCsays, "Toggle blocking connect csay messages");
|
||||
|
||||
g_hCookieHideCsays = RegClientCookie("csays_blocked", "are csays blocked", CookieAccess_Protected);
|
||||
|
||||
@ -76,8 +76,13 @@ public void OnDatabaseConnect(Database db, const char[] error, any data)
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnClientCookiesCached(int client)
|
||||
{
|
||||
if(IsClientAuthorized(client))
|
||||
ReadClientCookies(client);
|
||||
char sBuffer[2];
|
||||
GetClientCookie(client, g_hCookieHideCsays, sBuffer, sizeof(sBuffer));
|
||||
|
||||
if(sBuffer[0] != '\0')
|
||||
g_bHideCsays[client] = true;
|
||||
else
|
||||
g_bHideCsays[client] = false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -91,22 +96,6 @@ public void ToggleHideCsays(int client)
|
||||
CPrintToChat(client, "{cyan}[ConnectAnnounce] {white}%s", g_bHideCsays[client] ? "You hid Connect Csay Messages." : "You unhid Connect Csay Messages.");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void ReadClientCookies(int client)
|
||||
{
|
||||
char sBuffer[2];
|
||||
|
||||
if(CheckCommandAccess(client, "", ADMFLAG_CUSTOM1))
|
||||
GetClientCookie(client, g_hCookieHideCsays, sBuffer, sizeof(sBuffer));
|
||||
|
||||
if(sBuffer[0] != '\0')
|
||||
g_bHideCsays[client] = true;
|
||||
else
|
||||
g_bHideCsays[client] = false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@ -129,12 +118,6 @@ public Action OnToggleHideCsays(int client, int args)
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void ShowSettingsMenu(int client)
|
||||
{
|
||||
if(!CheckCommandAccess(client, "", ADMFLAG_CUSTOM1))
|
||||
{
|
||||
PrintToChat(client, "[SM] You don't have access to these Settings.");
|
||||
return;
|
||||
}
|
||||
|
||||
Menu menu = new Menu(MenuHandler_MainMenu);
|
||||
|
||||
menu.SetTitle("ConnectCsay Settings", client);
|
||||
@ -495,9 +478,6 @@ public void OnClientPostAdminCheck(int client)
|
||||
if(IsFakeClient(client))
|
||||
return;
|
||||
|
||||
if(AreClientCookiesCached(client))
|
||||
ReadClientCookies(client);
|
||||
|
||||
if(g_hDatabase == INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user