SA-MP Forums Archive
Use Checkpoints - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Use Checkpoints (/showthread.php?tid=67780)



Use Checkpoints - Justsmile - 04.03.2009

Good Morning,

I have a little problem. I want to create my own navigator, but i don't know how to do this. How can I make Checkpoints. I will explain exactly what I need.
A player use the command /navigaotor LSPD and the Checkpoints is set on the LSPD(the coords i /save) and when you arriver the Checkpoints dissappear and a Textmessagt said: You arrive your chosen destination. Can anyone help me?
I have searched but nothing found yet.

mfg JustSmile


Re: Use Checkpoints - Magician - 04.03.2009

[FS] LSNav System by GtaSkilled_


Re: Use Checkpoints - Justsmile - 04.03.2009

thanks. Thats what i am searching for. But how can i Add this to my GM. Maybe you can explain?!


Re: Use Checkpoints - Magician - 04.03.2009

You can add it as filterscript


Re: Use Checkpoints - Justsmile - 04.03.2009

yes, i know. But i want it in my GM its better.


Re: Use Checkpoints - Magician - 04.03.2009

Bah...
Ok.
Add this under #include <a_samp>:
pawn Код:
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLACK 0x000000FF
Add this in end of script:
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
  PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
  DisablePlayerCheckpoint(playerid);
  GameTextForPlayer(playerid, "~w~You have~n~~y~arrived", 5000, 1);
  return 1;
}
Add this in OnPlayerCommandText:
pawn Код:
if(strcmp(cmdtext, "/navhelp", true) == 0)
  {
    SendClientMessage(playerid, COLOR_BLACK, "___________________LSNav Help________________________");
    SendClientMessage(playerid, COLOR_YELLOW, "LSNav - /pd /hospital /airport /pier /grove");
    SendClientMessage(playerid, COLOR_YELLOW, "LSNav - /clear /gym /tower");
    return 1;
  }
  if(strcmp(cmdtext, "/pd", true) == 0)
  {
     SetPlayerCheckpoint(playerid,1529.6,-1691.2,13.3,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~g~Los Santos PD", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/hospital", true) == 0)
  {
    SetPlayerCheckpoint(playerid,2029.5945,-1404.6426,17.2512,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~g~Hospital", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/airport", true) == 0)
  {
    SetPlayerCheckpoint(playerid,1963.7876,-2195.5500,13.5469,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~g~LS Airport", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/pier", true) == 0)
  {
    SetPlayerCheckpoint(playerid,839.5338,-2057.8774,12.8672,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~g~LS pier", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/grove", true) == 0)
  {
    SetPlayerCheckpoint(playerid,2492.6826,-1674.1060,13.3359,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~g~Grove Street", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/clear", true) == 0)
  {
    DisablePlayerCheckpoint(playerid);
    GameTextForPlayer(playerid, "~w~Nav SYS ~g~Cleared", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/gym", true) == 0)
  {
    SetPlayerCheckpoint(playerid,2267.8606,-1723.5905,13.5469,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~r~Gym", 5000, 1);
    return 1;
  }
  if(strcmp(cmdtext, "/tower", true) == 0)
  {
    SetPlayerCheckpoint(playerid,1558.4553,-1349.3193,329.4609,4.0);
    GameTextForPlayer(playerid, "~w~Nav SYS set ~r~LS tower", 5000, 1);
    return 1;
  }
Done.


Re: Use Checkpoints - Justsmile - 04.03.2009

there is one problem, i have the GF and how have I to write with OnPLayerentercheckpoint. If i use yours i got warnings and errors.