Results 1 to 9 of 9

Thread: Position display

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts

    Position display

    Hi,

    Just a simple idea I had to help people who need to know their position in maps in case they wanna spawn something with a mod.

    I used to use the print function to check my position every 0.1s and took screenshots of the values. I noticed some people here use the same method.

    I created these huds to show the position in a more "comfortable" way.



    1. Precache these strings
    PHP Code:
        game["labelx"] = &"^1X: ^7";
        
    precacheString(game["labelx"]);
        
    game["labely"] = &"^1Y: ^7";
        
    precacheString(game["labely"]);
        
    game["labelz"] = &"^1Z: ^7";
        
    precacheString(game["labelz"]); 
    2. Call this function when the player spawns
    PHP Code:
        if(isdefined(self.hud_positionx))
            
    self.hud_positionx destroy();

        
    self.hud_positionx newClientHudElem(self);
        
    self.hud_positionx.= -80;
        
    self.hud_positionx.= -15;
        
    self.hud_positionx.alignx "left";
        
    self.hud_positionx.horzAlign "right";
        
    self.hud_positionx.vertAlign "middle";
        
    self.hud_positionx.fontScale 1;
        
    self.hud_positionx setValue(0);
        
    self.hud_positionx.sort 9986;
        
    self.hud_positionx.label game["labelx"];

        if(
    isdefined(self.hud_positiony))
            
    self.hud_positiony destroy();

        
    self.hud_positiony newClientHudElem(self);
        
    self.hud_positiony.= -80;
        
    self.hud_positiony.0;
        
    self.hud_positiony.alignx "left";
        
    self.hud_positiony.horzAlign "right";
        
    self.hud_positiony.vertAlign "middle";
        
    self.hud_positiony.fontScale 1;
        
    self.hud_positiony setValue(0);
        
    self.hud_positiony.sort 9986;
        
    self.hud_positiony.label game["labely"];

        if(
    isdefined(self.hud_positionz))
            
    self.hud_positionz destroy();

        
    self.hud_positionz newClientHudElem(self);
        
    self.hud_positionz.= -80;
        
    self.hud_positionz.15;
        
    self.hud_positionz.alignx "left";
        
    self.hud_positionz.horzAlign "right";
        
    self.hud_positionz.vertAlign "middle";
        
    self.hud_positionz.fontScale 1;
        
    self.hud_positionz setValue(0);
        
    self.hud_positionz.sort 9986;
        
    self.hud_positionz.label game["labelz"];

        for(;;)
        {
            
    wait 0.1;
            
    origin self getOrigin();
            
    self.hud_positionx setValue(origin[0]);
            
    self.hud_positiony setValue(origin[1]);
            
    self.hud_positionz setValue(origin[2]);
        } 

    Click image for larger version. 

Name:	shot0008.jpg 
Views:	154 
Size:	170.5 KB 
ID:	802
    Last edited by guiismiti; 29th November 2014 at 05:39.
    set logfile 2

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

    kung foo man (29th November 2014),Mitch (29th November 2014),pollo (29th November 2014)

Tags for this Thread

Posting Permissions

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