Guest User

GPS system by Tika Spic (dock)

a guest
Aug 25th, 2012
1,346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.75 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3.  
  4. #define MAX_GPS 36
  5.  
  6. #define DIALOG_GPS      7986
  7.  
  8. enum gInfo
  9. {
  10.     gName[128],
  11.     Float:gX,
  12.     Float:gY,
  13.     Float:gZ
  14. }
  15. new GPSInfo[MAX_GPS][gInfo];
  16.  
  17. new GPS = 0;
  18. new gpsstr[256];
  19. new GPS_Activated[MAX_PLAYERS] = 0;
  20.  
  21. stock AddGPS(name[], Float:x, Float:y, Float:z)
  22. {
  23.     GPS++;
  24.     format(GPSInfo[GPS][gName],256,"%s",name);
  25.     GPSInfo[GPS][gX] = x;
  26.     GPSInfo[GPS][gY] = y;
  27.     GPSInfo[GPS][gZ] = z;
  28.     return 1;
  29. }
  30.  
  31.  
  32. public OnFilterScriptInit()
  33. {
  34.     print(" [][]> GPS System by dock LOADED!");
  35.  
  36.     AddGPS("Burger Shot", 1174.7587,-905.0877,43.0052);
  37.     AddGPS("Los Santos PD", 1523.4817,-1681.0198,13.2347);
  38.    
  39.     for(new i = 0; i < GPS+1; i++)
  40.     {
  41.         if(i != 0)
  42.         {
  43.             if(i == 1) format(gpsstr,256,"%s\n",GPSInfo[i][gName]);
  44.             if(i != 1) format(gpsstr,256,"%s%s\n",gpsstr,GPSInfo[i][gName]);
  45.         }
  46.     }
  47.     return 1;
  48. }
  49.  
  50. CMD:gps(playerid,params[])
  51. {
  52.     if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xff0000aa, " [GPS] You are not in a vehicle!");
  53.     ShowPlayerDialog(playerid, DIALOG_GPS, DIALOG_STYLE_LIST, " GPS:", gpsstr, "Choose", "Cancel");
  54.     return 1;
  55. }
  56. CMD:gpsoff(playerid,params[])
  57. {
  58.     if(GPS_Activated[playerid] == 1)
  59.     {
  60.         DisablePlayerCheckpoint(playerid);
  61.         SendClientMessage(playerid, 0xffff00aa, " [GPS] You turned your GPS off!");
  62.         GPS_Activated[playerid] = 0;
  63.     }
  64.     return 1;
  65. }
  66.  
  67. public OnFilterScriptExit()
  68. {
  69.     return 1;
  70. }
  71.  
  72. public OnPlayerRequestClass(playerid, classid)
  73. {
  74.     return 1;
  75. }
  76.  
  77. public OnPlayerConnect(playerid)
  78. {
  79.     return 1;
  80. }
  81.  
  82. public OnPlayerDisconnect(playerid, reason)
  83. {
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerSpawn(playerid)
  88. {
  89.     return 1;
  90. }
  91.  
  92. public OnPlayerDeath(playerid, killerid, reason)
  93. {
  94.     return 1;
  95. }
  96.  
  97. public OnVehicleSpawn(vehicleid)
  98. {
  99.     return 1;
  100. }
  101.  
  102. public OnVehicleDeath(vehicleid, killerid)
  103. {
  104.     return 1;
  105. }
  106.  
  107. public OnPlayerText(playerid, text[])
  108. {
  109.     return 1;
  110. }
  111.  
  112. public OnPlayerCommandText(playerid, cmdtext[])
  113. {
  114.     return 0;
  115. }
  116.  
  117. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  118. {
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerExitVehicle(playerid, vehicleid)
  123. {
  124.     return 1;
  125. }
  126.  
  127. public OnPlayerStateChange(playerid, newstate, oldstate)
  128. {
  129.     return 1;
  130. }
  131.  
  132. public OnPlayerEnterCheckpoint(playerid)
  133. {
  134.     if(GPS_Activated[playerid] == 1)
  135.     {
  136.         SendClientMessage(playerid, 0xffff00aa, " [GPS] You have arrived at your destenation!");
  137.         DisablePlayerCheckpoint(playerid);
  138.         GPS_Activated[playerid] = 0;
  139.     }
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerLeaveCheckpoint(playerid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerEnterRaceCheckpoint(playerid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerLeaveRaceCheckpoint(playerid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnRconCommand(cmd[])
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerRequestSpawn(playerid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnObjectMoved(objectid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerObjectMoved(playerid, objectid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerPickUpPickup(playerid, pickupid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnVehicleMod(playerid, vehicleid, componentid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerSelectedMenuRow(playerid, row)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnPlayerExitedMenu(playerid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnRconLoginAttempt(ip[], password[], success)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnPlayerUpdate(playerid)
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerStreamIn(playerid, forplayerid)
  229. {
  230.     return 1;
  231. }
  232.  
  233. public OnPlayerStreamOut(playerid, forplayerid)
  234. {
  235.     return 1;
  236. }
  237.  
  238. public OnVehicleStreamIn(vehicleid, forplayerid)
  239. {
  240.     return 1;
  241. }
  242.  
  243. public OnVehicleStreamOut(vehicleid, forplayerid)
  244. {
  245.     return 1;
  246. }
  247.  
  248. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  249. {
  250.     if(dialogid == DIALOG_GPS)
  251.     {
  252.         if(!response) return 1;
  253.         if(listitem == GPS+1) return 1;
  254.         SetPlayerCheckpoint(playerid, GPSInfo[listitem+1][gX], GPSInfo[listitem+1][gY], GPSInfo[listitem+1][gZ],5.0);
  255.         GPS_Activated[playerid] = 1;
  256.         return 1;
  257.     }
  258.     return 1;
  259. }
  260.  
  261. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  262. {
  263.     return 1;
  264. }
  265.  
  266. public OnEnterExitModShop(playerid,enterexit,interiorid)
  267. {
  268.     return 1;
  269. }
  270.  
  271. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
  272. {
  273.     return 1;
  274. }
  275.  
  276. public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
  277. {
  278.     return 1;
  279. }
  280.  
  281. public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
  282. {
  283.     return 1;
  284. }
  285.  
  286. public OnVehicleDamageStatusUpdate(vehicleid, playerid)
  287. {
  288.     return 1;
  289. }
Advertisement
Add Comment
Please, Sign In to add comment