Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: hinto on January 12, 2009, 01:44:27 pm

Title: [help]Can some1 give Spidometer code?
Post by: hinto on January 12, 2009, 01:44:27 pm
Can someone give me a Spidometer code for server ?
Title: Re: [help]Can some1 give Spidometer code?
Post by: thijn on January 12, 2009, 06:36:51 pm
U mean like in NoN :o
Title: Re: [help]Can some1 give Spidometer code?
Post by: hinto on January 12, 2009, 07:41:25 pm
Yes
Title: Re: [help]Can some1 give Spidometer code?
Post by: youlikethaaaat 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
Title: Re: [help]Can some1 give Spidometer code?
Post by: VRocker 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.
Title: Re: [help]Can some1 give Spidometer code?
Post by: thijn 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
Title: Re: [help]Can some1 give Spidometer code?
Post by: Zack 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?
Title: Re: [help]Can some1 give Spidometer code?
Post by: Tamas on February 09, 2009, 09:32:55 pm
Add it under:
on *:SIGNAL:vcmp.player.move:{
Title: Re: [help]Can some1 give Spidometer code?
Post by: Zack on February 10, 2009, 09:23:13 pm
Add it under:
on *:SIGNAL:vcmp.player.move:{
Sorry, but where can i find that then?
Title: Re: [help]Can some1 give Spidometer code?
Post by: thijn 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 :-\
Title: Re: [help]Can some1 give Spidometer code?
Post by: Zack 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?
Title: Re: [help]Can some1 give Spidometer code?
Post by: thijn on February 11, 2009, 06:51:30 pm
Yes, You can, But you need to rescript all things :'(
Title: Re: [help]Can some1 give Spidometer code?
Post by: [AoD]NC 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 ?
Title: Re: [help]Can some1 give Spidometer code?
Post by: [XT]ariel[X] on October 21, 2009, 03:30:40 am
link fail :(