Skip to content

Commit

Permalink
Some tactical shield changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Jun 3, 2018
1 parent 53350a3 commit f3cda56
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions addons/sourcemod/scripting/ttt/ttt_tactical_shield.sp
Expand Up @@ -82,20 +82,18 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
{
if (StrEqual(itemshort, SHORT_NAME_D, false))
{
ResetTacticalShield(client);

int role = TTT_GetClientRole(client);

if (role == TTT_TEAM_DETECTIVE)
{
GivePlayerShield(client);

if (g_cForce.BoolValue)
{
OverridePlayerShield(client, 2);
RequestFrame(Frame_SetShield, GetClientUserId(client));
}
else
{
OverridePlayerShield(client, 1);
}

GivePlayerShield(client);
}
else
{
Expand All @@ -106,6 +104,15 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
return Plugin_Continue;
}

public void Frame_SetShield(int userid)
{
int client = GetClientOfUserId(userid);

if (TTT_IsClientValid(client))
{
SetEquipPlayerShield(client, true);
}
}

public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
Expand Down

0 comments on commit f3cda56

Please sign in to comment.