GPS not displaying location. [problem]
#1

Just thinking, what could be going wrong here, when i go into game, i use /gps in game it comes up with the location but when i select it, no checkpoint marker shows up on the minimap..

Have i missed anything?


pawn Код:
#include <a_samp>
#include <zcmd>

#define MAX_GPS 36
#define DIALOG_GPS      7986

enum gInfo
{
    gName[128],
    Float:gX,
    Float:gY,
    Float:gZ
}
new GPSInfo[MAX_GPS][gInfo];

new GPS = 0;
new gpsstr[256];
new GPS_Activated[MAX_PLAYERS] = 0;

stock AddGPS(name[], Float:x, Float:y, Float:z)
{
    GPS++;
    format(GPSInfo[GPS][gName],256,"%s",name);
    GPSInfo[GPS][gX] = x;
    GPSInfo[GPS][gY] = y;
    GPSInfo[GPS][gZ] = z;
    return 1;
}


public OnFilterScriptInit()
{
    print(" [][]> Simple GPS Loaded!");

    AddGPS("Driftwood", 2411.9023,-3809.1333,13.0737);

    for(new i = 0; i < GPS+1; i++)
    {
        if(i != 0)
        {
            if(i == 1) format(gpsstr,256,"%s\n",GPSInfo[i][gName]);
            if(i != 1) format(gpsstr,256,"%s%s\n",gpsstr,GPSInfo[i][gName]);
        }
    }
    return 1;
}

CMD:gps(playerid,params[])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xff0000aa, " [GPS] You are not in a vehicle!");
    ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST, " GPS:", gpsstr, "Choose", "Cancel");
    return 1;
}
CMD:gpsoff(playerid,params[])
{
    if(GPS_Activated[playerid] == 1)
    {
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, 0xffff00aa, " [GPS] You turned your GPS off!");
        GPS_Activated[playerid] = 0;
    }
    return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
    if(GPS_Activated[playerid] == 1)
    {
        SendClientMessage(playerid, 0xffff00aa, " [GPS] You have arrived at your destenation!");
        DisablePlayerCheckpoint(playerid);
        GPS_Activated[playerid] = 0;
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_GPS)
    {
        if(!response) return 1;
        if(listitem == GPS+1) return 1;
        SetPlayerCheckpoint(playerid, GPSInfo[listitem+1][gX], GPSInfo[listitem+1][gY], GPSInfo[listitem+1][gZ],5.0);
        GPS_Activated[playerid] = 1;
        return 1;
    }
    return 1;
}
Reply
#2

Forgot this: https://sampwiki.blast.hk/wiki/Function:SetPlayerCheckpoint !?!?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)