Diff
checker
Testo
Testo
Immagini
Documenti
Excel
Cartelle
Legal
Enterprise
Applicazione per desktop
Prezzi
Accedi
Scarica Diffchecker Desktop
Confronta il testo
Trova la differenza tra due file di testo
Strumenti
Cronologia
Editor live
Nascondi spazi bianchi
Comprimi invariate
Senza a capo
Layout
Diviso
Unificato
Livello di dettaglio
Intelligente
Parola
Carattere
Stili testo
Modifica aspetto
Evidenziazione sintassi
Scegli sintassi
Ignora
Trasforma testo
Vai alla prima modifica
Modifica input
Diffchecker Desktop
Il modo più sicuro per usare Diffchecker. Ottieni l'app Diffchecker Desktop: i tuoi diff non lasciano mai il tuo computer!
Ottieni Desktop
SBP PTaH
Creato
7 anni fa
Il diff non scade mai
Eliminare
Esporta
Condividere
Spiegare
39 rimozioni
Linee
Totale
Rimosso
Caratteri
Totale
Rimosso
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
123 linee
Copia tutti
5 aggiunte
Linee
Totale
Aggiunto
Caratteri
Totale
Aggiunto
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
102 linee
Copia tutti
#pragma semicolon 1
#pragma semicolon 1
#include <sourcemod>
#include <sourcemod>
#include <sdktools>
#include <sdktools>
#include <PTaH>
#include <PTaH>
#pragma newdecls required
#pragma newdecls required
#define INTERVAL 3
#define INTERVAL 3
ConVar g_cBlockPlugins = null;
ConVar g_cBlockPlugins = null;
ConVar g_cBlockSM = null;
ConVar g_cBlockSM = null;
ConVar g_cBlockMeta = null;
ConVar g_cBlockMeta = null;
ConVar g_cAllowRootAdmin = null;
ConVar g_cAllowRootAdmin = null;
char g_sLogs[PLATFORM_MAX_PATH + 1];
char g_sLogs[PLATFORM_MAX_PATH + 1];
public void OnPluginStart()
public void OnPluginStart()
{
{
g_cBlockPlugins = CreateConVar("sbp_block_plugins", "1", "Block \"sm plugins\" and \"sm exts\"?", _, true, 0.0, true, 1.0);
g_cBlockPlugins = CreateConVar("sbp_block_plugins", "1", "Block \"sm plugins\" and \"sm exts\"?", _, true, 0.0, true, 1.0);
g_cBlockSM = CreateConVar("sbp_block_sm", "1", "Block \"sm\"?", _, true, 0.0, true, 1.0);
g_cBlockSM = CreateConVar("sbp_block_sm", "1", "Block \"sm\"?", _, true, 0.0, true, 1.0);
g_cBlockMeta = CreateConVar("sbp_block_meta", "1", "Block \"meta\"?", _, true, 0.0, true, 1.0);
g_cBlockMeta = CreateConVar("sbp_block_meta", "1", "Block \"meta\"?", _, true, 0.0, true, 1.0);
g_cAllowRootAdmin = CreateConVar("sbp_allow_rootadmin", "1", "Allow root admins to access all commands?", _, true, 0.0, true, 1.0);
g_cAllowRootAdmin = CreateConVar("sbp_allow_rootadmin", "1", "Allow root admins to access all commands?", _, true, 0.0, true, 1.0);
PTaH(PTaH_ConsolePrintPre, Hook, ConsolePrint);
PTaH(PTaH_ConsolePrintPre, Hook, ConsolePrint);
PTaH(PTaH_ExecuteStringCommandPre, Hook, ExecuteStringCommand);
PTaH(PTaH_ExecuteStringCommandPre, Hook, ExecuteStringCommand);
char sDate[18];
char sDate[18];
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
FormatTime(sDate, sizeof(sDate), "%y-%m-%d");
BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate);
BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate);
}
}
public Action ConsolePrint(int iClient, char sMessage[1024])
public Action ConsolePrint(int iClient, char sMessage[1024])
{
{
if (IsClientConnected(iClient))
if (IsClientConnected(iClient))
{
{
if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true))
if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true))
return Plugin_Continue;
return Plugin_Continue;
if(g_cBlockPlugins.BoolValue)
if(g_cBlockPlugins.BoolValue)
{
{
if(sMessage[1] == '"' && (StrContains(sMessage, "\" (") != -1 || (StrContains(sMessage, ".smx\" ") != -1)))
if(sMessage[1] == '"' && (StrContains(sMessage, "\" (") != -1 || (StrContains(sMessage, ".smx\" ") != -1)))
return Plugin_Handled;
return Plugin_Handled;
else if(StrContains(sMessage, "To see more, type \"sm plugins", false) != -1 || StrContains(sMessage, "To see more, type \"sm exts", false) != -1)
else if(StrContains(sMessage, "To see more, type \"sm plugins", false) != -1 || StrContains(sMessage, "To see more, type \"sm exts", false) != -1)
{
{
Copia
Copiato
Copia
Copiato
PrintToConsole(iClient, "
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
PrintToConsole(iClient, "
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
______
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶
GET LOST YOU STEALER¶¶¶
¶¶¶¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶
¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶DONT STEAL MY
¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶
¶PLUGINS
¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶
¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶");
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
CODED BY PEWDIEPIE
¶¶¶¶¶¶¶¶¶¶¶
");
PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶");
PrintToConsole(iClient, " ¶¶¶__
¶¶¶¶¶¶¶¶¶
¶______¶¶______¶¶______¶¶______¶¶¶¶¶
\n \
¶
______
¶¶¶¶¶¶¶¶¶
_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \
¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶");
PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶
______
¶¶¶¶¶¶¶¶¶¶
___¶
¶¶¶¶¶¶¶¶¶¶
_____
¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶
¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶
__________
¶¶¶¶¶¶¶¶¶¶
__________
¶¶¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶_________________________¶¶¶¶¶¶¶¶¶¶
\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶\n
");
PrintToConsole(iClient, "\t\tNo chance\n");
PrintToConsole(iClient, "\t\tNo chance\n");
Copia
Copiato
Copia
Copiato
PrintToChat("\"%L\" tried to get the server plugins but failed :P", iClient);
LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", iClient);
LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", iClient);
return Plugin_Handled;
return Plugin_Handled;
}
}
}
}
}
}
return Plugin_Continue;
return Plugin_Continue;
}
}
public Action ExecuteStringCommand(int iClient, char sCommandString[512])
public Action ExecuteStringCommand(int iClient, char sCommandString[512])
{
{
if (IsClientValid(iClient))
if (IsClientValid(iClient))
{
{
static char sMessage[512];
static char sMessage[512];
strcopy(sMessage, sizeof(sMessage), sCommandString);
strcopy(sMessage, sizeof(sMessage), sCommandString);
TrimString(sMessage);
TrimString(sMessage);
if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true))
if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true))
return Plugin_Continue;
return Plugin_Continue;
if(g_cBlockSM.BoolValue && StrContains(sMessage, "sm ") == 0 || StrEqual(sMessage, "sm", false))
if(g_cBlockSM.BoolValue && StrContains(sMessage, "sm ") == 0 || StrEqual(sMessage, "sm", false))
{
{
return Plugin_Handled;
return Plugin_Handled;
}
}
if(g_cBlockMeta.BoolValue && StrContains(sMessage, "meta ") == 0 || StrEqual(sMessage, "meta", false))
if(g_cBlockMeta.BoolValue && StrContains(sMessage, "meta ") == 0 || StrEqual(sMessage, "meta", false))
{
{
return Plugin_Handled;
return Plugin_Handled;
}
}
}
}
return Plugin_Continue;
return Plugin_Continue;
}
}
bool IsClientValid(int iClient)
bool IsClientValid(int iClient)
{
{
if (iClient > 0 && iClient <= MaxClients)
if (iClient > 0 && iClient <= MaxClients)
{
{
if (IsClientInGame(iClient) && !IsFakeClient(iClient) && !IsClientSourceTV(iClient))
if (IsClientInGame(iClient) && !IsFakeClient(iClient) && !IsClientSourceTV(iClient))
{
{
return true;
return true;
}
}
}
}
return false;
return false;
}
}
Diff salvati
Testo originale
Apri file
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #include <PTaH> #pragma newdecls required #define INTERVAL 3 ConVar g_cBlockPlugins = null; ConVar g_cBlockSM = null; ConVar g_cBlockMeta = null; ConVar g_cAllowRootAdmin = null; char g_sLogs[PLATFORM_MAX_PATH + 1]; public void OnPluginStart() { g_cBlockPlugins = CreateConVar("sbp_block_plugins", "1", "Block \"sm plugins\" and \"sm exts\"?", _, true, 0.0, true, 1.0); g_cBlockSM = CreateConVar("sbp_block_sm", "1", "Block \"sm\"?", _, true, 0.0, true, 1.0); g_cBlockMeta = CreateConVar("sbp_block_meta", "1", "Block \"meta\"?", _, true, 0.0, true, 1.0); g_cAllowRootAdmin = CreateConVar("sbp_allow_rootadmin", "1", "Allow root admins to access all commands?", _, true, 0.0, true, 1.0); PTaH(PTaH_ConsolePrintPre, Hook, ConsolePrint); PTaH(PTaH_ExecuteStringCommandPre, Hook, ExecuteStringCommand); char sDate[18]; FormatTime(sDate, sizeof(sDate), "%y-%m-%d"); BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate); } public Action ConsolePrint(int iClient, char sMessage[1024]) { if (IsClientConnected(iClient)) { if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true)) return Plugin_Continue; if(g_cBlockPlugins.BoolValue) { if(sMessage[1] == '"' && (StrContains(sMessage, "\" (") != -1 || (StrContains(sMessage, ".smx\" ") != -1))) return Plugin_Handled; else if(StrContains(sMessage, "To see more, type \"sm plugins", false) != -1 || StrContains(sMessage, "To see more, type \"sm exts", false) != -1) { PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶"); PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶¶____¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶"); PrintToConsole(iClient, " ¶¶¶__¶¶¶¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶______¶¶¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶______¶¶¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶______¶¶¶¶¶¶¶_____¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶______¶¶¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶_______¶¶¶______¶¶______¶¶______¶¶______¶¶¶¶¶\n \ ¶¶¶¶¶¶_______¶¶¶_____¶¶______¶¶______¶¶¶___¶¶¶¶¶¶¶"); PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶______¶¶¶¶_¶¶¶¶______¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶______¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶¶¶¶¶¶¶_____¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶________¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶¶¶__________¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________________¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n "); PrintToConsole(iClient, "\t\tNo chance\n"); LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", iClient); return Plugin_Handled; } } } return Plugin_Continue; } public Action ExecuteStringCommand(int iClient, char sCommandString[512]) { if (IsClientValid(iClient)) { static char sMessage[512]; strcopy(sMessage, sizeof(sMessage), sCommandString); TrimString(sMessage); if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true)) return Plugin_Continue; if(g_cBlockSM.BoolValue && StrContains(sMessage, "sm ") == 0 || StrEqual(sMessage, "sm", false)) { return Plugin_Handled; } if(g_cBlockMeta.BoolValue && StrContains(sMessage, "meta ") == 0 || StrEqual(sMessage, "meta", false)) { return Plugin_Handled; } } return Plugin_Continue; } bool IsClientValid(int iClient) { if (iClient > 0 && iClient <= MaxClients) { if (IsClientInGame(iClient) && !IsFakeClient(iClient) && !IsClientSourceTV(iClient)) { return true; } } return false; }
Testo modificato
Apri file
#pragma semicolon 1 #include <sourcemod> #include <sdktools> #include <PTaH> #pragma newdecls required #define INTERVAL 3 ConVar g_cBlockPlugins = null; ConVar g_cBlockSM = null; ConVar g_cBlockMeta = null; ConVar g_cAllowRootAdmin = null; char g_sLogs[PLATFORM_MAX_PATH + 1]; public void OnPluginStart() { g_cBlockPlugins = CreateConVar("sbp_block_plugins", "1", "Block \"sm plugins\" and \"sm exts\"?", _, true, 0.0, true, 1.0); g_cBlockSM = CreateConVar("sbp_block_sm", "1", "Block \"sm\"?", _, true, 0.0, true, 1.0); g_cBlockMeta = CreateConVar("sbp_block_meta", "1", "Block \"meta\"?", _, true, 0.0, true, 1.0); g_cAllowRootAdmin = CreateConVar("sbp_allow_rootadmin", "1", "Allow root admins to access all commands?", _, true, 0.0, true, 1.0); PTaH(PTaH_ConsolePrintPre, Hook, ConsolePrint); PTaH(PTaH_ExecuteStringCommandPre, Hook, ExecuteStringCommand); char sDate[18]; FormatTime(sDate, sizeof(sDate), "%y-%m-%d"); BuildPath(Path_SM, g_sLogs, sizeof(g_sLogs), "logs/sbp-%s.log", sDate); } public Action ConsolePrint(int iClient, char sMessage[1024]) { if (IsClientConnected(iClient)) { if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true)) return Plugin_Continue; if(g_cBlockPlugins.BoolValue) { if(sMessage[1] == '"' && (StrContains(sMessage, "\" (") != -1 || (StrContains(sMessage, ".smx\" ") != -1))) return Plugin_Handled; else if(StrContains(sMessage, "To see more, type \"sm plugins", false) != -1 || StrContains(sMessage, "To see more, type \"sm exts", false) != -1) { PrintToConsole(iClient, " ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶GET LOST YOU STEALER¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶DONT STEAL MY¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶PLUGINS¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶\n \ ¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶CODED BY PEWDIEPIE¶¶¶¶¶¶¶¶¶¶¶"); PrintToConsole(iClient, "\t\tNo chance\n"); PrintToChat("\"%L\" tried to get the server plugins but failed :P", iClient); LogToFile(g_sLogs, "\"%L\" tried to get the plugin list", iClient); return Plugin_Handled; } } } return Plugin_Continue; } public Action ExecuteStringCommand(int iClient, char sCommandString[512]) { if (IsClientValid(iClient)) { static char sMessage[512]; strcopy(sMessage, sizeof(sMessage), sCommandString); TrimString(sMessage); if (g_cAllowRootAdmin.BoolValue && CheckCommandAccess(iClient, "sm_admin", ADMFLAG_ROOT, true)) return Plugin_Continue; if(g_cBlockSM.BoolValue && StrContains(sMessage, "sm ") == 0 || StrEqual(sMessage, "sm", false)) { return Plugin_Handled; } if(g_cBlockMeta.BoolValue && StrContains(sMessage, "meta ") == 0 || StrEqual(sMessage, "meta", false)) { return Plugin_Handled; } } return Plugin_Continue; } bool IsClientValid(int iClient) { if (iClient > 0 && iClient <= MaxClients) { if (IsClientInGame(iClient) && !IsFakeClient(iClient) && !IsClientSourceTV(iClient)) { return true; } } return false; }
Trovare la differenza