[Include] [INC] Distance Traveled
#1

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!
Reply
#2

Nice work !
Reply
#3

Wow nice
Good Job.. Im going to use this
Reply
#4

I really suggest you to read ****** topic about callback hooking
Reply
#5

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

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?
Reply
#7

nice job
Reply
#8

From the pictures and the description, this seems awesome
Reply
#9

Maybe add too km/h ?
Reply
#10

will it save ?
Reply
#11

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.
Reply
#12

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

/Artix
Reply
#13

very nice job
Reply
#14

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
Reply
#15

Nice, using that.
Reply
#16

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;"?
Reply
#17

Good job
Reply
#18

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

#indlude <DT>

Reply
#19

Link Dead.
Reply
#20

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


Forum Jump:


Users browsing this thread: 2 Guest(s)