Jump to content
  • 0
Sign in to follow this  
Iulian2

Problema /gps

Question

CMD:gps(playerid, params[]) {
    if(HaveCP(playerid)) return SCM(playerid, COLOR_ERROR, "Error: You have an active checkpoint.");
    if(Iter_Count(ServerGPSLocations) == 0) return SCM(playerid, COLOR_ERROR, "Error: There it's not any location in gps.");
    new dialog[2048], string[80];
    strcat(dialog, "Location\tDistance\n");
    for(new i = 1; i <= Iter_Count(ServerGPSLocations); i++) {
        format(string, sizeof(string), "{FFFFFF}%s\t{008080}%.2f\n", gpsInfo[gName], GetPlayerDistanceFromPoint(playerid, gpsInfo[gX], gpsInfo[gY], gpsInfo[gZ]));
        strcat(dialog, string);
    }
    ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_TABLIST_HEADERS, "Locations", dialog, "Select", "Close");
    return 1;
}

Ce trebuie sa fac sa imi apara locatiile?

sa-mp-188.png

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
La 12.05.2019 la 13:00, Azze47 a spus:

Stiu gm-ul, dai la dialog_gps si vezi acolo ce iti da !

    case DIALOG_GPS: {
            if(!response) return 1;
            new i = listitem + 1;
            SCM(playerid, COLOR_SHITBLUE, "(GPS) {FFFFFF}You selected location %s, that is at %.2fm.", gpsInfo[gName], GetPlayerDistanceFromPoint(playerid, gpsInfo[gX], gpsInfo[gY], gpsInfo[gZ]));
            SetPlayerCheckpoint(playerid, gpsInfo[gX], gpsInfo[gY], gpsInfo[gZ], gpsInfo[gRange]);
            CP[playerid] = 43;
        }

Share this post


Link to post
Share on other sites
  • 0

distanta pana la locatie iti apare verifica variabila asta  gpsInfo[gName]  la tine pare a fi NULL

Share this post


Link to post
Share on other sites
  • 0

Probabil nu ai adaugat in baza de date tabelul pentru numele locatie.

Edited by iStack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.