Advertisement
System32

S32_GPS

Sep 12th, 2011
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.26 KB | None | 0 0
  1. /*
  2.  * S32GPS - Create GPS location with just one line!
  3.  * Copyright(c)System32
  4.  * This file is provided as is (no warranties)
  5.  */
  6. #if defined _S32GPS_included
  7.   #endinput
  8. #endif
  9. #define _S32GPS_included
  10.  
  11. #include <a_samp>
  12. #include <YSI\y_hooks>
  13.  
  14. new GPS = -1, Set_GPS[MAX_PLAYERS][20], GPSStarted[MAX_PLAYERS];
  15.  
  16. stock CreateDynamicGPS(playerid, Float: X, Float: Y, Float: Z, Float: Size)
  17. {
  18.     GPSStarted[playerid] = 1;
  19.     SetPlayerCheckpoint(playerid, X, Y, Z, Size);
  20.     Set_GPS[playerid][GPS] = GPS;
  21.     return 1;
  22. }
  23.  
  24. stock DestroyDynamicGPS(playerid)
  25. {
  26.     if(GPSStarted[playerid] == 1)
  27.     {
  28.         if(Set_GPS[playerid][GPS])
  29.         {
  30.            GPS -= 1;
  31.            Set_GPS[playerid][GPS] = -1;
  32.            GPSStarted[playerid] = 0;
  33.            DisablePlayerCheckpoint(playerid);
  34.            SendClientMessage(playerid, -1, "Checkpoint is disabled!");
  35.            return 1;
  36.         }
  37.     }
  38.     else SendClientMessage(playerid, 0xFF0000FF, "GPS isn't started!");
  39.     return 0;
  40. }
  41.  
  42. Hook:G1_OnPlayerEnterCheckpoint(playerid)
  43. {
  44.     if(GPSStarted[playerid] == 1)
  45.     {
  46.         DisablePlayerCheckpoint(playerid);
  47.         SendClientMessage(playerid, -1, "You have reached your destination!");
  48.         GPS -= 1;
  49.         Set_GPS[playerid][GPS] = -1;
  50.         GPSStarted[playerid] = 0;
  51.     }
  52.     else DisablePlayerCheckpoint(playerid);
  53.     return 1;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement