diff --git a/_entWatch4/dump.txt b/_entWatch4/dump.txt deleted file mode 100644 index c73df200..00000000 --- a/_entWatch4/dump.txt +++ /dev/null @@ -1,41 +0,0 @@ - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ - if ((g_hGameConf = LoadGameConfigFile("entWatch.games")) == INVALID_HANDLE) - SetFailState("Couldn't load \"entWatch.games\" game config!"); - - ... -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast) -{ - g_fRestartTime = 0.0; -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnRoundEnding(Event hEvent, const char[] sEvent, bool bDontBroadcast) -{ - g_fRestartTime = view_as(LoadFromAddress(GetGameRulesAddress() + view_as
(GameConfGetOffset(g_hGameConf, "RoundRestartTime")), NumberType_Int32)); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnGameFrame() -{ - if (g_fRestartTime && g_fRestartTime <= GetGameTime()) - { - if (g_hArray_Items.Length) - g_hArray_Items.Clear(); - - g_fRestartTime = 0.0; - } -} \ No newline at end of file diff --git a/_entWatch4/scripting/CConfig.inc b/_entWatch4/scripting/classes/CConfig.inc similarity index 100% rename from _entWatch4/scripting/CConfig.inc rename to _entWatch4/scripting/classes/CConfig.inc diff --git a/_entWatch4/scripting/CItem.inc b/_entWatch4/scripting/classes/CItem.inc similarity index 100% rename from _entWatch4/scripting/CItem.inc rename to _entWatch4/scripting/classes/CItem.inc diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index fbc15771..3ba778c3 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -12,16 +12,7 @@ #include #include #include -#include - -/* CLASSES */ -#include "CConfig.inc" -#include "CItem.inc" - -/* REGISTERTYPES */ -#define REGISTERTYPE_WEAPON 1 -#define REGISTERTYPE_BUTTON 2 -#define REGISTERTYPE_TRIGGER 3 +#include /* BOOLS */ bool g_bLate; @@ -221,31 +212,31 @@ public void OnEntitySpawned(int entity) if (config.iWeaponID && config.iWeaponID == Entity_GetHammerId(entity)) { - if (!RegisterExistingItem(entity, REGISTERTYPE_WEAPON)) + if (!RegisterExistingItem(entity, REGISTER_WEAPON)) { CItem item = new CItem(config); - if (RegisterItemEntity(item, entity, REGISTERTYPE_WEAPON)) + if (RegisterItemEntity(item, entity, REGISTER_WEAPON)) g_hArray_Items.Push(item); } } else if (config.iButtonID && config.iButtonID == Entity_GetHammerId(entity)) { - if (!RegisterExistingItem(entity, REGISTERTYPE_BUTTON)) + if (!RegisterExistingItem(entity, REGISTER_BUTTON)) { CItem item = new CItem(config); - if (RegisterItemEntity(item, entity, REGISTERTYPE_BUTTON)) + if (RegisterItemEntity(item, entity, REGISTER_BUTTON)) g_hArray_Items.Push(item); } } else if (config.iTriggerID && config.iTriggerID == Entity_GetHammerId(entity)) { - if (!RegisterExistingItem(entity, REGISTERTYPE_TRIGGER)) + if (!RegisterExistingItem(entity, REGISTER_TRIGGER)) { CItem item = new CItem(config); - if (RegisterItemEntity(item, entity, REGISTERTYPE_TRIGGER)) + if (RegisterItemEntity(item, entity, REGISTER_TRIGGER)) g_hArray_Items.Push(item); } } @@ -281,7 +272,7 @@ stock bool RegisterItemEntity(CItem item, int entity, int type) { switch(type) { - case REGISTERTYPE_WEAPON: + case REGISTER_WEAPON: { if (!item.bWeapon && (Entity_GetOwner(entity) == INVALID_ENT_REFERENCE)) { @@ -290,7 +281,7 @@ stock bool RegisterItemEntity(CItem item, int entity, int type) return true; } } - case REGISTERTYPE_BUTTON: + case REGISTER_BUTTON: { if (!item.bButton && (Entity_GetParent(entity) == INVALID_ENT_REFERENCE || (item.bWeapon && Entity_GetParent(entity) == item.iWeapon))) { @@ -301,7 +292,7 @@ stock bool RegisterItemEntity(CItem item, int entity, int type) return true; } } - case REGISTERTYPE_TRIGGER: + case REGISTER_TRIGGER: { if (!item.bTrigger && (Entity_GetParent(entity) == INVALID_ENT_REFERENCE || (item.bWeapon && Entity_GetParent(entity) == item.iWeapon))) { @@ -499,7 +490,7 @@ public Action OnButtonPress(int button, int client) { switch(item.dConfig.iMode) { - case 1: + case MODE_COOLDOWN: { if (item.iTimeReady < RoundToCeil(GetEngineTime())) { @@ -507,7 +498,7 @@ public Action OnButtonPress(int button, int client) } else return Plugin_Handled; } - case 2: + case MODE_MAXUSES: { if (item.iTimesUsed < item.dConfig.iMaxUses) { @@ -515,7 +506,7 @@ public Action OnButtonPress(int button, int client) } else return Plugin_Handled; } - case 3: + case MODE_COOLDOWNMAXUSES: { if (item.iTimeReady < RoundToCeil(GetEngineTime()) && item.iTimesUsed < item.dConfig.iMaxUses) { @@ -524,7 +515,7 @@ public Action OnButtonPress(int button, int client) } else return Plugin_Handled; } - case 4: + case MODE_COOLDOWNCHARGES: { if (item.iTimeReady < RoundToCeil(GetEngineTime())) { diff --git a/_entWatch4/scripting/entWatch-dev.sp b/_entWatch4/scripting/entWatch-dev.sp deleted file mode 100644 index 720ae9a9..00000000 --- a/_entWatch4/scripting/entWatch-dev.sp +++ /dev/null @@ -1,86 +0,0 @@ -//==================================================================================================== -// -// Name: [entWatch] Dev -// Author: Prometheum & zaCade -// Description: Handle the dev aspect of [entWatch] -// -//==================================================================================================== -#include - -#pragma newdecls required - -#include -#include -#include - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Plugin myinfo = -{ - name = "[entWatch] Dev", - author = "Prometheum & zaCade", - description = "Handle the dev aspect of [entWatch]", - version = "4.0.0" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDrop(int client, int index) -{ - PrintToChatAll("Drop: %d - %d", client, index); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDeath(int client, int index) -{ - PrintToChatAll("Death: %d - %d", client, index); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemPickup(int client, int index) -{ - PrintToChatAll("Pickup: %d - %d", client, index); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDisconnect(int client, int index) -{ - PrintToChatAll("Disconnect: %d - %d", client, index); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemActivate(int client, int index) -{ - PrintToChatAll("Activate: %d - %d", client, index); -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientRestricted(int client, int target, int length) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientUnrestricted(int client, int target) -{ -} \ No newline at end of file diff --git a/_entWatch4/scripting/entWatch-glows.sp b/_entWatch4/scripting/entWatch-glows.sp deleted file mode 100644 index 1be50545..00000000 --- a/_entWatch4/scripting/entWatch-glows.sp +++ /dev/null @@ -1,31 +0,0 @@ -//==================================================================================================== -// -// Name: [entWatch] Beacons -// Author: zaCade & Prometheum -// Description: Handle the beacons of [entWatch] -// -//==================================================================================================== -#include - -#pragma newdecls required - -#include -#include - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Plugin myinfo = -{ - name = "[entWatch] Beacons", - author = "zaCade & Prometheum", - description = "Handle the beacons of [entWatch]", - version = "4.0.0" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ -} \ No newline at end of file diff --git a/_entWatch4/scripting/temp/entWatch-interface.sp b/_entWatch4/scripting/entWatch-interface.sp similarity index 97% rename from _entWatch4/scripting/temp/entWatch-interface.sp rename to _entWatch4/scripting/entWatch-interface.sp index 453c6553..8f828134 100644 --- a/_entWatch4/scripting/temp/entWatch-interface.sp +++ b/_entWatch4/scripting/entWatch-interface.sp @@ -44,7 +44,7 @@ public void OnGameFrame() { switch(itemArray[item_mode]) { - case 1: + case MODE_COOLDOWN: { if (itemArray[item_nextuse] > RoundToCeil(GetEngineTime())) { @@ -55,7 +55,7 @@ public void OnGameFrame() Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "R", itemArray[item_owner]); } } - case 2: + case MODE_MAXUSES: { if (itemArray[item_uses] < itemArray[item_maxuses]) { @@ -66,7 +66,7 @@ public void OnGameFrame() Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "D", itemArray[item_owner]); } } - case 3: + case MODE_COOLDOWNMAXUSES: { if (itemArray[item_uses] < itemArray[item_maxuses]) { @@ -84,7 +84,7 @@ public void OnGameFrame() Format(sHUDBuffer, sizeof(sHUDBuffer), "%s [%s]: %N", itemArray[item_short], "D", itemArray[item_owner]); } } - case 4: + case MODE_COOLDOWNCHARGES: { if (itemArray[item_nextuse] > RoundToCeil(GetEngineTime())) { diff --git a/_entWatch4/scripting/entWatch-logs.sp b/_entWatch4/scripting/entWatch-logs.sp deleted file mode 100644 index 64b33971..00000000 --- a/_entWatch4/scripting/entWatch-logs.sp +++ /dev/null @@ -1,81 +0,0 @@ -//==================================================================================================== -// -// Name: [entWatch] Logs -// Author: Prometheum & zaCade -// Description: Handle the logs of [entWatch] -// -//==================================================================================================== -#include - -#pragma newdecls required - -#include -#include -#include - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Plugin myinfo = -{ - name = "[entWatch] Logs", - author = "Prometheum & zaCade", - description = "Handle the logs of [entWatch]", - version = "4.0.0" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDrop(int client, int index) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDeath(int client, int index) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemPickup(int client, int index) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemDisconnect(int client, int index) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientItemActivate(int client, int index) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientRestricted(int client, int target, int length) -{ -} - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void EW_OnClientUnrestricted(int client, int target) -{ -} \ No newline at end of file diff --git a/_entWatch4/scripting/temp/entWatch-messages.sp b/_entWatch4/scripting/entWatch-messages.sp similarity index 100% rename from _entWatch4/scripting/temp/entWatch-messages.sp rename to _entWatch4/scripting/entWatch-messages.sp diff --git a/_entWatch4/scripting/entWatch-tools.sp b/_entWatch4/scripting/entWatch-tools.sp deleted file mode 100644 index 68781deb..00000000 --- a/_entWatch4/scripting/entWatch-tools.sp +++ /dev/null @@ -1,31 +0,0 @@ -//==================================================================================================== -// -// Name: [entWatch] Tools -// Author: zaCade & Prometheum -// Description: Handle the tools of [entWatch] -// -//==================================================================================================== -#include - -#pragma newdecls required - -#include -#include - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public Plugin myinfo = -{ - name = "[entWatch] Tools", - author = "zaCade & Prometheum", - description = "Handle the tools of [entWatch]", - version = "4.0.0" -}; - -//---------------------------------------------------------------------------------------------------- -// Purpose: -//---------------------------------------------------------------------------------------------------- -public void OnPluginStart() -{ -} \ No newline at end of file diff --git a/_entWatch4/scripting/include/entWatch_core.inc b/_entWatch4/scripting/include/entWatch_core.inc index 2f6195c4..75d14d78 100644 --- a/_entWatch4/scripting/include/entWatch_core.inc +++ b/_entWatch4/scripting/include/entWatch_core.inc @@ -4,6 +4,22 @@ #define entWatch_core_included +/* REGISTERS */ +#define REGISTER_WEAPON 1 +#define REGISTER_BUTTON 2 +#define REGISTER_TRIGGER 3 + +/* MODES */ +#define MODE_COOLDOWN 1 +#define MODE_MAXUSES 2 +#define MODE_COOLDOWNMAXUSES 3 +#define MODE_COOLDOWNCHARGES 4 + +/* CLASSES */ +#include +#include "../classes/CConfig.inc" +#include "../classes/CItem.inc" + public SharedPlugin __pl_entWatch_core = { name = "entWatch-core",