Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
added cvar to enable/disable remove protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Riccardo H committed Jul 30, 2019
1 parent ae632a2 commit 83c01b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 2 additions & 0 deletions addons/sourcemod/scripting/surftimer/convars.sp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ ConVar g_hSlayOnRoundEnd = null;
ConVar g_hLimitSpeedType = null;
ConVar g_dcCalladminName = null;
ConVar g_dcBugTrackerName = null;
ConVar g_drDeleteSecurity = null;

void CreateConVars()
{
Expand Down Expand Up @@ -161,6 +162,7 @@ void CreateConVars()
g_hTeleToStartWhenSettingsLoaded = CreateConVar("ck_teleportclientstostart", "1", "(1 / 0) Teleport players automatically back to the start zone, when their settings have been loaded.", FCVAR_NOTIFY, true, 0.0, true, 1.0);
g_dcCalladminName = CreateConVar("ck_discord_calladmin_name", "z4lab Calladmin", "Webhook name for !calladmin - Discord side", FCVAR_NOTIFY);
g_dcBugTrackerName = CreateConVar("ck_discord_bug_tracker_name", "z4lab Bugtracker", "Webhook name for !bug - Discord side", FCVAR_NOTIFY);
g_drDeleteSecurity = CreateConVar("ck_dr_delete_security", "1", "(1 / 0) Disabled/Enable delete security for !dr command", FCVAR_NOTIFY, true, 0.0, true, 1.0);

g_hPointSystem = CreateConVar("ck_point_system", "1", "on/off - Player point system", FCVAR_NOTIFY, true, 0.0, true, 1.0);
HookConVarChange(g_hPointSystem, OnSettingChanged);
Expand Down
24 changes: 15 additions & 9 deletions addons/sourcemod/scripting/surftimer/sql.sp
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,21 @@ public int callback_DeleteRecord(Menu menu, MenuAction action, int client, int k
char recordsBreak[3][32];
ExplodeString(menuItem, ";;;", recordsBreak, sizeof(recordsBreak), sizeof(recordsBreak[]));

Menu confirm = new Menu(callback_Confirm);
confirm.SetTitle("%s Records Editing Menu - Confirm Deletion\n► Deleting %s [%s] %s record\n ", g_szMenuPrefix, recordsBreak[0], recordsBreak[1], recordsBreak[2]);

confirm.AddItem("0", "No");
confirm.AddItem(recordsBreak[1], "Yes\n \n► This cannot be undone");

confirm.Display(client, MENU_TIME_FOREVER);

return 0;
if(GetConVarBool(g_drDeleteSecurity)) {
Menu confirm = new Menu(callback_Confirm);

confirm.SetTitle("%s Records Editing Menu - Confirm Deletion\n► Deleting %s [%s] %s record\n ", g_szMenuPrefix, recordsBreak[0], recordsBreak[1], recordsBreak[2]);

confirm.AddItem("0", "No");
confirm.AddItem(recordsBreak[1], "Yes\n \n► This cannot be undone");

confirm.Display(client, MENU_TIME_FOREVER);

return 0;
} else {
Menu confirm = new Menu(callback_Confirm);
callback_Confirm(confirm, MenuAction_Select, client, 1);
}
}
else if (action == MenuAction_Cancel)
{
Expand Down

0 comments on commit 83c01b3

Please sign in to comment.