[Tutorial] How to make simple gps system.
#7

Quote:
Originally Posted by Gangster-rocks
View Post
Incudtions

You must have this includtions
zcmd
Starting off

now befor starting you must have this function by me :3
pawn Code:
stock CreateGps(gpsid,Float:x,Float:y,Float:z)
{
    new playerid;
    SetPlayerMapIcon(playerid,gpsid,x,y,z,00 ,COLOR_RED1,MAPICON_GLOBAL_CHECKPOINT);
    if(IsPlayerInRangeOfPoint(playerid,10,x,y,z))
    {
        RemovePlayerMapIcon(playerid,gpsid);
        SendClientMessage(playerid,COLOR_RED1,"You have reched your place");
    }
    return playerid;
}
now lets get started:

1- how to create a gps?
You can create a gps like this:
pawn Code:
CreateGps(id,x,y,z);
2- How to use it
pawn Code:
CMD:gps(playerid,params[])
{
    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"GPS location","\nLSPD\n24/7(unity)","Set GPS","Close");
    return 1;
}
and this on OnDialogResponse CallBack
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    CreateGps(1,1553.4988, -1675.9509, 16.3764);
                }
                case 1:
                {
                    CreateGps(2,832.08, -1842.65, 12.98);
                }
            }
        }
    }
    return 1;
}
The above is a tonne of crap. Honestly. Replace it with this.

Code:
You must have these includes
zcmd
How To Create A GPS
Before starting you must have this function by me.
pawn Code:
stock CreateGps(gpsid,Float:x,Float:y,Float:z){    new playerid;    SetPlayerMapIcon(playerid,gpsid,x,y,z,00 ,COLOR_RED1,MAPICON_GLOBAL_CHECKPOINT);    if(IsPlayerInRangeOfPoint(playerid,10,x,y,z))    {        RemovePlayerMapIcon(playerid,gpsid);        SendClientMessage(playerid,COLOR_RED1,"You have reached your desired location.");    }    return playerid;}
now lets get started:

You can create a GPS like this:
pawn Code:
CreateGps(id,x,y,z);
2- How to use it
pawn Code:
CMD:gps(playerid,params[]){    ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"GPS location","\nLSPD\n24/7(unity)","Set GPS","Close");    return 1;}
and this on OnDialogResponse CallBack
pawn Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){    if(dialogid == 1)    {        if(response)        {            switch(listitem)            {                case 0:                {                    CreateGps(1,1553.4988, -1675.9509, 16.3764);                }                case 1:                {                    CreateGps(2,832.08, -1842.65, 12.98);                }            }        }    }    return 1;}
Reply


Messages In This Thread
How to make simple gps system. - by Gangster-rocks - 02.09.2012, 11:42
Re: How to make simple gps system. - by C00K13M0N$73R - 02.09.2012, 11:44
Re: How to make simple gps system. - by Gangster-rocks - 02.09.2012, 11:48
Re: How to make simple gps system. - by Your:RP - 02.09.2012, 11:48
Re: How to make simple gps system. - by Gangster-rocks - 02.09.2012, 11:53
Re: How to make simple gps system. - by Your:RP - 02.09.2012, 11:56
Re: How to make simple gps system. - by Your:RP - 02.09.2012, 12:00
Re: How to make simple gps system. - by Gangster-rocks - 02.09.2012, 12:16
Re: How to make simple gps system. - by Your:RP - 02.09.2012, 12:38
Re: How to make simple gps system. - by iGetty - 02.09.2012, 13:22
Re: How to make simple gps system. - by Cjgogo - 02.09.2012, 16:41
Re: How to make simple gps system. - by iGetty - 02.09.2012, 22:50
Re: How to make simple gps system. - by Cassy_ - 04.09.2012, 13:14
Re: How to make simple gps system. - by IssaKiller1 - 09.09.2014, 21:58
Re: How to make simple gps system. - by JacobEdwards - 09.09.2014, 22:01
Re: How to make simple gps system. - by Vince - 09.09.2014, 22:07
Re: How to make simple gps system. - by TheRaGeLord - 24.01.2015, 06:30

Forum Jump:


Users browsing this thread: 4 Guest(s)