26.05.2014, 15:08
(
Последний раз редактировалось AviPeker; 27.05.2014 в 17:15.
)
Simple GPS system !
Recommended For RP Servers
PWN CODE:
To recompile this PWN code you will need this include file: (ZCMD) https://sampforum.blast.hk/showthread.php?tid=91354
To Change Location
Use /save name ingame to get the location of your current position. ( Go to your GTA San Andreas User Files >> SAMP Folder >> savedpositions.txt )
And then just change the X,Y,Z
Recommended For RP Servers
Enjoy!
PWN CODE:
Код:
/// Avi Peker /// /// SA-MP.COM /// #include <a_samp> #include <zcmd> #define MAX_LOCATIONS 69 #define GPS_DIALOG 7969 enum gInfo { gName[128], Float:gX, Float:gY, Float:gZ } new GPSInfo[MAX_LOCATIONS][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() { AddGPS("LSPD", 1523.4817,-1681.0198,13.2347); AddGPS("DMV", 1219.1259,-1812.4835,16.5938); AddGPS("Bank", 1523.4817,-1681.0198,13.2347); AddGPS("City Hall", 1480.9865,-1771.6118,18.7958); 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[]) { ShowPlayerDialog(playerid, GPS_DIALOG, DIALOG_STYLE_LIST, " Choose a Location:", gpsstr, "Locate", "Cancel"); return 1; } CMD:togglegpsoff(playerid,params[]) { if(GPS_Activated[playerid] == 1) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, 0xffff00aa, "GPS have been Toggled OFF"); GPS_Activated[playerid] = 0; } return 1; } public OnPlayerEnterCheckpoint(playerid) { if(GPS_Activated[playerid] == 1) { SendClientMessage(playerid, 0xffff00aa, "You have reached your destination"); DisablePlayerCheckpoint(playerid); GPS_Activated[playerid] = 0; } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == GPS_DIALOG) { 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; } /// Avi Peker /// /// SA-MP.COM ///
To Change Location
Use /save name ingame to get the location of your current position. ( Go to your GTA San Andreas User Files >> SAMP Folder >> savedpositions.txt )
And then just change the X,Y,Z