ItemSpawn: untested fix for the Kill messages
This commit is contained in:
parent
a9704e1bfb
commit
9d1c5539e7
@ -303,6 +303,26 @@ public Action EquipWeapons(Handle timer, any userid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
// Purpose:
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
public bool IsValidClient(int client)
|
||||||
|
{
|
||||||
|
if (client <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (client > GetMaxClients())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!IsClientInGame(client))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!IsClientAuthorized(client))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
// Purpose:
|
// Purpose:
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
@ -335,7 +335,7 @@ public void SpawnBalrog(float fOrigin[3])
|
|||||||
SetEntityBBox(iHealth, view_as<float>({-124.0, -120.0, -188.2}), view_as<float>({124.0, 120.0, 188.2}));
|
SetEntityBBox(iHealth, view_as<float>({-124.0, -120.0, -188.2}), view_as<float>({124.0, 120.0, 188.2}));
|
||||||
SetEntityProps(iHealth);
|
SetEntityProps(iHealth);
|
||||||
|
|
||||||
// HookSingleEntityOutput(iHealth, "OnBreak", BalrogKill, true);
|
HookSingleEntityOutput(iHealth, "OnBreak", BalrogKill, true);
|
||||||
|
|
||||||
// game_ui.
|
// game_ui.
|
||||||
int iControls = CreateEntityAtOrigin("game_ui", fOrigin);
|
int iControls = CreateEntityAtOrigin("game_ui", fOrigin);
|
||||||
@ -366,5 +366,6 @@ public void BalrogPickup(const char[] output, int caller, int activator, float d
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void BalrogKill(const char[] output, int caller, int activator, float delay)
|
public void BalrogKill(const char[] output, int caller, int activator, float delay)
|
||||||
{
|
{
|
||||||
ServerCommand("say ** %N has killed the Balrog **", activator);
|
if (IsValidClient(activator))
|
||||||
|
ServerCommand("say ** %N has killed the Balrog **", activator);
|
||||||
}
|
}
|
@ -545,7 +545,7 @@ public void SpawnWhiteKnight(float fOrigin[3])
|
|||||||
SetEntityBBox(iHealth, view_as<float>({-36.0, -52.0, 48.0}), view_as<float>({36.0, 52.0, 160.0}));
|
SetEntityBBox(iHealth, view_as<float>({-36.0, -52.0, 48.0}), view_as<float>({36.0, 52.0, 160.0}));
|
||||||
SetEntityProps(iHealth);
|
SetEntityProps(iHealth);
|
||||||
|
|
||||||
// HookSingleEntityOutput(iHealth, "OnBreak", WhiteKnightKill, true);
|
HookSingleEntityOutput(iHealth, "OnBreak", WhiteKnightKill, true);
|
||||||
|
|
||||||
// game_ui.
|
// game_ui.
|
||||||
int iControls = CreateEntityAtOrigin("game_ui", fOrigin);
|
int iControls = CreateEntityAtOrigin("game_ui", fOrigin);
|
||||||
@ -584,5 +584,6 @@ public void WhiteKnightPickup(const char[] output, int caller, int activator, fl
|
|||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
public void WhiteKnightKill(const char[] output, int caller, int activator, float delay)
|
public void WhiteKnightKill(const char[] output, int caller, int activator, float delay)
|
||||||
{
|
{
|
||||||
ServerCommand("say ** %N has killed the White Knight **", activator);
|
if (IsValidClient(activator))
|
||||||
|
ServerCommand("say ** %N has killed the White Knight **", activator);
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user