SA-MP Forums Archive
[Include] S32GPS - Create a GPS location with just one line! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] S32GPS - Create a GPS location with just one line! (/showthread.php?tid=282725)



S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

Introduction

Hi all

I saw a lot of GPS filterscripts, all are the same, just commands in dialog, some locations, that's not cool
so I decide to make something new!

You can create GPS location or destroy it with just one line!

You don't have to use DisablePlayerCheckpoint etc. I made that

Also add this in top of your script:
pawn Code:
#include <S32GPS>

Functions

- CreateDynamicGPS(playerid, Float: X, Float: Y, Float: Z, Float: Size) - Parameters are same as SetPlayerCheckpoint!
- DestroyDynamicGPS(playerid) - Just removing checkpoint if it's started!

I'll add them more soon!


Commands

There is no commands, you will have to create your command!
Please use this in commands that are not for GPS (For example when you starts some race with that command!)
otherewise your race script or whatever else will get bugged!
pawn Code:
if(GPSStarted[playerid] == 1)
{
//your code
}
Credits

System32 - Made whole include!
H265 - He teach me how to use same function more times!
BlackBank3 - Fixed little "bug"!


Video

[ame]http://www.youtube.com/watch?v=CTf6r-B0RxM[/ame]

Download

Here is the download!

Pastebin!



Mediafire!




Re: S32GPS - Create a GPS location with just one line! - wups - 12.09.2011

Basic, I don't see any difference from:
pawn Code:
new playerSetGps[MAX_PLAYERS];


SetPlayerCheckpoint(playerid, X, Y, Z, Size);
playerSetGps[playerid]=1;

public OnPlayerEnterCheckpoint(playerid)
{
   if(playerSetGps[playerid])
   {
        playerSetGps[playerid]=0;
    DisablePlayerCheckpoint(playerid);
    SendClientMessage(playerid, -1, "You have reached your destination!");
    return 1;
   }
}



Re: S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

ohh there is a lot of difference, if you use that, you could use just for one GPS location!

Take a look at the code!


Re: S32GPS - Create a GPS location with just one line! - TheArcher - 12.09.2011

It's basicaly easy. But good job.


Re: S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

Quote:
Originally Posted by TheArcher
View Post
It's basicaly easy. But good job.
yeah I now, I'm gona create more functions like GetDynamicGPSX, Y, Z, Size etc.


Re: S32GPS - Create a GPS location with just one line! - TheArcher - 12.09.2011

Quote:
Originally Posted by System64
View Post
yeah I now, I'm gona create more functions like GetDynamicGPSX, Y, Z, Size etc.
Add in the descriptopn the natives to know.


Re: S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

Quote:
Originally Posted by Y_Less
View Post
This code just won't work:

pawn Code:
Set_GPS[sizeof(GPS)]
That is just:

pawn Code:
Set_GPS[1]
Which will only ever allow you to have one checkpoint (without corrupting data) and I'm sure should give you a compiler warning.
No, 'cause in funcion for creating cp (CreateDynamicGPS) I increase that variable for one more, you will see it in the video, I have 2 CP and one normal and everything works


Re: S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

So, you have a better way?

This works grate for me!


Re: S32GPS - Create a GPS location with just one line! - wups - 12.09.2011

Quote:
Originally Posted by System64
View Post
So, you have a better way?

This works grate for me!
Works great, because you only test with 1 player.

Set_GPS[MAX_PLAYERS]


Re: S32GPS - Create a GPS location with just one line! - System64 - 12.09.2011

@TheArcher - Hahaha ma' man!
Quote:
Originally Posted by wups
View Post
Works great, because you only test with 1 player.

Set_GPS[MAX_PLAYERS]
Why I need it? I want to al players can use /gps or whatever, I think that I don't need it, with that only one player will be abel to use /gps or all but than I have to use for etc. no complicating