Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Bloodofthedragon

How do I execute a function from radio trigger?

Recommended Posts

Hello,

Okay, firsoff please be gentle I don't have much expirience with scripting so I need answers in dummy talk please:)

I am trying to execute a sqf I have in my mission folder via radio alpha.

And I want it to be tied to a specific object (in this case a civ car)

But for the life of me I can not figure out the correct syntax.

I tried: carname execVM "myscript.sqf"; in the activation window of the alpha trigger, but that didn't work.

The only thing I can think of is perhaps carname should be in quotes? like "carname"

Am I barking up the wrong tree here?

Any help would be very appreciated

P.S. I should mention, I do have mcmurry's editing guide, and it does help but I need some Q and A to make sense of alot of it.

Share this post


Link to post
Share on other sites

Thats the correct way:

Script_Handler = [carname] execVM "myscript.sqf";

B.t.w.: This is not a function. This is a .sqf script.

Functions are executed by the "call" command and need to be preprocessed bevore use.

Check: .sqf and Function

May you can find out something more interesting about all this stuff. ;)

Edited by SNKMAN

Share this post


Link to post
Share on other sites
Thats the correct way:

Script_Handler = [carname] execVM "myscript.sqf";

B.t.w.: This is not a function. This is a .sqf script.

Functions are executed by the "call" command and need to be preprocessed bevore use.

Check: .sqf and Function

May you can find out something more interesting about all this stuff. ;)

Simply

Script_Handler = carname execVM "myscript.sqf";

will do. No need to put it in an array.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×