epi: Up players active ammo on ammo pack use

This commit is contained in:
Jackzie 2021-06-18 23:48:59 -05:00
parent f692231542
commit 62788435d4
No known key found for this signature in database
GPG key ID: 1E834FE36520537A

View file

@ -228,7 +228,7 @@ public Action Event_PlayerSpawn(Event event, const char[] name, bool dontBroadca
if(firstSaferoomDoorEntity > 0 && percentIn > hMinPlayersSaferoomDoor.FloatValue) { if(firstSaferoomDoorEntity > 0 && percentIn > hMinPlayersSaferoomDoor.FloatValue) {
UnlockDoor(firstSaferoomDoorEntity, 2); UnlockDoor(firstSaferoomDoorEntity, 2);
} }
}else{ }else if(firstSaferoomDoorEntity > 0) {
UnlockDoor(firstSaferoomDoorEntity, 2); UnlockDoor(firstSaferoomDoorEntity, 2);
} }
} }
@ -481,7 +481,9 @@ public Action OnUpgradePackUse(int entity, int activator, int caller, UseType ty
if(clients.Length == 0) { if(clients.Length == 0) {
CreateTimer(60.0, Timer_ResetAmmoPack, entity); CreateTimer(60.0, Timer_ResetAmmoPack, entity);
} }
if(GetEntProp(primaryWeapon, Prop_Send, "m_iClip1") < ammo) {
SetEntProp(primaryWeapon, Prop_Send, "m_iClip1", ammo);
}
SetEntProp(primaryWeapon, Prop_Send, "m_nUpgradedPrimaryAmmoLoaded", ammo); SetEntProp(primaryWeapon, Prop_Send, "m_nUpgradedPrimaryAmmoLoaded", ammo);
clients.Push(activator); clients.Push(activator);
ClientCommand(activator, "play player/orch_hit_csharp_short.wav"); ClientCommand(activator, "play player/orch_hit_csharp_short.wav");