OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: OFPfreak 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:
_howfast = speed car
#loop
hint format ["your car is travelling %1 kilometers an hour",_howfast]
~0.25
? _time < 5 : goto "loop"
-
the syntax is correct, although in this instance i'd put the
_howfast = speed car
inside the loop so that it updates every 0.25 seconds.
-
It now says the same as before!
It says:
Your car is travelling scalar bool array string 0xfcfffffcf kilometers per hour!
What is wrong!?
-
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
#loop
_howfast = speed player
hint format ["your car is travelling %1 kilometers an hour",_howfast]
~0.25
? _time < 5 : goto "loop"
-
try renameing the car...
or
execute the script by its init line
[this] exec "scriptname.sqs"
sqs file:
_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"
-
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!
-
lmao
-
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!