Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * S32GPS - Create GPS location with just one line!
- * Copyright(c)System32
- * This file is provided as is (no warranties)
- */
- #if defined _S32GPS_included
- #endinput
- #endif
- #define _S32GPS_included
- #include <a_samp>
- #include <YSI\y_hooks>
- new GPS = -1, Set_GPS[MAX_PLAYERS][20], GPSStarted[MAX_PLAYERS];
- stock CreateDynamicGPS(playerid, Float: X, Float: Y, Float: Z, Float: Size)
- {
- GPSStarted[playerid] = 1;
- SetPlayerCheckpoint(playerid, X, Y, Z, Size);
- Set_GPS[playerid][GPS] = GPS;
- return 1;
- }
- stock DestroyDynamicGPS(playerid)
- {
- if(GPSStarted[playerid] == 1)
- {
- if(Set_GPS[playerid][GPS])
- {
- GPS -= 1;
- Set_GPS[playerid][GPS] = -1;
- GPSStarted[playerid] = 0;
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, -1, "Checkpoint is disabled!");
- return 1;
- }
- }
- else SendClientMessage(playerid, 0xFF0000FF, "GPS isn't started!");
- return 0;
- }
- Hook:G1_OnPlayerEnterCheckpoint(playerid)
- {
- if(GPSStarted[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, -1, "You have reached your destination!");
- GPS -= 1;
- Set_GPS[playerid][GPS] = -1;
- GPSStarted[playerid] = 0;
- }
- else DisablePlayerCheckpoint(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement