#include <zcmd>
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
fatal error 100: cannot read from file: "zcmd"
#define COLOR_YELLOW 0xFFFF00AA
Undefined "COLOR_YELLOW"
#define DIALOG_GPS 1 //Change this if you already defined a dialog to 1
if(dialogid == DIALOG_GPS)//if player types /gps the dialog will pop up
{
if(response)
{
if(listitem == 0)
{
SetPlayerRaceCheckpoint(playerid, 2,X,Y,Z, 0.0,0.0,0.0, 3.0);//only change the X,Y,Z | you can touch it if you know what you are doing
SendClientMessage(playerid, -1,"Follow the red mark on your map");//so player will know what will he follow
}
}
}
zcmd, dcmd, strmp
if (strcmp("/gps", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,0xAFAFAFAA,"You're not in a vehicle");
return 1;
}
ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST,"GPS System","Location","Choose","Cancel");
SendClientMessage(playerid,COLOR_YELLOW,"To Cancel Gps use /gpsoff");
return 1;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(gps,3,cmdtext);
return 0;
}
dcmd_gps(playerid, params[])
{
#pragma unused params
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,0xAFAFAFAA,"You're not in a vehicle");
return 1;
}
ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST,"GPS System","Locations,"Choose","Cancel");
SendClientMessage(playerid,COLOR_YELLOW,"To Cancel Gps use /gpsoff");
return 1;
}
return 1;
}
cmd(gps, playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,0xAFAFAFAA,"You're not in a vehicle");
return 1;
}
ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST,"GPS System","Location","Choose","Cancel");
SendClientMessage(playerid,COLOR_YELLOW,"To Cancel Gps use /gpsoff");
return 1;
}
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
GameTextForPlayer(playerid,"You Have Arrived At Your Destination",3000,5);//Show's a gametext
DisablePlayerRaceCheckpoint(playerid);//Disable The Current Checkpoint
return 1;
}
if (strcmp("gpsoff", cmdtext, true, 10) == 0)
{
DisablePlayerRaceCheckpoint(playerid);//Disable The Current Checkpoint
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(gpsoff,6,cmdtext);
return 0;
}
dcmd_gpsoff(playerid, params[])
{
DisablePlayerRaceCheckpoint(playerid);//Disable The Current Checkpoint
return 1;
}
cmd(gpsoff, playerid, params[])
{
DisablePlayerRaceCheckpoint(playerid);//Disable The Current Checkpoint
return 1;
}
1st - we need to get all X,Y,Z position 'how to get those? enter command /save and it will automatically save to your Documents/GTA San Andreas User Files/SAMP/savedpositions.txt' |
Nice but a bit shady at this point:
Newbos might not know where to input the /save command so you should've told us/them to go ingame and type the /save [TEXT] command! But nice one buddy |
public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(gps,3,cmdtext); return 0; } dcmd_gps(playerid, params[]) { #pragma unused params if(!IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid,0xAFAFAFAA,"You're not in a vehicle"); return 1; } ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST,"GPS System","Locations,"Choose","Cancel"); SendClientMessage(playerid,COLOR_YELLOW,"To Cancel Gps use /gpsoff"); return 1; return 1; } |
ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST,"GPS System","Locations","Choose","Cancel");
Wrong!, if you compile it, you would get atleast 1 error
pawn Code:
![]() |
SendClientMessage(playerid, -1, "I'm awesome and you know it");