Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//DANCE
if (inflamed cursorTarget and _canDo) then {
if (s_player_dance < 0) then {
s_player_dance = player addAction ["Dance!","Scripts\dance\dance.sqf",cursorTarget, 0, false, true, "",""];
s_player_fight = player addAction ["Fight!","Scripts\dance\boxing.sqf",cursorTarget, 0, false, true, "",""];
s_player_fight = player addAction ["Workout!","Scripts\dance\workout.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_dance;
player removeAction s_player_fight;
player removeAction s_player_workout;
s_player_dance = -1;
s_player_fight = -1;
s_player_workout = -1;
};
I added a couple more animations which I have had working but am unsure if the code is write or there is a better way to write it. below is what am using in my selfactions.
Code://DANCE if (inflamed cursorTarget and _canDo) then { if (s_player_dance < 0) then { s_player_dance = player addAction ["Dance!","Scripts\dance\dance.sqf",cursorTarget, 0, false, true, "",""]; s_player_fight = player addAction ["Fight!","Scripts\dance\boxing.sqf",cursorTarget, 0, false, true, "",""]; s_player_fight = player addAction ["Workout!","Scripts\dance\workout.sqf",cursorTarget, 0, false, true, "",""]; }; } else { player removeAction s_player_dance; player removeAction s_player_fight; player removeAction s_player_workout; s_player_dance = -1; s_player_fight = -1; s_player_workout = -1; };
// ---------------------------------------FIRE DANCE START------------------------------------
if (inflamed cursorTarget and _canDo) then {
if (s_player_dance < 0) then {
s_player_dance = player addAction ["Dance!","Scripts\dance\dance.sqf",cursorTarget, 0, false, true, "",""];
s_player_fight = player addAction["Fight!","Scripts\dance\boxing.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_dance;
player removeAction s_player_fight;
s_player_dance = -1;
s_player_fight = -1;
};
// ---------------------------------------FIRE DANCE END------------------------------------
private["_ent"];
_ent = _this select 3;
player removeAction s_player_dance;
s_player_dance = -1;
player playMove "ActsPercMstpSnonWnonDnon_DancingDuoIvan";
_nul = [objNull, player, rSAY, "fox"] call RE;
cutText ["What does the FOX SAY!","PLAIN DOWN"];
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isDancing = ["ActsPercMstpSnonWnonDnon_DancingDuoIvan",_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 ["WTF are you doing mate ?","PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance Canceled! ;(","PLAIN DOWN"];
};
private["_ent"];
_ent = _this select 3;
player removeAction s_player_dance;
s_player_dance = -1;
_danceMoves = ["ActsPercMstpSnonWnonDnon_DancingDuoStefan","ActsPercMstpSnonWnonDnon_DancingDuoIvan","ActsPercMstpSnonWnonDnon_DancingStefan"] call BIS_fnc_selectRandom;
player playMove _danceMoves;
_nul = [objNull, player, rSAY, "fox"] call RE;
cutText ["What does the FOX SAY!","PLAIN DOWN"];
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isDancing = [_danceMoves,_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 ["WTF are you doing mate ?","PLAIN DOWN"];
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
cutText ["Dance Canceled! ;(","PLAIN DOWN"];
};
Use say or playSound locally, not via RE.
Wysłane z mojego Nexus 5
if (!_isDancing} do {
_nul = [objNull, player, rSAY, ['danceMusic',30]] call RE;
sleep 30;
};
_danceMoves = ["ActsPercMstpSnonWnonDnon_DancingDuoStefan","ActsPercMstpSnonWnonDnon_DancingDuoIvan","ActsPercMstpSnonWnonDnon_DancingStefan"] call BIS_fnc_selectRandom;
player playMove _danceMoves;
if (!_isDancing} do {
_nul = [objNull, player, rSAY, ['danceMusic',30]] call RE;
sleep 30;
};
cutText ["What does the FOX SAY!","PLAIN DOWN"];