Thread: Making A Gps
View Single Post
  #1  
Old 09-17-2011, 06:47 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Making A Gps

Iv made the base script im just wondering how to get the x and y's right and moving here is the base
what im wonding how to do is making the markers x in the centre of the background and the dot centered when the player writes /setgps then when the player moves the dot will move either down up right left or diagonally depending where the player is to where the marker is.
i cant figure out how to make the max dots x and y depending on how big the gmap is and making it only move a tiny bit.
PHP Code:
//#CLIENTSIDE


function onCreated() {
    new 
GuiBitmapCtrl("GPS_Background") {
        
210;
        
10;
        
width 100;
        
height 100;
        
bitmap "GPS_Background.png";
    }
    new 
GuiBitmapCtrl("GPS_Marker") {
        
240;
        
40;
        
width 10;
        
height 10;
        
bitmap "GPS_Marker.png";
    }
    new 
GuiBitmapCtrl("GPS_Dot") {
        
255;
        
55;
        
width 10;
        
height 10;
        
bitmap "GPS_Dot.png";
    }
    new 
GuiTextCtrl("GPS_X") {
        
profile GuiBlueTextProfile;
        
height 20;
        
width 200;
        
315;
        
65;
        
red 1;
        
green 1;
        
blue 1;
    }
    new 
GuiTextCtrl("GPS_Y") {
        
profile GuiBlueTextProfile;
        
height 20;
        
width 200;
        
315;
        
80;
        
red 1;
        
green 1;
        
blue 1;
    }
    
onTimeout();
}

function 
onTimeout() {
    
GPS_X.text "X:  "@client.gpsx;
    
GPS_Y.text "Y:  "@client.gpsy;
    
settimer(0.05);
}

function 
onPlayerChats() {
    if (
player.chat == "/setgps") {
        
player.chat "GPS Marker Set!";
        
client.gpsx player.x;
        
client.gpsy player.y;
    }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 09-17-2011 at 07:02 AM..
Reply With Quote