diff --git a/_CallAdmin/scripting/CallAdmin.sp b/CallAdmin/scripting/CallAdmin.sp similarity index 99% rename from _CallAdmin/scripting/CallAdmin.sp rename to CallAdmin/scripting/CallAdmin.sp index cfe000ca..a43e89ca 100644 --- a/_CallAdmin/scripting/CallAdmin.sp +++ b/CallAdmin/scripting/CallAdmin.sp @@ -348,7 +348,7 @@ public void OnPluginStart() g_hConfirmCall = AutoExecConfig_CreateConVar("sm_calladmin_confirm_call", "1", "Whether or not a call must be confirmed by the client", FCVAR_NONE, true, 0.0, true, 1.0); g_hSpamTime = AutoExecConfig_CreateConVar("sm_calladmin_spamtime", "25", "An user must wait this many seconds after a report before he can issue a new one", FCVAR_NONE, true, 0.0); g_hReportTime = AutoExecConfig_CreateConVar("sm_calladmin_reporttime", "300", "An user cannot be reported again for this many seconds", FCVAR_NONE, true, 0.0); - g_hAdminAction = AutoExecConfig_CreateConVar("sm_calladmin_admin_action", "1", "What happens when admins are in-game on report: 0 - Do nothing, let the report pass, 1 - Block the report and notify the caller and admins in-game about it", FCVAR_NONE, true, 0.0, true, 1.0); + g_hAdminAction = AutoExecConfig_CreateConVar("sm_calladmin_admin_action", "0", "What happens when admins are in-game on report: 0 - Do nothing, let the report pass, 1 - Block the report and notify the caller and admins in-game about it", FCVAR_NONE, true, 0.0, true, 1.0); diff --git a/CallAdmin/scripting/CallAdminRestrictions.sp b/CallAdmin/scripting/CallAdminRestrictions.sp new file mode 100644 index 00000000..3c4d9d8f --- /dev/null +++ b/CallAdmin/scripting/CallAdminRestrictions.sp @@ -0,0 +1,77 @@ +#include +#include +#include +#include +#include + +#pragma semicolon 1 +#pragma newdecls required + +int g_iAdminAFKTime; +ConVar g_cvAdminAFKTime; + +public Plugin myinfo = +{ + name = "CallAdmin Restrictions", + author = "Neon + Dogan", + description = "", + version = "2.0", + url = "https://steamcommunity.com/id/n3ontm" +}; + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public void OnAllPluginsLoaded() +{ + if((g_cvAdminAFKTime = FindConVar("sm_admin_afk_time")) == INVALID_HANDLE) + SetFailState("Failed to find sm_admin_afk_time cvar."); + else + g_iAdminAFKTime = g_cvAdminAFKTime.IntValue; + + HookConVarChange(g_cvAdminAFKTime, OnAdminAFKTimeChanged); +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public void OnAdminAFKTimeChanged(ConVar convar, const char[] oldValue, const char[] newValue) +{ + g_iAdminAFKTime = g_cvAdminAFKTime.IntValue; +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public Action CallAdmin_OnDrawTarget(int client, int target) +{ + if (CheckCommandAccess(target, "", ADMFLAG_GENERIC, true)) + return Plugin_Handled; + else + return Plugin_Continue; +} + +//---------------------------------------------------------------------------------------------------- +// Purpose: +//---------------------------------------------------------------------------------------------------- +public Action CallAdmin_OnReportPre(int client, int target, const char[] reason) +{ + bool ActiveAdmins = false; + + for (int i = 1; i <= MaxClients; i++) + { + if (IsClientInGame(i) && (CheckCommandAccess(i, "", ADMFLAG_GENERIC, true)) && GetClientIdleTime(i) < g_iAdminAFKTime) + { + ActiveAdmins = true; + CPrintToChat(i, "{green}[CALLADMIN] {lightgreen}%N reported %N for %s.", client, target, reason); + } + } + + if(ActiveAdmins) + { + CPrintToChat(client, "{green}[CALLADMIN] {lightgreen}Reported %N for %s.", target, client); + return Plugin_Handled; + } + else + return Plugin_Continue; +} \ No newline at end of file diff --git a/_CallAdmin/scripting/CallAdminUsermanager.sp b/CallAdmin/scripting/CallAdminUsermanager.sp similarity index 100% rename from _CallAdmin/scripting/CallAdminUsermanager.sp rename to CallAdmin/scripting/CallAdminUsermanager.sp diff --git a/_CallAdmin/scripting/include/autoexecconfig.inc b/CallAdmin/scripting/include/autoexecconfig.inc similarity index 100% rename from _CallAdmin/scripting/include/autoexecconfig.inc rename to CallAdmin/scripting/include/autoexecconfig.inc diff --git a/_CallAdmin/scripting/include/calladmin.inc b/CallAdmin/scripting/include/calladmin.inc similarity index 100% rename from _CallAdmin/scripting/include/calladmin.inc rename to CallAdmin/scripting/include/calladmin.inc diff --git a/_CallAdmin/scripting/include/calladmin_stocks.inc b/CallAdmin/scripting/include/calladmin_stocks.inc similarity index 100% rename from _CallAdmin/scripting/include/calladmin_stocks.inc rename to CallAdmin/scripting/include/calladmin_stocks.inc diff --git a/_CallAdmin/scripting/include/calladmin_usermanager.inc b/CallAdmin/scripting/include/calladmin_usermanager.inc similarity index 100% rename from _CallAdmin/scripting/include/calladmin_usermanager.inc rename to CallAdmin/scripting/include/calladmin_usermanager.inc diff --git a/_CallAdmin/scripting/translations/calladmin.phrases.txt b/CallAdmin/scripting/translations/calladmin.phrases.txt similarity index 100% rename from _CallAdmin/scripting/translations/calladmin.phrases.txt rename to CallAdmin/scripting/translations/calladmin.phrases.txt diff --git a/_CallAdmin/scripting/translations/calladmin_usermanager.phrases.txt b/CallAdmin/scripting/translations/calladmin_usermanager.phrases.txt similarity index 100% rename from _CallAdmin/scripting/translations/calladmin_usermanager.phrases.txt rename to CallAdmin/scripting/translations/calladmin_usermanager.phrases.txt diff --git a/_CallAdmin/scripting/CallAdminRestrictions.sp b/_CallAdmin/scripting/CallAdminRestrictions.sp deleted file mode 100644 index a00dc35f..00000000 --- a/_CallAdmin/scripting/CallAdminRestrictions.sp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include - -#pragma semicolon 1 -#pragma newdecls required - -public Plugin myinfo = -{ - name = "CallAdmin Restrictions", - author = "Neon", - description = "", - version = "1.0", - url = "https://steamcommunity.com/id/n3ontm" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Action CallAdmin_OnDrawTarget(int client, int target) -{ - if (CheckCommandAccess(target, "", ADMFLAG_GENERIC, true)) - return Plugin_Handled; - else - return Plugin_Continue; -} \ No newline at end of file diff --git a/includes/autoexecconfig.inc b/includes/autoexecconfig.inc new file mode 100644 index 00000000..1b7ed3aa --- /dev/null +++ b/includes/autoexecconfig.inc @@ -0,0 +1 @@ +../CallAdmin/scripting/include/autoexecconfig.inc \ No newline at end of file diff --git a/includes/calladmin.inc b/includes/calladmin.inc new file mode 100644 index 00000000..3094cc9b --- /dev/null +++ b/includes/calladmin.inc @@ -0,0 +1 @@ +../CallAdmin/scripting/include/calladmin.inc \ No newline at end of file diff --git a/includes/calladmin_stocks.inc b/includes/calladmin_stocks.inc new file mode 100644 index 00000000..c97bc8b0 --- /dev/null +++ b/includes/calladmin_stocks.inc @@ -0,0 +1 @@ +../CallAdmin/scripting/include/calladmin_stocks.inc \ No newline at end of file diff --git a/includes/calladmin_usermanager.inc b/includes/calladmin_usermanager.inc new file mode 100644 index 00000000..34c6a21a --- /dev/null +++ b/includes/calladmin_usermanager.inc @@ -0,0 +1 @@ +../CallAdmin/scripting/include/calladmin_usermanager.inc \ No newline at end of file