Results 1 to 10 of 18

Thread: Player HUD On Crosshair

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #12
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    PHP Code:
    main()
    {
        
    level.rankstring = &"Rank: ";
        
    precacheString(level.rankstring);
        
        
    thread waitforconnect();
    }

    waitforconnect()
    {
        while(
    true)
        {
            
    level waittill("connecting"player);
            
    player thread onconnect();
        }
    }

    onconnect()
    {
        
    self.playerrankhud newClientHudElem(self);
        
    self.playerrankhud.label level.rankstring;
        
    self.playerrankhud.alpha 0;
        
    self.playerrankhud.horzAlign "center_safearea";
        
    self.playerrankhud.vertAlign "center_safearea";
        
    self.playerrankhud.alignx "center";
        
    self.playerrankhud.aligny "middle";
        
    self.playerrankhud.0;
        
    self.playerrankhud.0;
        
    self.playerrankhud.archived false;
        
    self.playerrankhud.foreground false;

        while(
    isdefined(self))
        {
            
    self waittill("spawned_player");
            
    lookat undefined;
            while(
    isdefined(self) && isdefined(self.sessionstate) && self.sessionstate == "playing")
            {
                
    start self geteye() + (0020);
                
    forward anglestoforward(self getplayerangles());
                
    end start maps\mp\_util::vectorScale(forward1000); 
                
    trace bullettrace(startendtrueself);
                if(
    isdefined(trace["entity"]) && isplayer(trace["entity"]))
                {
                    
    self.playerrankhud.alpha 1;
                    
    self.playerrankhud setvalue(trace["entity"].rank);
                }
                else if(
    self.playerrankhud.alpha != 0)
                {
                    
    self.playerrankhud fadeovertime(0.5);
                    
    self.playerrankhud.alpha 0;
                }
                
    wait 0.05;
            }
            
    self.playerrankhud.alpha 0;
        }

    I will explain this script some time..

  2. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    Killer.Pro (14th February 2013),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
  •