Jump to content

Question

Posted

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

4 answers to this question

Recommended Posts

  • 0
Posted
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;
        }

  • 0
Posted

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

Citat
  • 0
Posted (edited)

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

Edited by iStack

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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.