SA-MP Forums Archive
[Include] [INC] Distance Traveled - 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] [INC] Distance Traveled (/showthread.php?tid=91815)

Pages: 1 2


[INC] Distance Traveled - StrickenKid - 16.08.2009

Ethan's Distance Traveled Include v1.0
About:
This include records the distance a player has walked, ran, driven, flew, in feet and more! Great for roleplay servers, and stunt servers! It even has a built in textdraw that can be turned on or off in the script.

Picture:


Bugs:
None so far!

Install:
pawn Code:
1. Place the following under the appropriate callbacks:
    -   DT_OnGameModeInit();
    -   DT_OnPlayerRequestClass(playerid);
    -   DT_OnPlayerConnect(playerid);
    -   DT_OnPlayerDisconnect(playerid);
    -   DT_OnPlayerSpawn(playerid);
    -   DT_OnPlayerDeath(playerid);
    -   DT_OnPlayerInteriorChange(playerid);
    2. And Place this at the top of your script:
    -   #indlude <DT>
    3. If you want to save players distance traveled use the folowing variable:
    -   Distance[playerid]
    4. Have Fun!
Download v1.0

Enjoy!



Re: [INC] Distance Traveled - Takumi.WS - 16.08.2009

Nice work !


Re: [INC] Distance Traveled - Fj0rtizFredde - 16.08.2009

Wow nice
Good Job.. Im going to use this


Re: [INC] Distance Traveled - Google63 - 16.08.2009

I really suggest you to read ****** topic about callback hooking


Re: [INC] Distance Traveled - kavkus - 16.08.2009

Wow, very good.
But You can modify it, that its a Distance for the vehicle.
But nice Script.


Re: [INC] Distance Traveled - StrickenKid - 17.08.2009

Quote:
Originally Posted by kavkus
Wow, very good.
But You can modify it, that its a Distance for the vehicle.
But nice Script.
What do you mean?


Re: [INC] Distance Traveled - Eazy_Efolife - 17.08.2009

nice job


Re: [INC] Distance Traveled - XtremeChio - 17.08.2009

From the pictures and the description, this seems awesome


Re: [INC] Distance Traveled - Maniek - 17.08.2009

Maybe add too km/h ?


Re: [INC] Distance Traveled - DauerDicht - 17.08.2009

will it save ?


Re: [INC] Distance Traveled - StrickenKid - 24.08.2009

It saves on death, but if you want it saved to like an account you will have to add the variable in to whatever system you use.


Re: [INC] Distance Traveled - Doppeyy - 27.08.2009

Nice one dude but like someone asked before:
Would it be possible to make it to Meters ?

/Artix


Re: [INC] Distance Traveled - James_Alex - 27.08.2009

very nice job


Re: [INC] Distance Traveled - LarzI - 04.11.2009

Quote:
Originally Posted by ◄[DirtyDutch
αятιχ► ]
Nice one dude but like someone asked before:
Would it be possible to make it to Meters ?

/Artix
According to ****** "1 foot = 0.3048 meters"
And when you know this, you can easily modify this yourself.

pawn Код:
format(Str, sizeof(Str),"Distance Traveled: ~y~%d ft", Distance[i]);
You see this line?
If I'm not totally wrong, all you need to do is changing that to:

pawn Код:
format(Str, sizeof(Str),"Distance Traveled: ~y~%d m", (Distance[i]*0.3048));
If you want KM, just do

pawn Код:
format(Str, sizeof(Str),"Distance Traveled: ~y~%d km", ((Distance[i]*0.3048)/1000));
Sorry if this is totally wrong, but I believe this would work.


EDIT:
Quote:
Originally Posted by E-Max
Maybe add too km/h ?
If my code above work, you just have to set a timer to check how far you have driven in like 1000ms (1second) then multiply it with 3600 to get hours.
And there you go, km/h


Re: [INC] Distance Traveled - Striker_Moe - 04.11.2009

Nice, using that.


Re: [INC] Distance Traveled - RoamPT - 04.11.2009

Quote:

Note:
If your server has teleports, make sure to use the folowing when
a player is teleported or it will count the distance of the teleport:
- CheckDelay[playerid] = 2;
The 2 means two seconds which is the time the timer will not count
the movement

So where i place the: "CheckDelay[playerid] = 2;"?


Re: [INC] Distance Traveled - DiddyBop - 12.12.2009

Good job


Re: [INC] Distance Traveled - Abernethy - 12.12.2009

Nice work man, but you spelt include from in the installation.
Quote:

#indlude <DT>




Re: [INC] Distance Traveled - rom1-84 - 09.06.2010

Link Dead.


Re: [INC] Distance Traveled - alpha500delta - 09.06.2010

Quote:
Originally Posted by rom1-84
Link Dead.
Bumped .