entWatch4: Update, Delete and Yeah

This commit is contained in:
zaCade 2019-03-28 15:34:18 +01:00
parent 12ee8ff048
commit 0a3adc0f5f
11 changed files with 34 additions and 297 deletions

View File

@ -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<float>(LoadFromAddress(GetGameRulesAddress() + view_as<Address>(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;
}
}

View File

@ -12,16 +12,7 @@
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <basic>
/* CLASSES */
#include "CConfig.inc"
#include "CItem.inc"
/* REGISTERTYPES */
#define REGISTERTYPE_WEAPON 1
#define REGISTERTYPE_BUTTON 2
#define REGISTERTYPE_TRIGGER 3
#include <entWatch_core>
/* 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()))
{

View File

@ -1,86 +0,0 @@
//====================================================================================================
//
// Name: [entWatch] Dev
// Author: Prometheum & zaCade
// Description: Handle the dev aspect of [entWatch]
//
//====================================================================================================
#include <smlib>
#pragma newdecls required
#include <sourcemod>
#include <entWatch_core>
#include <entWatch_restrictions>
//----------------------------------------------------------------------------------------------------
// 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)
{
}

View File

@ -1,31 +0,0 @@
//====================================================================================================
//
// Name: [entWatch] Beacons
// Author: zaCade & Prometheum
// Description: Handle the beacons of [entWatch]
//
//====================================================================================================
#include <smlib>
#pragma newdecls required
#include <sourcemod>
#include <entWatch_core>
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Plugin myinfo =
{
name = "[entWatch] Beacons",
author = "zaCade & Prometheum",
description = "Handle the beacons of [entWatch]",
version = "4.0.0"
};
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnPluginStart()
{
}

View File

@ -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()))
{

View File

@ -1,81 +0,0 @@
//====================================================================================================
//
// Name: [entWatch] Logs
// Author: Prometheum & zaCade
// Description: Handle the logs of [entWatch]
//
//====================================================================================================
#include <smlib>
#pragma newdecls required
#include <sourcemod>
#include <entWatch_core>
#include <entWatch_restrictions>
//----------------------------------------------------------------------------------------------------
// 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)
{
}

View File

@ -1,31 +0,0 @@
//====================================================================================================
//
// Name: [entWatch] Tools
// Author: zaCade & Prometheum
// Description: Handle the tools of [entWatch]
//
//====================================================================================================
#include <smlib>
#pragma newdecls required
#include <sourcemod>
#include <entWatch_core>
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public Plugin myinfo =
{
name = "[entWatch] Tools",
author = "zaCade & Prometheum",
description = "Handle the tools of [entWatch]",
version = "4.0.0"
};
//----------------------------------------------------------------------------------------------------
// Purpose:
//----------------------------------------------------------------------------------------------------
public void OnPluginStart()
{
}

View File

@ -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 <basic>
#include "../classes/CConfig.inc"
#include "../classes/CItem.inc"
public SharedPlugin __pl_entWatch_core =
{
name = "entWatch-core",