OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: edgren on 09 Jun 2008, 00:47:18
-
Hi!
I have some problems with the subject saying. Have typed player addVehicle Sedan; but I only get a error-message in the game. I guess that you already know what this message says ;) But how can I spawn a vehicle through a SQS-file? I can't find any example-code in the COMREF-pages.
-
nul = "Sedan" createVehicle getPos player
nul = "Sedan" createVehicle getPos player;
nul = "Sedan" createVehicle getPos player;
http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=c#86
http://community.bistudio.com/wiki/ArmA:_Vehicles
CreateVehicle not AddVehicle, nice try though. :good:
-
Hehe, thanks :) But I can't get in to my "newspawned" car :/ Why?
-
First you need to name the vehicle, instead of "nul" use something like car1:
car1= "Sedan" createVehicle getPos player;
Then you need to reveal it to yourself:
Player reveal car1
Now you should be able to get inside it right from the get-go :) Otherwise, just right-click on the car (the default key for "spotting") and the actions should show up soon enough. Basically what happens is that your character (Player) does not know the car exists yet, and needs a little while to figure it out - unless you reveal it to him, as showed.
Good luck!
Wolfrug out.
-
You can also createVehicle Array, using something like
;SpawnVeh.sqs
;place an invisible H pad on your map
;& name it SpawnPoint.
;Call the script via trigger using
;[] exec "SpawnVeh.sqs"
_veh = createVehicle ["car_sedan", position SpawnPoint, [], 0, "NONE"];
exit
useful when spawning aircraft in some situations
-
First you need to name the vehicle, instead of "nul" use something like car1:
car1= "Sedan" createVehicle getPos player;
Then you need to reveal it to yourself:
Player reveal car1
Now you should be able to get inside it right from the get-go :) Otherwise, just right-click on the car (the default key for "spotting") and the actions should show up soon enough. Basically what happens is that your character (Player) does not know the car exists yet, and needs a little while to figure it out - unless you reveal it to him, as showed.
Good luck!
Wolfrug out.
Im spawning a car through addAction and Im just wonder how I can reveal the given car to a player through this?