mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-25 09:59:18 +03:00
function based player_build
This commit is contained in:
34
SQF/dayz_code/actions/player_build_states.sqf
Normal file
34
SQF/dayz_code/actions/player_build_states.sqf
Normal file
@@ -0,0 +1,34 @@
|
||||
//disallow building if these conditions are not met
|
||||
private ["_isFine","_onLadder","_vehicle","_inVehicle"];
|
||||
|
||||
_isFine = "ok"; //define variable to avoid RPT errors
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_vehicle = vehicle player;
|
||||
_inVehicle = (_vehicle != player);
|
||||
|
||||
if (dayz_isSwimming) exitWith { //end script if player is swimming
|
||||
DZE_ActionInProgress = false;
|
||||
cutText [localize "str_player_26", "PLAIN DOWN"];
|
||||
_isFine = "Swimming";
|
||||
};
|
||||
|
||||
if (_inVehicle) exitWith { //end script if player is in vehicle
|
||||
DZE_ActionInProgress = false;
|
||||
cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];
|
||||
_isFine = "In vehicle";
|
||||
};
|
||||
|
||||
if (_onLadder) exitWith { //end script if player is climbing on ladder
|
||||
DZE_ActionInProgress = false;
|
||||
cutText [localize "str_player_21", "PLAIN DOWN"];
|
||||
_isFine = "On ladder";
|
||||
};
|
||||
|
||||
if (player getVariable["combattimeout", 0] >= time) exitWith { //end script if player is in combat
|
||||
DZE_ActionInProgress = false;
|
||||
cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];
|
||||
_isFine = "In combat";
|
||||
};
|
||||
|
||||
_isFine //returns string to caller, default is "ok" if conditions were not met
|
||||
|
||||
Reference in New Issue
Block a user