Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
scriptName "Functions\misc\fn_damageActions.sqf"; /*********************************************************** ADD ACTIONS FOR A CASUALTY - Function - [] call fnc_usec_damageActions; ************************************************************/ private ["_found","_weaponName","_action","_turret","_weapons","_assignedRole","_action1","_action2","_x","_vehicle","_unit","_vehType","_displayName","_ammoQty","_ammoSerial","_weapon","_magTypes","_type","_typeVeh","_index","_inventory","_unitTo","_isEngineer","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasToolbox","_hasJerry","_hasJerryE","_hasWire","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_bag","_classbag","_isDisallowRefuel","_hasBarrel","_hasBarrelE"]; disableSerialization; if (DZE_ActionInProgress) exitWith {}; // Do not allow if any script is running. _menClose = cursorTarget; _hasPatient = alive _menClose; _vehicle = vehicle player; _inVehicle = (_vehicle != player); _isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2)); _bag = unitBackpack player; _classbag = typeOf _bag; if (_inVehicle) then { r_player_lastVehicle = _vehicle; _assignedRole = assignedVehicleRole player; if (str (_assignedRole) != str (r_player_lastSeat)) then { call r_player_removeActions2; }; if (!r_player_unconscious && !r_action2) then { r_player_lastSeat = _assignedRole; if (count _assignedRole > 1) then { _turret = _assignedRole select 1; _weapons = _vehicle weaponsTurret _turret; { _weaponName = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); _action = _vehicle addAction [format["Add AMMO to %1",_weaponName], "\z\addons\dayz_code\actions\ammo.sqf",[_vehicle,_x,_turret], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; } forEach _weapons; }; }; } else { call r_player_removeActions2; r_player_lastVehicle = objNull; r_player_lastSeat = []; }; if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and _isClose) then { _unit = cursorTarget; _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ"]; // player reveal _unit; _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5]; _hasVehicle = ({alive _x} count _vehClose > 0); _unconscious = _unit getVariable ["NORRN_unconscious", false]; _lowBlood = _unit getVariable ["USEC_lowBlood", false]; _injured = _unit getVariable ["USEC_injured", false]; _inPain = _unit getVariable ["USEC_inPain", false]; _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; _charID = getPlayerUID _unit; _found=[_charID,"AX"] call KRON_StrInStr; if (_found) then { _charID=[_charID] call KRON_convertPlayerUID; }; _friendlies = player getVariable ["friendlies", []]; _playerMagazines = magazines player; _hasBandage = "ItemBandage" in _playerMagazines; _hasEpi = "ItemEpinephrine" in _playerMagazines; _hasMorphine = "ItemMorphine" in _playerMagazines; _hasBlood = "ItemBloodbag" in _playerMagazines; _hasToolbox = "ItemToolbox" in items player; _hasJerry = "ItemJerrycan" in _playerMagazines; _hasBarrel = "ItemFuelBarrel" in _playerMagazines; _hasJerryE = "ItemJerrycanEmpty" in _playerMagazines; _hasBarrelE = "ItemFuelBarrelEmpty" in _playerMagazines; //_hasEtool = "ItemEtool" in weapons player; _hasWire = "ItemWire" in _playerMagazines; _hasPainkillers = "ItemPainkiller" in _playerMagazines; //Allow player to drag if(_unconscious) then { r_action = true; _action1 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true]; _action2 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true]; r_player_actions = r_player_actions + [_action1,_action2]; }; //Load Vehicle if (_hasVehicle and _unconscious) then { _x = 0; r_action = true; _unit = _unit; _vehicle = (_vehClose select _x); while{((!alive _vehicle) and (_x < (count _vehClose)))} do { _x = _x + 1; _vehicle = (_vehClose select _x); }; _vehType = typeOf _vehicle; _action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to bandage if(_injured and _hasBandage) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Epinephrine if(_unconscious and _hasEpi) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Morphine if((_legsBroke or _armsBroke) and _hasMorphine) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\morphine.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Painkillers if(_inPain and _hasPainkillers) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to transfuse blood if(_lowBlood and _hasBlood) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Repairs if ((_unit isKindOf "AllVehicles") and !(_unit isKindOf "Man") and !_isDisallowRefuel) then { _type = TypeOf(_unit); _typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); //CAN WE REFUEL THE OBJECT? if ((fuel _unit < 1) and (_hasJerry or _hasBarrel)) then { r_action = true; _action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //CAN WE siphon fuel from THE OBJECT? if ((fuel _unit > 0) and (_hasJerryE or _hasBarrelE)) then { r_action = true; _action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; } else { // should only fire if cursor target is man and not vehicle if ((isPlayer _unit) and !(_charID in _friendlies)) then { r_action = true; _action = _unit addAction ["Tag as friendly", "custom\player_tagFriendly.sqf", [], 0, false, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; }; if (r_action) then { r_action_targets = r_action_targets + [_unit]; }; }; /* if ((r_player_vehicle != _vehicle) and r_action) then { //Player is in a new vehicle r_action = false; call fnc_usec_medic_removeActions; }; */ if (_inVehicle) then { //Check if patients _crew = crew _vehicle; if (count _crew > 0) then { _unconscious_crew = []; { if (_x getVariable "NORRN_unconscious") then { _unconscious_crew = _unconscious_crew + [_x] }; } forEach _crew; _patients = (count _unconscious_crew); if (_patients > 0) then { if (!r_action_unload) then { r_action_unload = true; _vehType = typeOf _vehicle; _action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_vehicle], 0, false, true]; r_player_actions set [count r_player_actions,_action]; }; } else { if (r_action_unload) then { call fnc_usec_medic_removeActions; r_action_unload = false; }; }; }; //hintSilent format["Crew: %1\nPatients: %2\nAction: %3",(count _crew),_patients,r_action_unload]; } else { if (r_action_unload) then { r_action_unload = false; call fnc_usec_medic_removeActions; }; }; //Remove Actions if ((!_isClose or !_hasPatient) and r_action) then { call fnc_usec_medic_removeActions; r_action = false; }; //Pain Effects //if (r_player_inpain and !r_player_unconscious) then { // playSound "breath_1"; // addCamShake [2, 1, 25]; //};
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
Untitled
13 hours ago | 0.16 KB
settings
13 hours ago | 0.10 KB
IT & AI
22 hours ago | 1.62 KB
Stationeers - Sign Tags from Power Distributi...
HTML | 1 day ago | 2.00 KB
PM: Shopify Client Edits
1 day ago | 0.19 KB
PM: Shopify Assigning Design Task 2
1 day ago | 0.14 KB
PM: Shopify Assigning Design Task 1
1 day ago | 0.32 KB
Commodore Callback 8020
1 day ago | 0.18 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!