AmmOMatic(pos, angle)
{
block = spawn("script_model", pos );
block setModel("com_plasticcase_friendly");
block.angles = angle;
block Solid();
block CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
self thread AmmoThink(pos);
wait 0.01;
}
AmmoThink(pos)
{
self endon("disconnect");
for(;;)
{
foreach(player in level.players)
{
if(distance(pos, player.origin) <75 && player.cash >= 200)
Player SetLowerMessage(1, "Press ^3[{+activate}] ^7to purchase Ammo", undefined, 25);
else if(distance(pos, player.origin) <75 && player.cash < 200)
Player SetLowerMessage(1, "You do not have enough ^1Cash!", undefined, 50);
if(distance(pos, player.origin) <75 && player.cash >= 200 && Player UseButtonPressed())
{
player thread refillAmmo();
}
if(distance(pos, player.origin) >75) Player ClearLowerMessage(1);
}
wait 0.05;
}
}
refillAmmo()
{
weaponList = self GetWeaponsListAll();
foreach ( weaponName in weaponList )
{
if ( isSubStr( weaponName, "grenade" ) )
{
if ( self getAmmoCount( weaponName ) >= 1 )
continue;
}
self.cash -= 200;
self giveMaxAmmo( weaponName );
}
}
, a ammo box for a zombie mod or something similar.
else if(distance(pos, player.origin) <75 && player.cash < 200)