Skip to content

Commit

Permalink
Release 1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dronelektron committed Jul 7, 2022
2 parents d72d160 + 25416fa commit 4aeb001
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 143 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Allows you to unlock respawn at the end of the round:

### Console Variables

* sm_respawnunlocker_walls - Enable (1) or disable (0) walls removing [default: "1"]
* sm_respawnunlocker_walls - Enable (1) or disable (0) walls disabling [default: "1"]
* sm_respawnunlocker_triggers - Enable (1) or disable (0) triggers disabling [default: "1"]
* sm_respawnunlocker_crates - Enable (1) or disable (0) crates adding [default: "1"]
* sm_respawnunlocker_triggers - Enable (1) or disable (0) triggers removing [default: "1"]
* sm_respawnunlocker_notifications - Enable (1) or disable (0) notifications [default: "1"]
* sm_respawnunlocker_crate_color_red - Crate color (red channel) [default: "0"]
* sm_respawnunlocker_crate_color_green - Crate color (green channel) [default: "255"]
Expand All @@ -28,16 +28,16 @@ Allows you to unlock respawn at the end of the round:

### Console Commands

* sm_respawnunlocker_crates_load - Load crates from the file
* sm_respawnunlocker_crates_save - Save crates to the file
* sm_respawnunlocker_editor_enable - Enable crates editor (will spawn crates)
* sm_respawnunlocker_editor_disable - Disable crates editor (will destroy crates)
* sm_respawnunlocker_editor_crate_add - Add a crate
* sm_respawnunlocker_editor_crate_remove - Remove a crate
* sm_respawnunlocker_crate_add - Add a crate
* sm_respawnunlocker_crate_remove - Remove the crate
* sm_respawnunlocker_crates_show - Show the crates
* sm_respawnunlocker_crates_hide - Hide the crates
* sm_respawnunlocker_crates_load - Load the crates from the file
* sm_respawnunlocker_crates_save - Save the crates to the file
* sm_respawnunlocker_trigger_add - Add a trigger to the list
* sm_respawnunlocker_trigger_remove - Remove a trigger from the list
* sm_respawnunlocker_triggers_load - Load triggers from the file
* sm_respawnunlocker_triggers_save - Save triggers to the file
* sm_respawnunlocker_triggers_load - Load the triggers from the file
* sm_respawnunlocker_triggers_save - Save the triggers to the file

### Crates Storage

Expand Down
8 changes: 4 additions & 4 deletions scripting/include/ru/menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#define CRATES_MANAGEMENT "Crates management"
#define TRIGGERS_MANAGEMENT "Triggers management"

#define ITEM_EDITOR_ENABLE "Enable editor"
#define ITEM_EDITOR_DISABLE "Disable editor"
#define ITEM_EDITOR_CRATE_ADD "Add crate"
#define ITEM_EDITOR_CRATE_REMOVE "Remove crate"
#define ITEM_CRATE_ADD "Add crate"
#define ITEM_CRATE_REMOVE "Remove crate"
#define ITEM_CRATES_SHOW "Show crates"
#define ITEM_CRATES_HIDE "Hide crates"
#define ITEM_CRATES_LOAD "Load crates"
#define ITEM_CRATES_SAVE "Save crates"

Expand Down
32 changes: 16 additions & 16 deletions scripting/modules/console-command.sp
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
void Command_Create() {
RegAdminCmd("sm_respawnunlocker_crate_add", Command_AddCrate, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_crate_remove", Command_RemoveCrate, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_crates_show", Command_ShowCrates, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_crates_hide", Command_HideCrates, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_crates_load", Command_LoadCrates, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_crates_save", Command_SaveCrates, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_editor_enable", Command_EnableEditor, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_editor_disable", Command_DisableEditor, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_editor_crate_add", Command_AddCrate, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_editor_crate_remove", Command_RemoveCrate, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_trigger_add", Command_AddTriggerToList, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_trigger_remove", Command_RemoveTriggerFromList, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_triggers_load", Command_LoadTriggers, ADMFLAG_GENERIC);
RegAdminCmd("sm_respawnunlocker_triggers_save", Command_SaveTriggers, ADMFLAG_GENERIC);
}

