Skip to content
Permalink
Browse files

Add team check for TTT_IsPlayerAlive

  • Loading branch information
Bara committed Oct 30, 2019
1 parent c6088f8 commit ccdd0ca4391d64500f0b199d0cd1fc243598c3bc
Showing with 4 additions and 4 deletions.
  1. +1 −1 addons/sourcemod/scripting/ttt/core/natives.sp
  2. +3 −3 addons/sourcemod/scripting/ttt/ttt_revive.sp
@@ -431,7 +431,7 @@ public int Native_IsPlayerAlive(Handle plugin, int numParams)
{
int client = GetNativeCell(1);

if (TTT_IsClientValid(client))
if (TTT_IsClientValid(client) && (g_iRole[client] == TTT_TEAM_DETECTIVE || g_iRole[client] == TTT_TEAM_INNOCENT || g_iRole[client] == TTT_TEAM_TRAITOR))
{
return g_bAlive[client];
}
@@ -124,7 +124,7 @@ public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] n

public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count, int price)
{
if (TTT_IsClientValid(client) && IsPlayerAlive(client))
if (TTT_IsClientValid(client) && TTT_IsPlayerAlive(client))
{
if (StrEqual(itemshort, SHORT_NAME_T, false) || StrEqual(itemshort, SHORT_NAME_D, false))
{
@@ -400,7 +400,7 @@ public int Menu_ReviveRequest(Menu menu, MenuAction action, int target, int para
{
if (action == MenuAction_Select)
{
if (!TTT_IsRoundActive() || TTT_IsPlayerAlive(target))
if (!TTT_IsRoundActive() || IsPlayerAlive(target))
{
return;
}
@@ -422,7 +422,7 @@ public int Menu_ReviveRequest(Menu menu, MenuAction action, int target, int para
}
}

if (!TTT_IsPlayerAlive(client) || !g_bHasRevive[client])
if (!IsPlayerAlive(client) || !g_bHasRevive[client])
{
return;
}

0 comments on commit ccdd0ca

Please sign in to comment.
You can’t perform that action at this time.