Permalink
Browse files

Some tactical shield changes

  • Loading branch information...
Bara committed Jun 3, 2018
1 parent 53350a3 commit f3cda56b3b42cd555e78714bace519d11aadeeb1
Showing with 14 additions and 7 deletions.
  1. +14 −7 addons/sourcemod/scripting/ttt/ttt_tactical_shield.sp
@@ -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
{
@@ -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)
{

0 comments on commit f3cda56

Please sign in to comment.