Jump to content
  • 0

Dance Script?


JohnyMST

Question

I wanted to enable fire dance on my server when players are near the fire.

So I start off with my "dance.sqf" file located in: dayz_code\compile\:

 

private["_ent"];
_ent = _this select 3;
player removeAction s_player_dance;
s_player_dance = -1;
 
player playMove "ActsPercMstpSnonWnonDnon_DancingStefan";
 
cutText ["Let the party begin!","PLAIN DOWN"];
 
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
 
    while {r_doLoop} do {
        _animState = animationState player;
        _isDancing = ["ActsPercMstpSnonWnonDnon_DancingStefan",_animState] call fnc_inString;
        if (_isDancing) then {
            _started = true;
        };
        if (_started and !_isDancing) then {
            r_doLoop = false;
            _finished = true;
        };
        if (r_interrupt) then {
            r_doLoop = false;
        };
        sleep 0.1;
    };
    r_doLoop = false;
 
if (_finished) then {
 
cutText ["Awesome performance mate!","PLAIN DOWN"];
 
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance Canceled! ;(","PLAIN DOWN"];
};

Saved this and moved on to another file "fn_selfActions.sqf" located in the same folder as "dance.sqf"

In "fn_selfActions.sqf" I pasted the following code to enable dance:
 

// ---------------------------------------DANCE START------------------------------------

    if (inflamed cursorTarget and _canDo) then {
            if (s_player_dance < 0) then {
            s_player_dance = player addAction ["Dance!","dance.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_dance;
        s_player_dance = -1;
    };
	// ---------------------------------------DANCE END------------------------------------

Then in the same file under "\\OTHERS" I pasted the below code:

 

	//DANCE START
	player removeAction s_player_dance;
    s_player_dance = -1;
	//DANCE END

Excpected this to work fine howeve when I try and perform the dance I get error message:
"dance.sqf not found"

 

Anyone knows what I did wrong in this?

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

In case you still want to know your can change the path here:

s_player_dance = player addAction ["Dance!","FOLDER/dance.sqf",cursorTarget, 0, false, true, "",""];

just change "FOLDER" to your path.. :)

 

 

Yeah I did that and changed around 5 times before I came here. putting dance.sqf into another folder even if I called it as in your example didn't help

Tried all ''alternatives'' and only worked in root folder

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...