Jump to content
  • 0

fn_unconsius.sqf


juandayz

Question

hey any knows how to call fn_unconsius.sqf  with other script?

i making a script and a i need generate on the other player a fainthing. something like knockout.

guess i need to call a new custom fn_unconsius.. with compiles.sqf too

i have it

Spoiler

private ["_cursorTarget","_isAlive","_isMan","_isZombie","_isAnimal","_isBandit","_isHero","_rnum","_infectrand"," _welcomeMessage "," _camDistance "]
_cursorTarget = cursorTarget;
_isAlive = alive _cursorTarget;
_isMan = _cursorTarget isKindOf "Man";
_isZombie = _cursorTarget isKindOf "zZombie_base";
_isAnimal = _cursorTarget isKindOf "Animal";
_isBandit = (cursortarget getVariable["humanity",0]) <= -2500;
_isHero = (cursortarget getVariable["humanity",0]) >= 5000;
_rnum = random 100;
_infectrand = round(random 10);

_welcomeMessage = format["MY TEXT, %1,",format["%1", name player]];
_camDistance = 60;


if (_isMan and _isAlive and !_isZombie and !_isAnimal and (player distance cursorTarget < 3)) then {

    if (_isBandit) then {
        [player,-250] call player_humanityChange;
        cutText ["my text, -250 humanity.", "PLAIN DOWN"];
    if (_infectrand < 8) then {r_player_infected = true;
        cutText [format["%1, youre infected by some kind of virus",name player], "PLAIN DOWN"];
    };

showCinemaBorder true;
   camUseNVG false;               
   _camera = "camera" camCreate [(position player select 0)-2, position player select 1,(position player select 2)+_camDistance];
   _camera cameraEffect ["internal","back"];
   
   _camera camSetFOV 2.000;
   _camera camCommit 0;
   waitUntil {camCommitted _camera};
   playsound "sex";
 
   _camera camSetTarget vehicle player;
   _camera camSetRelPos [0,0,2];
   _camera camCommit 12;
 
   cutText [_welcomeMessage, "PLAIN DOWN"];

   waitUntil {camCommitted _camera};
 
  _camera cameraEffect ["terminate","back"];
  camDestroy _camera;

    };
    if (!_isHero and !_isBandit) then {
        [player,-500] call player_humanityChange;
        cutText ["my text, -500 humanity.", "PLAIN DOWN"];
    if (_infectrand < 6) then {r_player_infected = true;
        cutText [format["%1, youre infected by some kind of virus",name player], "PLAIN DOWN"];
    }; 

showCinemaBorder true;
   camUseNVG false;               
   _camera = "camera" camCreate [(position player select 0)-2, position player select 1,(position player select 2)+_camDistance];
   _camera cameraEffect ["internal","back"];
   
   _camera camSetFOV 2.000;
   _camera camCommit 0;
   waitUntil {camCommitted _camera};
   playsound "sex";
 
   _camera camSetTarget vehicle player;
   _camera camSetRelPos [0,0,2];
   _camera camCommit 12;
 
   cutText [_welcomeMessage, "PLAIN DOWN"];

   waitUntil {camCommitted _camera};
 
  _camera cameraEffect ["terminate","back"];
  camDestroy _camera;

   
    };
    if (_isHero) then {
        [player,-1000] call player_humanityChange;
        cutText ["my text, -1000 humanity.", "PLAIN DOWN"];
    if (_infectrand < 3) then {r_player_infected = true;
        cutText [format["%1, youre infected by some kind of virus",name player], "PLAIN DOWN"];
    };

showCinemaBorder true;
   camUseNVG false;               
   _camera = "camera" camCreate [(position player select 0)-2, position player select 1,(position player select 2)+_camDistance];
   _camera cameraEffect ["internal","back"];
   
   _camera camSetFOV 2.000;
   _camera camCommit 0;
   waitUntil {camCommitted _camera};
   playsound "sex";
 
   _camera camSetTarget vehicle player;
   _camera camSetRelPos [0,0,2];
   _camera camCommit 12;
 
   cutText [_welcomeMessage, "PLAIN DOWN"];

   waitUntil {camCommitted _camera};
 
  _camera cameraEffect ["terminate","back"];
  camDestroy _camera;

    };
};

my question is if is possible call the unconsius  trough the script

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

This is from axe melee damage but generally you can see what does the part .

 


 
[_unit] spawn {
_unit = _this select 0;
"you have been knocked out" call dayz_rollingMessages;
[_unit,0.01] call fnc_usec_damageUnconscious;
_unit setVariable ["NORRN_unconscious", true, true];
r_player_timeout = 20 + round(random 60);
r_player_unconscious = true;
player setVariable["medForceUpdate",true,true];
player setVariable ["unconsciousTime", r_player_timeout, true];
};
Link to comment
Share on other sites

  • 0

tnks so much creative gonna try... i found this (lines in blue) , but need to test
, dnt know if gonna work

Spoiler

private ["_cursorTarget","_isAlive","_isMan","_isZombie","_isAnimal","_isBandit","_isHero","_rnum","_infectrand","]
_cursorTarget = cursorTarget;
_isAlive = alive _cursorTarget;
_isMan = _cursorTarget isKindOf "Man";
_isZombie = _cursorTarget isKindOf "zZombie_base";
_isAnimal = _cursorTarget isKindOf "Animal";
_isBandit = (cursortarget getVariable["humanity",0]) <= -2500;
_isHero = (cursortarget getVariable["humanity",0]) >= 5000;
_rnum = random 100;
_infectrand = round(random 10);

if !(_isMan && _isAlive) exitWith {
    cutText [format["debe ser persona."], "PLAIN DOWN"];
};

if (_isMan and _isAlive and !_isZombie and !_isAnimal and (player distance cursorTarget < 3)) then {
    
    titleText ["!", "PLAIN DOWN"];titleFadeOut 5;
    
    playSound "heartbeat_1";

    if (_isBandit) then {
        [player,-250] call player_humanityChange;
        cutText [", -250 humanity.", "PLAIN DOWN"];
    if (_infectrand < 4) then {r_player_infected = true;
        cutText [format["%1, you get infected by some kind of virus",name player], "PLAIN DOWN"];
    };
    };
    if (!_isHero and !_isBandit) then {
        [player,-500] call player_humanityChange;
        cutText [", -500 humanity.", "PLAIN DOWN"];
    if (_infectrand < 4) then {r_player_infected = true;
        cutText [format["%1, you get infected by some kind of virus",name player], "PLAIN DOWN"];
    };    
    };
    if (_isHero) then {
        [player,-1000] call player_humanityChange;
        cutText [", -1000 humanity.", "PLAIN DOWN"];
    if (_infectrand < 4) then {r_player_infected = true;
        cutText [format["%1, you get infected by some kind of virus",name player], "PLAIN DOWN"];
    };
    };
};

if (isServer) then {
_array = _this; //_this select 0;
_unit = _array select 0;

    _unit setVariable["NORRN_unconscious",true, true]; // set unconcscious
    _unit setVariable["unconsciousTime",15,true]; // unconcscious time
    _unit setVariable["USEC_injured",true]; // bleeding    
};

 

Link to comment
Share on other sites

  • 0

i need to generate an inconscious state on the other player..   see... First player launch the script on a second player.  First Player get a downgrade humanity for use this script,  second player get an inconscious state while this happend.

anyway dsnt works. fail when second player must be involved. i think this must be like knockout script.  Player A use scroll menu to knock out Player B to generate the unconscious state. then my script start to run on player A.

in other words,,, now i guess can be more easy use knock out script and add the option to execute my script once player are knoked out.

tnks creative!

 

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...