OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Abrams_MBT on 08 Oct 2005, 08:44:23

Title: Some questions.... plz help!
Post by: Abrams_MBT on 08 Oct 2005, 08:44:23
Id like to...
1)lock west vehicles for soviets and east vehicles for US,

2)respawn vehicles when they are dead (but not when they are abandonned) but without multiple respawn!

3)let script run when vehicles respawn (i made a carbomb script, based on other scripts (thank you for that those who made that!), and when vehicles respawn, script are...forgotten.

thank you for your help guys....
Title: Re:Some questions.... plz help!
Post by: macguba on 08 Oct 2005, 09:43:55
Abrams_MBT,

Welcome to the forum!

I have a feeling in my water that these are MP questions.    Is that so?    We have a dedicated board for MP and if these are MP questions please say, and somebody will move this thread over there.   Thanks.
Title: Re:Some questions.... plz help!
Post by: THobson on 08 Oct 2005, 09:44:37
1. Can't be done without writing a script.  Vehicles are either locked or not. The script should be activated by a {getIn} EventHandler attached to each vehicle that detects the side of the unit that is getting in and throws them out if they are the wrong side.  Look at this:
http://www.ofpec.com/editors/resource_view.php?id=543

2. Run a script from the init field of each vehicle that:  detects if the vehicle's damage is > 0.98, if it is set it to 1 and then respawn a new vehicle.  EG:
@ (getDammage _veh > 0.98)
_veh setDammage 1
create new unit here

3. createUnit allows you to put instructions in the init field of the new unit.  See this:
http://www.ofpec.com/editors/comref.php?letter=C#createUnit