forked from UNLOZE/sm-plugins
Spring break cleanup.
Cleaning up all useless tabs, spaces, indents, you name it.
This commit is contained in:
@@ -18,11 +18,11 @@ ConVar g_cCD;
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Plugin myinfo =
|
||||
{
|
||||
name = "Trigger Rewards",
|
||||
author = "Neon",
|
||||
name = "Trigger Rewards",
|
||||
author = "Neon",
|
||||
description = "HLSTATS Trigger Rewards",
|
||||
version = "1.0",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
version = "1.0",
|
||||
url = "https://steamcommunity.com/id/n3ontm"
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -30,12 +30,12 @@ public Plugin myinfo =
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnPluginStart()
|
||||
{
|
||||
g_cCD = CreateConVar("sm_trigger_reward_cd", "10.0", "Cooldown between HLSTATS Trigger rewards", 0, true, 0.1);
|
||||
AutoExecConfig(true, "plugin.TriggerRewards");
|
||||
|
||||
HookEvent("round_start", OnRoundStart);
|
||||
HookEntityOutput("trigger_once", "OnStartTouch", OnStartTouch);
|
||||
HookEntityOutput("func_button", "OnPressed", OnPressed);
|
||||
g_cCD = CreateConVar("sm_trigger_reward_cd", "10.0", "Cooldown between HLSTATS Trigger rewards", 0, true, 0.1);
|
||||
AutoExecConfig(true, "plugin.TriggerRewards");
|
||||
|
||||
HookEvent("round_start", OnRoundStart);
|
||||
HookEntityOutput("trigger_once", "OnStartTouch", OnStartTouch);
|
||||
HookEntityOutput("func_button", "OnPressed", OnPressed);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -51,7 +51,7 @@ public void OnMapStart()
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public Action OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
{
|
||||
for(int i = 0; i <= 2047; i++)
|
||||
for(int i = 0; i < 2048; i++)
|
||||
g_bDisabled[i] = false;
|
||||
}
|
||||
|
||||
@@ -60,13 +60,10 @@ public Action OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcas
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public void OnStartTouch(const char[] sOutput, int iCaller, int iActivator, float fDelay)
|
||||
{
|
||||
if (g_bDisabled[iCaller])
|
||||
if (!IsValidClient(iActivator))
|
||||
return;
|
||||
|
||||
if (g_bOnCD)
|
||||
return;
|
||||
|
||||
if(!(1<=iActivator<= MaxClients ) || (iCaller == -1) || (!IsClientInGame(iActivator)) || !IsPlayerAlive(iActivator) || !IsPlayerAlive(iActivator))
|
||||
if (g_bDisabled[iCaller] || g_bOnCD)
|
||||
return;
|
||||
|
||||
if (!(ZR_IsClientHuman(iActivator)))
|
||||
@@ -88,26 +85,20 @@ public void OnPressed(const char[] sOutput, int iCaller, int iActivator, float f
|
||||
if(!IsValidClient(iActivator))
|
||||
return;
|
||||
|
||||
if (g_bDisabled[iCaller])
|
||||
return;
|
||||
|
||||
if (g_bOnCD)
|
||||
if (g_bDisabled[iCaller] || g_bOnCD)
|
||||
return;
|
||||
|
||||
if (!(ZR_IsClientHuman(iActivator)))
|
||||
return;
|
||||
|
||||
int iParent = -1;
|
||||
iParent = GetEntPropEnt(iCaller, Prop_Data, "m_hMoveParent");
|
||||
|
||||
if (iParent != -1)
|
||||
int iParent = INVALID_ENT_REFERENCE;
|
||||
if ((iParent = GetEntPropEnt(iCaller, Prop_Data, "m_hMoveParent")) != INVALID_ENT_REFERENCE)
|
||||
{
|
||||
char sClassname[64];
|
||||
GetEdictClassname(iParent, sClassname, sizeof(sClassname));
|
||||
|
||||
if ((StrContains(sClassname, "weapon", false) != -1))
|
||||
if (strncmp(sClassname, "weapon_", 7, false) == 0)
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
g_bDisabled[iCaller] = true;
|
||||
@@ -116,7 +107,6 @@ public void OnPressed(const char[] sOutput, int iCaller, int iActivator, float f
|
||||
CreateTimer(g_cCD.FloatValue, ResetCD);
|
||||
|
||||
LogPlayerEvent(iActivator, "triggered", "trigger");
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -132,8 +122,8 @@ public Action ResetCD(Handle timer)
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
public bool IsValidClient(int iClient)
|
||||
{
|
||||
if ( !( 1 <= iClient <= MaxClients ) || !IsClientInGame(iClient) || !IsPlayerAlive(iClient))
|
||||
return false;
|
||||
if ( !( 1 <= iClient <= MaxClients ) || !IsClientInGame(iClient) || !IsPlayerAlive(iClient))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user