Jump to content
Sign in to follow this  
Grimfist

alternate init activation

Recommended Posts

at the moment i have this is some of my vehicles init line:

crewcheck2 = this addeventhandler ["getin",{_this execvm 'crewcheck.sqf'}]; vehsitrep2 = [this] execvm "crewsitrep.sqf";

i want to put it into this: (veh respawn)

veh = [this, 1, 1, 5, TRUE, FALSE, "this execVM YOUR SCRIPT HERE"] execVM "vehicle.sqf"  

so it re spawns with its init line each time.

now i cant do this:

veh = [this, 1, 1, 5, TRUE, FALSE, "trewcheck2 = this addeventhandler ["getin",{_this execvm 'crewcheck.sqf'}]; vehsitrep2 = [this] execvm "crewsitrep.sqf""] execVM "vehicle.sqf"  

as it just says

; missing!

so how can i get round this?

i tried to make a sqf file called vehscriptinit.sqf and put this in:

crewcheck2 = this addeventhandler ["getin",{_this execvm 'crewcheck.sqf'}];
vehsitrep2 = [this] execvm "crewsitrep.sqf";

but it doesent work, so, is this possible?

and what does my 'vehscriptinit.sqf' need to contain?

does it need unit = this or anything?

TIA, Grim.

Share this post


Link to post
Share on other sites

veh = [this, 1, 1, 5, TRUE, FALSE, "trewcheck2 = this addeventhandler ['getin',{_this execvm 'crewcheck.sqf'}]; vehsitrep2 = [this] execvm 'crewsitrep.sqf'"] execVM "vehicle.sqf";

You had some missing double quotes within the init field so I changed them to single quotes.

Share this post


Link to post
Share on other sites

No idea if it works even with right syntax, but at least you could try by fixing the init string.

Any " marks inside a string need another mark. So, instead of trying this:

"trewcheck2 = this addeventhandler ["getin",{_this execvm 'crewcheck.sqf'}]; vehsitrep2 = [this] execvm "crewsitrep.sqf""

Try this:

"trewcheck2 = this addeventhandler [""getin"",{_this execvm 'crewcheck.sqf'}]; vehsitrep2 = [this] execvm ""crewsitrep.sqf"""

Doesn't matter if you use a '" or "", but you need to do it for strings inside strings.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×