Results 1 to 10 of 18

Thread: Player HUD On Crosshair

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Private First Class
    Join Date
    Dec 2012
    Posts
    127
    Thanks
    132
    Thanked 114 Times in 63 Posts
    I can't find what's wrong but try this, I wrote it a long time ago anyway should work... (it's just part of code... make it useful)

    Code:
    PlayersStats()
    {
    	while(isdefined(self))
    	{
    		trace = bullettrace(self geteye()+(0,0,20),self geteye()+(0,0,20)+maps\mp\_utility::vectorscale(anglestoforward(self getplayerangles()),99999),true,self);
    		if(isplayer(trace["entity"]))
    		{
    			if(!isdefined(self.info))
    			{
    				self.info = newClientHudElem(self);
    				self.info.alignx = "center";
    				self.info.aligny = "center";
    				self.info.x = 250;
    				self.info.y = 250;
    				self.info.fontscale = 0.8;
    				self.info.label = &"Name: ";
    				self.info setplayernamestring(trace["entity"]);
    				self.info.alpha = 0;
    				self.info fadeOverTime(0.4);
    				self.info.alpha = 1;
    			}
    			else
    			self.info setplayernamestring(trace["entity"]);
    		}
    		else if(!isplayer(trace["entity"]) && isdefined(self.info))
    		self.info destroy();
    		wait 0.05;
    	}
    }
    Precache:
    Code:
    precacheString(&"Name: ");

  2. The Following User Says Thank You to Jeplaa For This Useful Post:

    kung foo man (14th February 2013)

Posting Permissions

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