Guest User

GPS Sistem v1.0

a guest
Sep 27th, 2016
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. //==============================================================================
  2. // GPS Sistem / Andrijevic
  3. // Verzija: 1.0
  4. //==============================================================================
  5. //============================= [ INCLUDE ] ====================================
  6. #include <a_samp>
  7. #include <zcmd>
  8. //============================= [ DEFINE ] =====================================
  9. #define SCM SendClientMessage
  10. #define COLOR_RED 0xAA3333AA
  11. #define COL_RED "{F81414}"
  12. #define COLOR_YELLOW 0xDABB3EAA
  13. #define COL_YELLOW "{F3FF02}"
  14. #define GPSDIALOG 1
  15. new use_gps[MAX_PLAYERS];
  16. //==============================================================================
  17. public OnFilterScriptInit() { print("GPS sistem ucitan."); return true; }
  18.  
  19. public OnFilterScriptExit() { print("GPS sistem iskljucen."); return true; }
  20.  
  21. CMD:gps(playerid, params[])
  22. {
  23. if(!IsPlayerDriver(playerid)) return SCM(playerid,COLOR_RED,"[GPS]:"#COL_YELLOW" Morate biti u vozilu!");
  24. ShowPlayerDialog(playerid,GPSDIALOG,DIALOG_STYLE_LIST ,"| GPS sistem |","Glavni Burg\nPD\nAutoSalon Grotti\n24/7 Prodavnica\nGun Shop\nBolnica\nBanka","Odaberi","Odustani");
  25. return true;
  26. }
  27.  
  28. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  29. {
  30. if(dialogid == GPSDIALOG)
  31. {
  32. if(response)
  33. {
  34. switch(listitem)
  35. {
  36. case 0:
  37. {
  38. use_gps[playerid] = 1;
  39. SetPlayerCheckpoint(playerid,1315.6443,-904.2128,38.9331,3.0);
  40. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"Glavni Burg"#COL_YELLOW"! ");
  41. }
  42. case 1:
  43. {
  44. use_gps[playerid] = 1;
  45. SetPlayerCheckpoint(playerid,1553.7538,-1675.4840,16.1953,3.0);
  46. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"PD"#COL_YELLOW"!");
  47. }
  48. case 2:
  49. {
  50. use_gps[playerid] = 1;
  51. SetPlayerCheckpoint(playerid,556.7983,-1255.9104,17.0702,3.0);
  52. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"AutoSalon Grotti"#COL_YELLOW"!");
  53. }
  54. case 3:
  55. {
  56. use_gps[playerid] = 1;
  57. SetPlayerCheckpoint(playerid,1315.6443,-904.2128,38.9331,3.0);
  58. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"24/7 Prodavnicu"#COL_YELLOW"!");
  59. }
  60. case 4:
  61. {
  62. use_gps[playerid] = 1;
  63. SetPlayerCheckpoint(playerid,1365.0654,-1279.8607,13.5469,3.0);
  64. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"Gun Shop"#COL_YELLOW"!");
  65. }
  66. case 5:
  67. {
  68. use_gps[playerid] = 1;
  69. SetPlayerCheckpoint(playerid,1172.8307,-1323.3011,15.4001,3.0);
  70. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"Bolnica"#COL_YELLOW"!");
  71. }
  72. case 6:
  73. {
  74. use_gps[playerid] = 1;
  75. SetPlayerCheckpoint(playerid,1462.0543,-1011.3368,26.8438,3.0);
  76. SendClientMessage(playerid, COLOR_RED, "[GPS]:"#COL_YELLOW" Namestili ste vašu GPS lokaciju na "#COL_RED"Banku"#COL_YELLOW"!");
  77. }
  78. }
  79. }
  80. }
  81. return true;
  82. }
  83.  
  84. public OnPlayerEnterCheckpoint(playerid)
  85. {
  86. if(use_gps[playerid] == 1)
  87. {
  88. DisablePlayerCheckpoint(playerid);
  89. }
  90. return true;
  91. }
  92.  
  93. stock IsPlayerDriver(playerid)
  94. {
  95. if(IsPlayerConnected(playerid) && GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
  96. {
  97. return true;
  98. }
  99. return false;
  100. }
  101. //==============================================================================
  102. // KRAJ SKRIPTE - ANDRIJEVIC
  103. // BICE UPDATE - ANDRIJEVIC
  104. // NOVE LOKACIJE I SVASTA NESTP
Advertisement
Add Comment
Please, Sign In to add comment