Soul
Valued Member!
Soul's Ignite Tents
v1.0
What it does....
Allows players or just admins to burn down tents and have them also deleted from the
database.
Tested and confirmed working on Reality private server.
Requirements (inc. Tools(must include dowload link)/ Expected Time/Difficulty)
- Easy = Blue <10
- 10 minutes install time
1: fn_selfActions.sqf:
Find:
Code:
_hasKnife = "ItemKnife" in items player;
Code:
_hasMatches = "ItemMatchbox" in items player;
Find:
Code:
if(cursorTarget == dayz_hasFire and _canDo) then {
if ((s_player_fireout < 0) and !(inflamed cursorTarget) and (player distance cursorTarget < 3)) then {
s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",cursorTarget, 0, false, true, "",""];
};
} else {
player removeAction s_player_fireout;
s_player_fireout = -1;
};
Add below:
Code:
if(_isTent and _hasMatches and _canDo and !_isMan) then {
if (s_player_igniteTent < 0) then {
s_player_igniteTent = player addAction [format["Ignite Tent"], "scripts\tent_ignite.sqf",cursorTarget, 1, true, true, "", ""];
};
} else {
player removeAction s_player_igniteTent;
s_player_igniteTent = -1;
};
If you do not have a "scripts" folder in your mission.pbo create one or place
the script file in any folder you want and update the file directory in the fn_selfActions.sqf
3: Copy paste this in "tent_ignite.sqf":
Code:
// Rewriten by Soul from DayZ2017 to work with DayZ1.7.7.1
// Special thanks to reactortrip for bringing this up
// Krixes for the countdown timer example in his sleep script ;D
// The whole community for releasing all there scripts and so enabling me to learn alot!
private["_ent"];
//Variables ------------------------------------------------
_ent = _this select 3; //Dont touch this
_countDownTimer = 60; //Total time to count down, makes the tent burn for 60 seconds. Change to whatever you like...
_timeLeft = _countDownTimer; //time left to count down, dont touch this
canAbort = true;
//----------------------------------------------------------
player removeAction s_player_igniteTent;
s_player_igniteTent = -1;
player playActionNow "Medic";
sleep 7;
_objectID = _ent getVariable["ObjectID","0"];
_objectUID = _ent getVariable["ObjectUID","0"];
PVDZ_obj_Fire = [_ent,2,time,false,true];
publicVariable "PVDZ_obj_Fire";
_id = PVDZ_obj_Fire spawn BIS_Effects_Burn;
for "_i" from 0 to _countDownTimer do {
sleep 1;
_timeLeft = _timeLeft - 1;
};
if(_timeLeft == 0 || _timeLeft < 0) then {
_ent setDamage 2;
//Deleting from database. Function found in player_packTent.sqf
PVDZ_obj_Delete = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Delete";
if (isServer) then {
PVDZ_obj_Delete call server_deleteObj;
};
deleteVehicle _ent;
};
/*
How to use: PVDZ_obj_Fire = [_ent,5,time,false,true];
> handle=[unit,intensity,time,lifecheck,fade] spawn BIS_Effects_Burn
>
> unit: the name of the object that the fire will be attached to
> intensity: the intensity of the fire. Recommended to use values between
> 0.7 and 10, higher values may be used if desired though.
> time: the time that the fire started. use global variable "time". this is used to keep effects synced for JIP players
> lifecheck: if this is true then the unit will only burn as long as it is dead (!alive unit). set to false to burn things like buildings and
gamelogics
> fade: if true then the fire will die down over time, eventually dying
out. set to false if you want it to keep burning. (affected by rain too).
To make a gamelogic named mygamelogic burn forever with a big fire:
PVDZ_obj_Fire=[_ent,10,time,false,false] spawn BIS_Effects_Burn
*/
4: Find at the bottom of fn_selfActions.sqf
Code:
player removeAction s_player_packtent;
s_player_packtent = -1;
Code:
player removeAction s_player_igniteTent;
s_player_igniteTent = -1;
5: Repack your mission.pbo and upload and voila burn then tents.
For support click >> here <<