Permalink
Browse files

Don't remove awp if the player already has a awp

  • Loading branch information...
Bara committed Jan 30, 2019
1 parent c457a13 commit 4cc771649dc7bcf2d14d4572f2c5521f43ed1c4b
Showing with 17 additions and 4 deletions.
  1. +17 −4 addons/sourcemod/scripting/ttt/ttt_silent_awp.sp
@@ -139,11 +139,24 @@ public Action TTT_OnItemPurchased(int client, const char[] itemshort, bool count
int iWeapon = GetPlayerWeaponSlot(client, CS_SLOT_PRIMARY);
if (iWeapon != -1)
{
TTT_SafeRemoveWeapon(client, iWeapon, CS_SLOT_PRIMARY);
char sWeapon[32];
GetEntityClassname(iWeapon, sWeapon, sizeof(sWeapon));

if (StrEqual(sWeapon, "weapon_awp", false))
{
g_iWeapon[client] = iWeapon;
}
else
{
TTT_SafeRemoveWeapon(client, iWeapon, CS_SLOT_PRIMARY);
}
}

if (!IsValidEntity(g_iWeapon[client]))
{
g_iWeapon[client] = GivePlayerItem(client, "weapon_awp");
EquipPlayerWeapon(client, g_iWeapon[client]);
}

g_iWeapon[client] = GivePlayerItem(client, "weapon_awp");
EquipPlayerWeapon(client, g_iWeapon[client]);

int max = 0;
int min = 0;

0 comments on commit 4cc7716

Please sign in to comment.