Home   Help Search Login Register  

Author Topic: speed checker, 1 simple stupid last thing  (Read 1010 times)

0 Members and 1 Guest are viewing this topic.

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
speed checker, 1 simple stupid last thing
« on: 26 Jun 2005, 09:25:32 »
I've got a script here to test my speed of the car, but theres 1 stupid last thing.
a hint format. How do I insert that? I've got:

Code: [Select]
_howfast = speed car

#loop

hint format ["your car is travelling %1 kilometers an hour",_howfast]
~0.25
? _time < 5 : goto "loop"
« Last Edit: 26 Jun 2005, 09:30:00 by OFPfreak »
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:speed checker, 1 simple stupid last thing
« Reply #1 on: 26 Jun 2005, 09:36:57 »
the syntax is correct, although in this instance i'd put the

Code: [Select]
_howfast = speed car
inside the loop so that it updates every 0.25 seconds.

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:speed checker, 1 simple stupid last thing
« Reply #2 on: 26 Jun 2005, 10:02:56 »
It now says the same as before!
It says:

Your car is travelling scalar bool array string 0xfcfffffcf kilometers per hour!

What is wrong!?
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:speed checker, 1 simple stupid last thing
« Reply #3 on: 26 Jun 2005, 10:05:14 »
i personally wouldn't use 'car' as the name of a unit, as it may cause confusion in flashpoint, there being models called 'car'.

try

Code: [Select]
#loop

_howfast = speed player
hint format ["your car is travelling %1 kilometers an hour",_howfast]
~0.25
? _time < 5 : goto "loop"
« Last Edit: 26 Jun 2005, 10:08:00 by bedges »

CopyrightPhilly

  • Guest
Re:speed checker, 1 simple stupid last thing
« Reply #4 on: 26 Jun 2005, 10:06:11 »
try renameing the car...
or
execute the script by its init line
Code: [Select]
[this] exec "scriptname.sqs"
sqs file:
Code: [Select]
_vehicle = _this select 0
_howfast = speed _vehicle

#loop
hint format ["your car is travelling %1 kilometers an hour",_howfast]
~0.25
? _time < 5 : goto "loop"
« Last Edit: 26 Jun 2005, 10:06:49 by CopyrightPhilly »

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:speed checker, 1 simple stupid last thing
« Reply #5 on: 26 Jun 2005, 10:07:47 »
OOPS the car name is car1 not car! :D!

edit: Hm car1 didnt work either, I'm trying your ideas guys!
btw what does the _vehicle = this select 0 command do? the _ makes it a script only name right?

edit: OOPS again! I forgot to add a _ to howfast in the hintformat! Its got to work now!
« Last Edit: 26 Jun 2005, 10:11:20 by OFPfreak »
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage

CopyrightPhilly

  • Guest
Re:speed checker, 1 simple stupid last thing
« Reply #6 on: 26 Jun 2005, 10:08:25 »
lmao

Offline OFPfreak

  • Members
  • *
  • Who is da operation flashpoint freak now, freak?!
    • OFP NFS mod
Re:speed checker, 1 simple stupid last thing
« Reply #7 on: 26 Jun 2005, 10:12:34 »
IT WORKS NOW!!! It was showing 0 becuase there was no one called "player" so I renamed it car1 and it shows it perfectly and very exact like 38.593485349534 kph!

the speed checker is in the attachment and propably works on soldiers as well!
« Last Edit: 26 Jun 2005, 10:19:23 by OFPfreak »
ofp nfs REBORN! All new nitro, neon, customized cars, off-road, on-road, rally, bikes, racer models and more!
ofp nfs's homepage