Advertisement
Guest User

dock's GPS system

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