Author Topic: [help]Can some1 give Spidometer code?  (Read 8866 times)

0 Members and 1 Guest are viewing this topic.

Offline hinto

  • Street Thug
  • *
  • Posts: 7
    • View Profile
[help]Can some1 give Spidometer code?
« on: January 12, 2009, 01:44:27 pm »
Can someone give me a Spidometer code for server ?

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [help]Can some1 give Spidometer code?
« Reply #1 on: January 12, 2009, 06:36:51 pm »
U mean like in NoN :o

Offline hinto

  • Street Thug
  • *
  • Posts: 7
    • View Profile
Re: [help]Can some1 give Spidometer code?
« Reply #2 on: January 12, 2009, 07:41:25 pm »
Yes

Offline youlikethaaaat

  • Street Thug
  • *
  • Posts: 4
    • View Profile
Re: [help]Can some1 give Spidometer code?
« Reply #3 on: February 06, 2009, 02:19:39 pm »
U mean like in NoN :o
lol.. =RM= done it originally, justy we give the user the choice to have it on and what unit to use with the !speedo command

dont know why NoN copy my scripts -_-

heres how we've done it:
1) have a timer launching a while loop every second
2) the while loop calculates the distance between the current loc and the loc from previous loop
3) the loc is in mps, so we use a few basic formulas to convert to things such as mp/h and kmph
4) does an announcement to each player if they have it enabled, using the unit they have chose (mps/mph/kmph)
4) then stores the loc
« Last Edit: February 06, 2009, 02:22:02 pm by youlikethaaaat »

Offline VRocker

  • LU Developer
  • Wiseguy
  • *
  • Posts: 63
    • View Profile
    • Liberty Unleashed - GTA3 Multiplayer Mod
Re: [help]Can some1 give Spidometer code?
« Reply #4 on: February 06, 2009, 05:10:46 pm »
Depending what base script you are using, this is fairly easy...

Any script based on my dll will give you access to vcmp.speed. This does all the calculations for you and returns in meters per second. This is easily converted to mph or kmh.

Simplest way is just to throw it on a timer every second or so to check and update the players speed.


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [help]Can some1 give Spidometer code?
« Reply #5 on: February 06, 2009, 05:20:28 pm »
Or just use ur great vcmp.player.move signal, And check in that signal, if the player is in a vehicel ;D

Offline Zack

  • Street Thug
  • *
  • Posts: 17
  • My english is not good, my main language is Dutch.
    • View Profile
Re: [help]Can some1 give Spidometer code?
« Reply #6 on: February 08, 2009, 06:42:07 pm »
Like Thijn said, their is a much simpler way to accomplish this.

Anyone using Vrockers new DLL (advised) has the ability to use the player.move signal.

Here is a cut down version mine.

Note: I have removed most checks relevant to my server, including, spawn checking, Killed in vehicle checking and a few others.

It is probably best if you add these in, for those wary of timers, all can be accomplished without using one.

Nether the less, here is what people want, a speedometer at the bottom of the display in an announce.

http://www.vcmp-toolz.co.nr/speedo.zip

Kind Regards

Luke Rudge

I want too a speedometer, but where did i have to add that script?
I have my own Hamachi server.
I am not allowed to portforward.

Offline Tamas

  • Made Man
  • ***
  • Posts: 127
    • View Profile
    • http://www.tamasnet.eu/
Re: [help]Can some1 give Spidometer code?
« Reply #7 on: February 09, 2009, 09:32:55 pm »
Add it under:
on *:SIGNAL:vcmp.player.move:{

Offline Zack

  • Street Thug
  • *
  • Posts: 17
  • My english is not good, my main language is Dutch.
    • View Profile
Re: [help]Can some1 give Spidometer code?
« Reply #8 on: February 10, 2009, 09:23:13 pm »
Add it under:
on *:SIGNAL:vcmp.player.move:{
Sorry, but where can i find that then?
I have my own Hamachi server.
I am not allowed to portforward.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [help]Can some1 give Spidometer code?
« Reply #9 on: February 10, 2009, 10:52:48 pm »
Sorry, This script is only for the new DLL, And you use the old DLL, So this wont work for you :-\

Offline Zack

  • Street Thug
  • *
  • Posts: 17
  • My english is not good, my main language is Dutch.
    • View Profile
Re: [help]Can some1 give Spidometer code?
« Reply #10 on: February 11, 2009, 04:42:55 pm »
Sorry, This script is only for the new DLL, And you use the old DLL, So this wont work for you :-\

Can i upgrade to a new DLL?
I have my own Hamachi server.
I am not allowed to portforward.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: [help]Can some1 give Spidometer code?
« Reply #11 on: February 11, 2009, 06:51:30 pm »
Yes, You can, But you need to rescript all things :'(

Offline [AoD]NC

  • VC:MP Beta Tester
  • VC:MP Veteran
  • *
  • Posts: 616
  • AoD forever!
    • View Profile
    • KURWA MAĆ
Re: [help]Can some1 give Spidometer code?
« Reply #12 on: March 06, 2009, 06:45:36 pm »
I modified the sample script from rulk, it took an hour to do this. Well it works good.

Code: [Select]
on *:SIGNAL:vcmp.player.move:{
  if ($vcmp.vehicle($1, $2) > 0) {
    if ($vcmp.speed($1, $2) > 10) {
    vcmp.announce $1 $2                    ~o~ $round($calc($vcmp.speed($1, $2) * 3.1), 0) ~x~ kmh $chr(10)  $chr(10)
    }
  }
  else {
  }
  !.signal vcmp.playermove $1-
}

Where  is a special letter, that ur web-browser doesn't display ;p.

The original convert from MPS [?] to KMH => MPS * 3,6 = speed in KMH. I don't used 3,6, only 3,1. I even don't think, that a PCJ can have more than 200 KMH speed :D so i changed it.

I know, this script made by me is not 100% correctly ;) but
* it's only displaying if the player is sitting in a car [vehicle]
* and it's displaying only, if the player is driving faster than 30 km/h. I made this so, cause while a player enter a car, i made a announce, which displays the car health.

For all those, who hasn't a move signal: u can simply add them :). I'm using and modifying FBS, i haven't a MOVE signal there, but i created it and it works :).

Ah and my good question :D : i gotta a 1MBps internet connection. I don't think it's a slow connection, but the speedometer for 1 person is a long combination of commands... Will it lag  :P ?
« Last Edit: March 06, 2009, 06:48:36 pm by [AoD]NC »

Offline [XT]ariel[X]

  • Wiseguy
  • **
  • Posts: 58
  • Hi all!!
    • View Profile
    • American Server
Re: [help]Can some1 give Spidometer code?
« Reply #13 on: October 21, 2009, 03:30:40 am »
link fail :(
Clic in image from enter in my web :D