Home
Intel Depot
Editors Depot
Missions Depot
Addons Depot
Forum
Home
Help
Search
Login
Register
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
Get vehicle type.
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: Get vehicle type. (Read 767 times)
0 Members and 2 Guests are viewing this topic.
CopyrightPhilly
Guest
Get vehicle type.
«
on:
22 Dec 2004, 12:23:41 »
i'm been searching the forums and the command reference but i couldnt find anything.
How would i return the type (not name) of a vehicle?
Say the vehicle is a Abrams it would return "M1Abrams"
cheers
Logged
Artak
The old beanbag shaker
Former Staff
You want to talk about it, yes?
Re:Get vehicle type.
«
Reply #1 on:
22 Dec 2004, 12:33:11 »
vehicletype =
typeOf
unitname
:wave:
Logged
Not all is lost.
CopyrightPhilly
Guest
Re:Get vehicle type.
«
Reply #2 on:
22 Dec 2004, 12:42:25 »
yeai i tryed that but like the following:
vehicle init:
[this] exec "script.sqs"
script.sqs:
_unit=_this select 0
_type = typeOf _unit
hint format["%1",_type]
end
but when i run that i get an error with the _unit part:
_type = typeOf #_unit
any ideas?
cheers
«
Last Edit: 22 Dec 2004, 12:42:51 by CopyrightPhilly
»
Logged
Artak
The old beanbag shaker
Former Staff
You want to talk about it, yes?
Re:Get vehicle type.
«
Reply #3 on:
22 Dec 2004, 12:48:46 »
Hmm.. Can't see anything wrong with it. Try hint format ["%1",_unit] and see what it gives you.
by the way, what version are you running? typeof was added in 1.85 or was it 1.91 :-X
Logged
Not all is lost.
CopyrightPhilly
Guest
Re:Get vehicle type.
«
Reply #4 on:
22 Dec 2004, 12:51:11 »
that would explane why that one dosnt work then...
I am making it for 1.46 and not res...
is there any way to do it for 1.46?
cheers
Logged
Artak
The old beanbag shaker
Former Staff
You want to talk about it, yes?
Re:Get vehicle type.
«
Reply #5 on:
22 Dec 2004, 12:56:35 »
No not that I know of.
That's why the typeof command was added, to solve situations like this. :-\
Logged
Not all is lost.
CopyrightPhilly
Guest
Re:Get vehicle type.
«
Reply #6 on:
22 Dec 2004, 12:58:16 »
k, what i'll do then is add the type the the exec...
so say:
[this,M1Abrams] exec "script.sqs"
that should solve me problem...
thanks for the help anyway Artak
Logged
Triggerhappy
Contributing Member
Llama, it's what's for dinner.
Re:Get vehicle type.
«
Reply #7 on:
22 Dec 2004, 13:47:57 »
vehicle types are strings, so it would be "M1Abrams"
Logged
Sliding plane crash script
Arrest script
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
Get vehicle type.
Top of page