Results 1 to 2 of 2
  1. #1
    jimmynguyen3030's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Location
    NukeTown
    Posts
    263
    Reputation
    10
    Thanks
    18
    My Mood
    Bored

    red ammo stock number

    what is the code to make this code (1,0,0) aka red when there isnt any ammo stock left?
    Code:
    ShowAmmoStock(weapon)
    {
    	self endon("new_splash");
    	self endon("death");
    	if(isDefined(self.ammoStockdisplay))
    	{
    		self.ammoStockdisplay destroyElem();
    	}
    	wait 0.05;
    	self.ammoStockdisplay = self createFontString("default", 1.3);
    	self.ammoStockdisplay.horzAlign = "RIGHT";
    	self.ammoStockdisplay.vertAlign = "MIDDLE";
    	self.ammoStockdisplay.x = -118;
    	self.ammoStockdisplay.y = 189;
    	self.ammoStockdisplay.hideWhenInMenu = true;
    	self.ammoStockdisplay.foreground = true;
    
    	while(1)
    	{
    		self.ammostock = self getWeaponAmmoStock(self getCurrentWeapon());
    		self.ammoStockdisplay setText("/ " + self.ammostock);
    		self setWeaponAmmoStock(weapon, self.ammostock);
    		wait 0.01;
    	}
    }
    If I Helped You, Plz Thanks.
    It Would Help Alot

    What Do You Do For A Living?
    I Mostly Own Noobs With The AK-47 With Silencer
    What's That?
    (Turns To Friend)
    HAHAHA Noob!!!!!!
    [img]https://www.danasof*****m/sig/asd248737.jpg[/img]

  2. #2
    Arasonic's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    569
    Reputation
    11
    Thanks
    115
    Heres my code, check if you can understand something from it..
    (hmm.. should probably remove some of the getCurrentWeapon thingies down there..)

    Code:
    showAmmo()
    {	
          Blood = createIcon("cardtitle_bloodsplat", 120, 30);
          Blood setPoint( "TOPRIGHT", "TOPRIGHT", -10, 335);   
          self thread Death(Blood);
          
          cashBoard = self createFontString( "default", 1.5 );
    	cashBoard setPoint( "TOPRIGHT", "TOPRIGHT", -45, 340);
    	cashBoard setValue(self.cash);
          self thread Death(cashBoard);
     
          ammoBoard = self createFontString( "default", 2.5 );
    	ammoBoard setPoint( "TOPRIGHT", "TOPRIGHT", -130, 430);
          self thread Death(ammoBoard);
    
          stockBoard = self createFontString( "default", 2.5 );
    	stockBoard setPoint( "TOPRIGHT", "TOPRIGHT", -80, 430);
          self thread Death(stockBoard);
    
          ammoBoard3 = self createFontString( "default", 2.5 );
    	ammoBoard3 setPoint( "TOPRIGHT", "TOPRIGHT", -120, 430);
    	ammoBoard3 setText("/");
          self thread Death(ammoBoard3);
    	
    	while(1)
    	{
    	      self.Clip = self getWeaponAmmoClip(self getCurrentWeapon());
                self.Stock = self getWeaponAmmoStock(self getCurrentWeapon());
    	      ammoBoard setValue(self.Clip);
                cashBoard setValue(self.cash);
                stockBoard setValue(self.Stock);
    		if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoClip(self getCurrentWeapon()) <= 5)
    		{
    			ammoBoard.color = (1,0,0);
    		}
    		else
    		{
    			ammoBoard.color = (255, 255, 255);
    		}
    		if(self getCurrentWeapon()!="" && self getCurrentWeapon()!="none" && self getWeaponAmmoStock(self getCurrentWeapon()) <= 5)
    		{
    			stockBoard.color = (1,0,0);
    		}
    		else
    		{
    			stockBoard.color = (255, 255, 255);
    		}
                wait 0.1;
    	}
    }