Jump to content

Sign in to follow this  
GSP167

Getting addAction to work with init.sqf

Recommended Posts

Hello,

I'm new to scripting in Arma, I've been doing some C++ scripting in the past but SQF is completely new to me .. so, anyways here's my issue; I'm trying to make a simple CPR script, my init.sqf is in that folder:

@CPR\Addons\cpr_main\init.sqf

Here's my init.sqf:

// CPR System - init.sqf
// 12/23/2013

hint "CPR/AED Script loaded.";


addAction ["Check pulse", "CheckPulse.sqf"];
addAction ["Check breathing", "CheckBreathing.sqf"];

When I go in game, I do not see my actions on the action menu, I tried adding "_x =" in front of my addAction, didn't work. I also executed the init.sqf on my characters and I still didn't see the actions.

Sorry again if this seems to be a idiot question!

Thanks for helping!

Share this post


Link to post
Share on other sites

Hey, welcome to the sqf world ;). You did not specify to whom the action should be available. It should be something like this:

unit addAction [...];

Share this post


Link to post
Share on other sites
  super-truite said:
Hey, welcome to the sqf world ;). You did not specify to whom the action should be available. It should be something like this:

unit addAction [...];

Hey thanks for the reply!

So, I changed my code a little bit and now it looks like this;

// CPR System - init.sqf
// 12/23/2013

hint "CPR/AED Script loaded.";


cpr_CP = player addAction ["Check pulse", "CheckPulse.sqf"];
cpr_CB = player addAction ["Check breathing", "CheckBreathing.sqf"];

I still don't see the actions when I go in game ... I really don't know what I have to do for this to work :confused: I also tried without the "cpr_CB =" and still no success.

Share this post


Link to post
Share on other sites

I am new to this as well.. but my addAction work except it isn't from the init.sqf.

Anyway, did you try the exact same code on the player itself?

Like this:

this addAction ["Check pulse", "CheckPulse.sqf"];

If it still doesn't work, then most likely the code syntax is wrong or something that's why nothing was added.

Check if the player id is indeed "player", otherwise it won't take in as well..

the player must be named himself.(most likely you know but just in case.)

Share this post


Link to post
Share on other sites

waitUntil { !isNull player }; // Wait for player to initialize

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  

×