[Solved]red ammo number

Posts 1–4 of 4 · Page 1 of 1
[Solved]red ammo number
hey guys so here i have the ammo clip code and if the ammo is at "0" the text will change to
Code:
 			self.ammoClipdisplay.color = (1,0,0);
but only "0" is there a way to make it 0,1,2,3, and 4?
Code:
ShowAmmoClip()
{
	self endon("death");
	self.ammoClipdisplay = self createTimer("default", 1.8);
	self.ammoClipdisplay.horzAlign = "RIGHT";
	self.ammoClipdisplay.vertAlign = "MIDDLE";
	self.ammoClipdisplay.alignX = "RIGHT";
	self.ammoClipdisplay.x = -120.5;
	self.ammoClipdisplay.y = 184;
	self.ammoClipdisplay.hideWhenInMenu = true;
	self.ammoClipdisplay.foreground = true;
	for(;;)
	{
		self.ammoClipdisplay setValue(self getWeaponAmmoClip(self getCurrentWeapon()));
		if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoClip(self getCurrentWeapon())==0)
		{
			self.ammoClipdisplay.color = (1,0,0);
		}
		else
		{
			self.ammoClipdisplay.color = (255, 255, 255);
		}
		wait 0.05;
	}
}
Just use simple math signs?

Code:
ShowAmmoClip()
{
	self endon("death");
	self.ammoClipdisplay = self createTimer("default", 1.8);
	self.ammoClipdisplay.horzAlign = "RIGHT";
	self.ammoClipdisplay.vertAlign = "MIDDLE";
	self.ammoClipdisplay.alignX = "RIGHT";
	self.ammoClipdisplay.x = -120.5;
	self.ammoClipdisplay.y = 184;
	self.ammoClipdisplay.hideWhenInMenu = true;
	self.ammoClipdisplay.foreground = true;
	for(;;)
	{
		self.ammoClipdisplay setValue(self getWeaponAmmoClip(self getCurrentWeapon()));
		if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoClip(self getCurrentWeapon()) <= 4)
		{
			self.ammoClipdisplay.color = (1,0,0);
		}
		else
		{
			self.ammoClipdisplay.color = (255, 255, 255);
		}
		wait 0.05;
	}
}
/Marked as solved.
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?