Jump to content

!speed


Guest Mentos

Recommended Posts

Argh this cmd is p*ssing me off, I just cant get the coding right,

Could anyone please show me the !speed coding, because I dont know what the thing is (e.g. $mta.speed)

Link to comment

It's not as simple as that, the speed script works by first getting the players coordinates, then it sets a 1 second time and once that second is up it grabs the players new coordinates and works out the speed the player is travelling at by using the formula:

speed = distance / time

You may want to ask in the Addons section for more help.

Link to comment

here we go

on *:SIGNAL:mta.command:{
 if ($3 == !speed) {
   var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
   if (%a == -1) mta.msg $1 $2 Error - Absent ID/Name
   else !.timer 1 1 mta.speed $1 %a $mta.location($1,%a,x) $mta.location($1,%a,y) $mta.location($1,%a,z)
 }
}
alias mta.speed {
 var %x = $mta.location($1,$2,x),%y = $mta.location($1,$2,y),%z = $mta.location($1,$2,z),%a = $calc(%x - $3),%b = $calc(%y - $4),%c = $calc(%z - $5),%d = $round($sqrt($calc(%a * %a + %b * %b + %c * %c)),2)
 else mta.say $1 $mta.name($1,$2) is travelling at $round($calc(%d * 2.236),2) Miles per hour
}

but cant say it'll always show your real speed cause of mta lags..

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...