public Action Command_LoadCrates(int client, int args) {
UseCase_LoadCrates(client);
public Action Command_AddCrate(int client, int args) {
UseCase_AddCrate(client);

return Plugin_Handled;
}

public Action Command_SaveCrates(int client, int args) {
UseCase_SaveCrates(client);
public Action Command_RemoveCrate(int client, int args) {
UseCase_RemoveCrate(client);

return Plugin_Handled;
}

public Action Command_EnableEditor(int client, int args) {
UseCase_EnableEditor(client);
public Action Command_ShowCrates(int client, int args) {
UseCase_ShowCrates(client);

return Plugin_Handled;
}

public Action Command_DisableEditor(int client, int args) {
UseCase_DisableEditor(client);
public Action Command_HideCrates(int client, int args) {
UseCase_HideCrates(client);

return Plugin_Handled;
}

public Action Command_AddCrate(int client, int args) {
UseCase_AddCrate(client);
public Action Command_LoadCrates(int client, int args) {
UseCase_LoadCrates(client);

return Plugin_Handled;
}

public Action Command_RemoveCrate(int client, int args) {
UseCase_RemoveCrate(client);
public Action Command_SaveCrates(int client, int args) {
UseCase_SaveCrates(client);

return Plugin_Handled;
}
Expand Down
14 changes: 7 additions & 7 deletions scripting/modules/console-variable.sp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
static ConVar g_wallsEnabled = null;
static ConVar g_cratesEnabled = null;
static ConVar g_triggersEnabled = null;
static ConVar g_cratesEnabled = null;
static ConVar g_notificationsEnabled = null;
static ConVar g_crateColorRed = null;
static ConVar g_crateColorGreen = null;
static ConVar g_crateColorBlue = null;
static ConVar g_crateColorAlpha = null;

void Variable_Create() {
g_wallsEnabled = CreateConVar("sm_respawnunlocker_walls", "1", "Enable (1) or disable (0) walls removing");
g_wallsEnabled = CreateConVar("sm_respawnunlocker_walls", "1", "Enable (1) or disable (0) walls disabling");
g_triggersEnabled = CreateConVar("sm_respawnunlocker_triggers", "1", "Enable (1) or disable (0) triggers disabling");
g_cratesEnabled = CreateConVar("sm_respawnunlocker_crates", "1", "Enable (1) or disable (0) crates adding");
g_triggersEnabled = CreateConVar("sm_respawnunlocker_triggers", "1", "Enable (1) or disable (0) triggers removing");
g_notificationsEnabled = CreateConVar("sm_respawnunlocker_notifications", "1", "Enable (1) or disable (0) notifications");
g_crateColorRed = CreateConVar("sm_respawnunlocker_crate_color_red", "0", "Crate color (red channel)");
g_crateColorGreen = CreateConVar("sm_respawnunlocker_crate_color_green", "255", "Crate color (green channel)");
Expand All @@ -22,14 +22,14 @@ bool Variable_IsWallsEnabled() {
return g_wallsEnabled.IntValue == 1;
}

bool Variable_IsCratesEnabled() {
return g_cratesEnabled.IntValue == 1;
}

bool Variable_IsTriggersEnabled() {
return g_triggersEnabled.IntValue == 1;
}

bool Variable_IsCratesEnabled() {
return g_cratesEnabled.IntValue == 1;
}

bool Variable_IsNotificationsEnabled() {
return g_notificationsEnabled.IntValue == 1;
}
Expand Down
2 changes: 1 addition & 1 deletion scripting/modules/crate-editor.sp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void CrateEditor_DestroyCrates() {
RemoveEntity(crate);
}

g_editorCrateEntities.Clear();
CrateEditor_Clear();
}

void CrateEditor_AddCrate(int client) {
Expand Down
20 changes: 10 additions & 10 deletions scripting/modules/menu.sp
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ void Menu_CratesManagement(int client) {

menu.SetTitle("%T", CRATES_MANAGEMENT, client);

Menu_AddItem(menu, ITEM_EDITOR_ENABLE, client);
Menu_AddItem(menu, ITEM_EDITOR_DISABLE, client);
Menu_AddItem(menu, ITEM_EDITOR_CRATE_ADD, client);
Menu_AddItem(menu, ITEM_EDITOR_CRATE_REMOVE, client);
Menu_AddItem(menu, ITEM_CRATE_ADD, client);
Menu_AddItem(menu, ITEM_CRATE_REMOVE, client);
Menu_AddItem(menu, ITEM_CRATES_SHOW, client);
Menu_AddItem(menu, ITEM_CRATES_HIDE, client);
Menu_AddItem(menu, ITEM_CRATES_LOAD, client);
Menu_AddItem(menu, ITEM_CRATES_SAVE, client);

Expand All @@ -85,14 +85,14 @@ public int MenuHandler_CratesManagement(Menu menu, MenuAction action, int param1

menu.GetItem(param2, info, sizeof(info));

if (StrEqual(info, ITEM_EDITOR_ENABLE)) {
UseCase_EnableEditor(param1);
} else if (StrEqual(info, ITEM_EDITOR_DISABLE)) {
UseCase_DisableEditor(param1);
} else if (StrEqual(info, ITEM_EDITOR_CRATE_ADD)) {
if (StrEqual(info, ITEM_CRATE_ADD)) {
UseCase_AddCrate(param1);
} else if (StrEqual(info, ITEM_EDITOR_CRATE_REMOVE)) {
} else if (StrEqual(info, ITEM_CRATE_REMOVE)) {
UseCase_RemoveCrate(param1);
} else if (StrEqual(info, ITEM_CRATES_SHOW)) {
UseCase_ShowCrates(param1);
} else if (StrEqual(info, ITEM_CRATES_HIDE)) {
UseCase_HideCrates(param1);
} else if (StrEqual(info, ITEM_CRATES_LOAD)) {
UseCase_LoadCrates(param1);
} else if (StrEqual(info, ITEM_CRATES_SAVE)) {
Expand Down
12 changes: 6 additions & 6 deletions scripting/modules/message.sp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ void Message_TriggersSaved(int client) {
LogMessage("\"%L\" saved %d triggers", client, triggersAmount);
}

void Message_EditorEnabled(int client) {
ShowActivity2(client, PREFIX, "%t", "Crates editor enabled");
LogMessage("\"%L\" enabled crates editor", client);
void Message_CratesShown(int client) {
ShowActivity2(client, PREFIX, "%t", "Crates shown");
LogMessage("\"%L\" showed crates", client);
}

void Message_EditorDisabled(int client) {
ShowActivity2(client, PREFIX, "%t", "Crates editor disabled");
LogMessage("\"%L\" disabled crates editor", client);
void Message_CratesHidden(int client) {
ShowActivity2(client, PREFIX, "%t", "Crates hidden");
LogMessage("\"%L\" hid crates", client);
}

void Message_CrateAdded(int client) {
Expand Down
34 changes: 17 additions & 17 deletions scripting/modules/use-case.sp
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,35 @@ void UseCase_AddCrates() {
}
}

void UseCase_LoadCrates(int client) {
Storage_ApplyToKeyValues(Storage_LoadCrates);
Message_CratesLoaded(client);
void UseCase_AddCrate(int client) {
CrateEditor_AddCrate(client);
Message_CrateAdded(client);
}

void UseCase_SaveCrates(int client) {
Storage_ApplyToKeyValues(Storage_SaveCrates);
Message_CratesSaved(client);
void UseCase_RemoveCrate(int client) {
if (CrateEditor_RemoveCrate(client)) {
Message_CrateRemoved(client);
}
}

void UseCase_EnableEditor(int client) {
void UseCase_ShowCrates(int client) {
CrateEditor_SpawnCrates();
Message_EditorEnabled(client);
Message_CratesShown(client);
}

void UseCase_DisableEditor(int client) {
void UseCase_HideCrates(int client) {
CrateEditor_DestroyCrates();
Message_EditorDisabled(client);
Message_CratesHidden(client);
}

void UseCase_AddCrate(int client) {
CrateEditor_AddCrate(client);
Message_CrateAdded(client);
void UseCase_LoadCrates(int client) {
Storage_ApplyToKeyValues(Storage_LoadCrates);
Message_CratesLoaded(client);
}

void UseCase_RemoveCrate(int client) {
if (CrateEditor_RemoveCrate(client)) {
Message_CrateRemoved(client);
}
void UseCase_SaveCrates(int client) {
Storage_ApplyToKeyValues(Storage_SaveCrates);
Message_CratesSaved(client);
}

void UseCase_AddTriggerToList(int client) {
Expand Down
2 changes: 1 addition & 1 deletion scripting/respawn-unlocker.sp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Plugin myinfo = {
name = "Respawn unlocker",
author = "Dron-elektron",
description = "Allows you to unlock respawn at the end of the round",
version = "1.6.1",
version = "1.6.2",
url = "https://github.com/dronelektron/respawn-unlocker"
};

Expand Down
Loading

0 comments on commit 4aeb001

Please sign in to comment.