SERVER: Allow custom pricing for Pack-A-Punch weapon ammo

This commit is contained in:
MotoLegacy 2025-02-07 22:14:03 -08:00
parent df5f453fab
commit de012d4109
2 changed files with 8 additions and 3 deletions

View file

@ -99,9 +99,10 @@ entity local_client;
.float changestance;
.vector new_ofs;
//money
// Point Cost Values
.float cost;
.float cost2;
.float pap_cost;
//stats
.float score;

View file

@ -162,7 +162,7 @@ void () WallWeapon_TouchTrigger =
is_pap = false;
// Set the cost and weapon value (for useprint).
wcost = (is_pap) ? 4500 : self.cost2;
wcost = (is_pap) ? self.pap_cost : self.cost2;
float wep = (is_pap) ? EqualPapWeapon(self.weapon) : self.weapon;
useprint(other, 3, wcost, wep);
@ -218,7 +218,7 @@ void () WallWeapon_TouchTrigger =
if (other.currentammo < getWeaponAmmo(other.weapon)) {
// Set the cost and weapon value (for useprint).
wcost = (IsPapWeapon(other.weapon)) ? 4500 : self.cost2;
wcost = (IsPapWeapon(other.weapon)) ? self.pap_cost : self.cost2;
useprint(other, 3, wcost, other.weapon);
@ -408,6 +408,10 @@ void() buy_weapon =
{
InitTrigger ();
// Default Pack-A-Punch Ammo Cost
if (!self.pap_cost)
self.pap_cost = 4500;
string weaponname = GetWeaponModel (self.weapon, 0);
if (weaponname != "")
precache_model(weaponname);