Results 1 to 9 of 9

Thread: [Killing Hud MONEY]

  1. #1
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts

    [Killing Hud MONEY]

    Does somebody know how to put killing hud? When player kill somebody to hud show ex. +100,+200..

    Thanks.

  2. #2
    Private First Class
    Join Date
    Dec 2012
    Posts
    127
    Thanks
    132
    Thanked 114 Times in 63 Posts
    make a hud on center with label +100 and call it on PlayerKilled

  3. #3
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    Code:
    showmoneyplus(money)
    {
    self notify("hud_restart");
    self endon("disconnect");
    self endon("hud_restart");
    wait 0.05;
    if(!isDefined(self.hud_money))
    	{
    	self.hud_money = newClientHudElem(self);
    	self.hud_money.horzAlign = "fullscreen";
    	self.hud_money.vertAlign = "fullscreen";
    	self.hud_money.alignX = "center";
    	self.hud_money.alignY = "top";
    	self.hud_money.x = 305;
    	self.hud_money.y = 20;
    	self.hud_money.fontscale = 2.0;
    	self.hud_money.color = (0,1,0);
    	self.hud_money.label = &"^3+&&1";
    	self.hud_money setValue(money);
    	self.hud_money.alpha=1;
    	wait 2;
    	self.hud_money fadeOverTime(1);
    	self.hud_money.alpha=0;
    	}
    else 
    	{
    	self.hud_money setValue(money);
    	self.hud_money.alpha=1;
    	wait 2;
    	self.hud_money fadeOverTime(1);
    	self.hud_money.alpha=0;
    	}
    wait 1;
    if(isDefined(self.hud_money))
    	self.hud_money destroy();
    
    }
    Like this?

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    untested:

    PHP Code:
    showmoneyplusmoney )
    {
        if( 
    isDefinedself.hud_money ) )
            
    self.hud_money destroy();

        if( !
    isDefinedself.hud_money ) )
        {
            
    self.hud_money newClientHudElemself );
            
    self.hud_money.horzAlign "fullscreen";
            
    self.hud_money.vertAlign "fullscreen";
            
    self.hud_money.alignX "center";
            
    self.hud_money.alignY "top";
            
    self.hud_money.305;
            
    self.hud_money.20;
            
    self.hud_money.fontscale 2.0;
            
    self.hud_money.color = (0,1,0);
            
    self.hud_money.label = &"^3+ &&1";
            
    self.hud_money.alpha 0;
        }
        
        if( 
    isDefinedself.hud_money ) )
        {
            
    self.hud_money setValuemoney );
            
    self.hud_money.alpha 1;
            
    self.hud_money fadeOverTime);
        }

        
    wait);
        
        if( 
    isDefinedself.hud_money ) )
        {
            
    self.hud_money fadeOverTime);
            
    self.hud_money.alpha 0;
        }

        if( 
    isDefinedself.hud_money ) )
            
    self.hud_money destroy();

    WARNING - you cannot use placeholders (i.e. &&1, &&2, etc, etc) in a hud label. They don't work. Placeholders only work with iprintln/iprintlnBold.

    So, this would be better and actually work:

    PHP Code:
    showmoneyplusmoney )
    {
        if( 
    isDefinedself.hud_money ) )
            
    self.hud_money destroy();

        if( !
    isDefinedself.hud_money ) )
        {
            
    self.hud_money newClientHudElemself );
            
    self.hud_money.horzAlign "fullscreen";
            
    self.hud_money.vertAlign "fullscreen";
            
    self.hud_money.alignX "center";
            
    self.hud_money.alignY "top";
            
    self.hud_money.305;
            
    self.hud_money.20;
            
    self.hud_money.fontscale 2.0;
            
    self.hud_money.color = (0,1,0);
            
    self.hud_money.label = &"+   ";
            
    self.hud_money.alpha 0;
        }
        
        if( 
    isDefinedself.hud_money ) )
        {
            
    self.hud_money setValuemoney );
            
    self.hud_money.alpha 1;
            
    self.hud_money fadeOverTime);
        }

        
    wait);
        
        if( 
    isDefinedself.hud_money ) )
        {
            
    self.hud_money fadeOverTime);
            
    self.hud_money.alpha 0;
        }

        if( 
    isDefinedself.hud_money ) )
            
    self.hud_money destroy();


  5. #5
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Placeholders (only the &&1) work fine in a hud if you .label them with it AND the label is localized, aka it is in inside a .str file

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    randall (9th November 2013)

  7. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    Placeholders (only the &&1) work fine in a hud if you .label them with it AND the label is localized, aka it is in inside a .str file
    Really? Are you sure? I have always understood that placeholders don't work in a HUD, even if you use a localized string label. In fact, (and it's been a few years since I experimented with HUD placeholders), my tests all those years ago always failed using them in a HUD.

  8. #7
    Private First Class
    Join Date
    Jul 2013
    Posts
    170
    Thanks
    44
    Thanked 16 Times in 11 Posts
    put it at callback playerkilled? (tally can u add me at xfire or i add you)

  9. #8
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Rocky View Post
    put it at callback playerkilled? (tally can u add me at xfire or i add you)
    There is no point adding me, or me adding you. I only use XFire to make videos, very infrequently. I am never online.

  10. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by Tally View Post
    Really? Are you sure? I have always understood that placeholders don't work in a HUD, even if you use a localized string label. In fact, (and it's been a few years since I experimented with HUD placeholders), my tests all those years ago always failed using them in a HUD.
    I dont have any mod currently using it, but i think i succesfully put a settext(loc_string) or setvalue(val) in a .label(loc_label) where loc_label was something with &&1 in it (and not at the end)

    Im currently using the &&1 as postfix in some mod, and it does NOT show up in the hud ("Money: &&1" becomes Money: 666 ingame after setvalue(666))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •