24.11.2014, 19:35
Hello, I've currently been working on a new GPS filterscript. You only need to use one command and that is /gps(you can change it to suit your needs).
This is a very basic and easy to edit GPS, you can edit it to how you need it.
Includes:
a_samp
zcmd.
Defines:
Command
You can add more places in the dialog.
Update dated command!
This code now checks if you're a passenger or the driver
If you're not using ZCMD then remove #include <zcmd> and put this:
OnDialogResponse:
You can edit it if you have added more in.
If the player leaves the vehicle
When player gets to his destination
Pastebin: http://pastebin.com/gfh4hqyx
*******: https://www.youtube.com/watch?v=rJg2...ature=*********
Sreenshots:

Thanks to Jakwob for helping a bit with the OnDialogResponse.
Thanks for reading, and hope you like my GPS filterscript!
This is a very basic and easy to edit GPS, you can edit it to how you need it.
Includes:
a_samp
zcmd.
Defines:
Код:
#define GPS 10 //Main GPS Dialog #define GPSLS 11 // LS Dialog #define GPSLV 12// LV Dialog #define GPSSF 13// SF Dialog
Код:
CMD:gps(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))//Checks if player is in any vehicle
{
ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "GPS", "Los Santos\nLas Venturas\nSan Fierro", "Select", "Close"); // If player is in vehicle then shows dialog
return 1;
}
GameTextForPlayer(playerid, "~r~You're not in a vehicle", 2000, 1);// Sends a GameText if player is not in the vehicle
return 1;
}
Update dated command!
Код:
CMD:gps(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "GPS", "Los Santos\nLas Venturas\nSan Fierro", "Select", "Close");
return 1;
}
GameTextForPlayer(playerid, "~r~You're not the vehicle driver", 2000, 1);
}
GameTextForPlayer(playerid, "~r~You're not in a vehicle", 2000, 1);
return 1;
}
If you're not using ZCMD then remove #include <zcmd> and put this:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/gps", true))
{
if(IsPlayerInAnyVehicle(playerid))
{
ShowPlayerDialog(playerid, GPS, DIALOG_STYLE_LIST, "GPS", "Los Santos\nLas Venturas\nSan Fierro", "Select", "Close");
return 1;
}
GameTextForPlayer(playerid, "~r~You're not in a vehicle", 2000, 1);
return 1;
}
return 0;
}
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid == GPS)
{
case 1:
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, GPSLS, DIALOG_STYLE_LIST, "Los Santos", "Los Santos police department\n", "Select", "Close");// Los Santos Dialog
}
case 1:
{
ShowPlayerDialog(playerid, GPSLV, DIALOG_STYLE_LIST, "Las Venturas", "Las Venturas police department\n", "Select", "Close"); // Las Venturas Dialog
}
case 2:
{
ShowPlayerDialog(playerid, GPSSF, DIALOG_STYLE_LIST, "San Fierro", "San Fierro police department\n", "Select", "Close"); // San Fierro Dialog
}
}
}
}
}
if(dialogid == GPSLS)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
SetPlayerCheckpoint(playerid, 1533.1295,-1657.7357,13.3828, 8); // If pressed Los Santos Police Department
GameTextForPlayer(playerid, "~g~Los Santos police department is located on your minimap!", 2000, 1); // Sends GameText telling player that he has selected Los Santos police department
}
}
}
}
if(dialogid == GPSLV)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
SetPlayerCheckpoint(playerid, 2230.2854,2470.0540,10.8203, 8); // If pressed Las Venturas police department
GameTextForPlayer(playerid, "~g~Las Venturas police department is located on your minimap!", 2000, 1); // Sends GameText to tell player has pressed Las Venturas police department
}
}
}
}
if(dialogid == GPSSF)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
SetPlayerCheckpoint(playerid, -1563.9243,659.6130,7.0391, 8); //If pressed San Fierro police department
GameTextForPlayer(playerid, "~g~San Fierro police department is located on your minimap!", 2000, 1); // Sends GameText to tell player has pressed San Fierro police department
}
}
}
}
return 1;
}
If the player leaves the vehicle
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
DisablePlayerCheckpoint(playerid);// Disables checkpoint
return 1;
}
Код:
public OnPlayerEnterCheckpoint(playerid)
{
GameTextForPlayer(playerid, "You have reached your destination", 2000, 1);// Tells player he has reached his destination
DisablePlayerCheckpoint(playerid);// Disables checkpoint
return 1;
}
*******: https://www.youtube.com/watch?v=rJg2...ature=*********
Sreenshots:

Thanks to Jakwob for helping a bit with the OnDialogResponse.
Thanks for reading, and hope you like my GPS filterscript!

