OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: CopyrightPhilly 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
-
vehicletype = typeOf unitname
:wave:
-
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
-
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
-
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
-
No not that I know of.
That's why the typeof command was added, to solve situations like this. :-\
-
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
-
vehicle types are strings, so it would be "M1Abrams"