Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Player HUD On Crosshair

  1. #11
    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)

  3. #12
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    ******* script compile error *******
    Could not find script 'maps/mp/_util': (file 'drczolg/_cross.gsc', line 40)
    end = start + maps\mp\_util::vectorScale(forward, 1000);

  4. #13
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    Thanks For Script IzNoGoD .

  5. #14
    Private First Class
    Join Date
    Dec 2012
    Posts
    127
    Thanks
    132
    Thanked 114 Times in 63 Posts
    Quote Originally Posted by malyczolg View Post
    Jeplaa
    You Srcipt dont work , who can repair Earliboy SCRIPT ?
    I have checked - it work, maybe you didn't precache, anyway solved.

  6. #15
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    IzNoGoD
    eng:
    Your script works but it shows my rank, etc instead of the player on whose tracked

    pl:
    twoj skrypt dziala lecz pokazuje moj rank itp zamiast gracza na ktorego namierzylem

    main()
    {
    level.rankstring = &"RA^9NK^2:^7 ";
    precacheString(level.rankstring);

    thread waitforconnect();
    }

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

    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.x = 0;
    self.playerrankhud.y = 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() + (0, 0, 20);
    forward = anglestoforward(self getplayerangles());
    end = start + maps\mp\_utility::vectorScale(forward, 1000);
    trace = bullettrace(start, end, true, self);
    if(isdefined(trace["entity"]) && isplayer(trace["entity"]))
    {
    self.playerrankhud.alpha = 1;
    self.playerrankhud setvalue(self.rankc);
    }
    else if(self.playerrankhud.alpha != 0)
    {
    self.playerrankhud fadeovertime(0.5);
    self.playerrankhud.alpha = 0;
    }
    wait 0.05;
    }
    self.playerrankhud.alpha = 0;
    }
    }
    Last edited by malyczolg; 14th February 2013 at 18:05.

  7. #16
    Private First Class
    Join Date
    Feb 2013
    Posts
    201
    Thanks
    4
    Thanked 10 Times in 7 Posts
    ok i repair it
    topic close plz

  8. #17
    Private First Class Earliboy's Avatar
    Join Date
    Nov 2012
    Location
    Germany
    Posts
    130
    Thanks
    5
    Thanked 88 Times in 61 Posts
    Could u just post the "repaired" script? So if someone else wanna use it, he can use the working version.
    No ... No ... this is not possible .......

  9. The Following User Says Thank You to Earliboy For This Useful Post:

    kung foo man (14th February 2013)

  10. #18
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Quote Originally Posted by malyczolg View Post
    IzNoGoD
    eng:
    Your script works but it shows my rank, etc instead of the player on whose tracked

    pl:
    twoj skrypt dziala lecz pokazuje moj rank itp zamiast gracza na ktorego namierzylem
    Should show the rank of the player you are looking at. Did you test it correctly?

    Else the bullettrace() doesnt work like it should, which i find very hard to believe...

Posting Permissions

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