Search the Community
Showing results for tags 'camp fire'.
Found 1 result
-
HI. Maybe someone can find this usable. This script allow players to create one fire place at time in proper world places. The action is shown only if you put character ass on the ground. If you have one created already somebody need to remove it before you would be able to create another one. /* file: fireplace.sqf by DaVidoSS adds ability to create fireplace parameters none return VOID usage: //initPlayerLocal.sqf [] execVM "fireplace.sqf"; player addEventHandler ["Respawn", { deleteVehicle ((_this select 1) getVariable ['mycampfire',objNull]); [] execVM "fireplace.sqf"; }]; */ if !(hasInterface) exitWith {}; player addAction [ "<t>Set Up Fireplace</t><img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_fire_in_flame_ca'/>", { params [["_target",objNull,[objNull]],["_unit",objNull,[objNull]]]; (AGLToASL (_unit modelToWorldVisual [0,1.5,0])) params ["_vx","_vy","_vz"]; if !(isNull (objectParent _unit)) exitWith {hint "Really? While driving?"}; if (surfaceIsWater (position _unit)) exitWith {hint "Oh come on, you cant be that stupid!"}; if !(isTouchingGround _unit) exitWith {hint "Ok, but hit the ground first!"}; if !(count (lineIntersectsObjs [(AGLToASL (_unit modelToWorldVisual [0,1.5,0])), [_vx,_vy,(_vz + 20)]]) == 0) exitWith {hint "Open your eyes, you wanna burn something?"}; _unit playMove "AinvPknlMstpSnonWnonDnon_medicUp3"; sleep 7; private _campFire = createVehicle ["FirePlace_burning_F", (_unit modelToWorldVisual [0,1.5,0]), [], 0, "CAN_COLLIDE"]; _unit setVariable ["mycampfire",_campFire,false]; 0 = [_campFire, [ "<t>Remove Fireplace</t><img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_fire_put_down_ca'/>", { params [["_target",objNull,[objNull]],["_unit",objNull,[objNull]]]; _unit playMove "AinvPknlMstpSnonWnonDnon_medicUp3"; sleep 7; deleteVehicle _target; },nil,0,true,true,"","true",3,false,"","" ] ] remoteExec ["addAction", [0,-2] select isDedicated,_campFire]; },nil,0,false,true,"", "isNull (_this getVariable ['mycampfire',objNull]) && {((animationState _this) in ['amovpsitmstpsnonwpstdnon_ground','amovpsitmstpslowwrfldnon','amovpsitmstpsnonwnondnon_ground'])}", -1, false, "", ""]; and version where you can restrict it according to some 2 items and its count, in player inventory. /* file: fireplace.sqf by DaVidoSS adds ability to create fireplace parameters: 0 ARRAY return VOID usage: //initPlayerLocal.sqf 0 = [[["zk_wood",2],["zk_matches",1]]] execVM "fireplace.sqf"; player addEventHandler ["Respawn", { deleteVehicle ((_this select 1) getVariable ['mycampfire',objNull]); 0 = [[["zk_wood",2],["zk_matches",1]]] execVM "fireplace.sqf"; }]; version where you can restrict it according to some 2 items and its count, in player inventory. */ if !(hasInterface) exitWith {}; private _checkparam = params [["_required_items",[],[[]],2]]; if !(_checkparam) exitWith {diag_log "**************** script fireplace.sqf exited - wrong params given**********************"}; player addAction [ "<t>Set Up Fireplace</t><img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_fire_in_flame_ca'/>", { params [["_target",objNull,[objNull]],["_unit",objNull,[objNull]],["_actionID",-1,[0]],["_required_items",[],[[]],2]]; (AGLToASL (_unit modelToWorldVisual [0,1.5,0])) params ["_vx","_vy","_vz"]; if !(isNull (objectParent _unit)) exitWith {hint "Really? While driving?"}; if (surfaceIsWater (position _unit)) exitWith {hint "Oh come on, you cant be that stupid!"}; if !(isTouchingGround _unit) exitWith {hint "Ok, but hit the ground first!"}; if !(count (lineIntersectsObjs [(AGLToASL (_unit modelToWorldVisual [0,1.5,0])), [_vx,_vy,(_vz + 20)]]) == 0) exitWith {hint "Open your eyes, you wanna burn something?"}; private _fnc_itemsCheck = { private _return = false; private _checkparam = _required_items params [["_woods_array",[],[[]],2],["_matches_array",[],[[]],2]]; if !(_checkparam) exitWith { hint "Script fireplace.sqf exited - wrong params given"; _unit removeAction _actionID; (_return) }; _woods_array params [["_woods","",[""]],["_woods_cnt",1,[0]]]; _matches_array params [["_matches","",[""]],["_matches_cnt",1,[0]]]; private _item1_count = {_x == _woods} count items _unit; private _item2_count = {_x == _matches} count items _unit; if (_item1_count >= _woods_cnt && {_item2_count >= _matches_cnt}) then { for "_i" from 1 to _woods_cnt do { _unit removeItem _woods; }; for "_i" from 1 to _matches_cnt do { _unit removeItem _matches; }; _return = true; } else { hint format [ "You need %1 %2 and %3 %4 to make fire", _woods_cnt,(getText (configfile >> "CfgWeapons" >> _woods >> "displayName")), _matches_cnt,(getText (configfile >> "CfgWeapons" >> _matches >> "displayName")) ]; }; (_return) }; if ([] call _fnc_itemsCheck) then { _unit playMove "AinvPknlMstpSnonWnonDnon_medicUp3"; sleep 7; private _campFire = createVehicle ["FirePlace_burning_F", (_unit modelToWorldVisual [0,1.5,0]), [], 0, "CAN_COLLIDE"]; _unit setVariable ["mycampfire",_campFire,false]; 0 = [_campFire, [ "<t>Remove Fireplace</t><img size='1' image='\a3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_fire_put_down_ca'/>", { params [["_target",objNull,[objNull]],["_unit",objNull,[objNull]]]; _unit playMove "AinvPknlMstpSnonWnonDnon_medicUp3"; sleep 7; deleteVehicle _target; },nil,0,true,true,"","true",3,false,"","" ] ] remoteExec ["addAction", [0,-2] select isDedicated,_campFire]; }; },_required_items,0,false,true,"", "isNull (_this getVariable ['mycampfire',objNull]) && {((animationState _this) in ['amovpsitmstpsnonwpstdnon_ground','amovpsitmstpslowwrfldnon','amovpsitmstpsnonwnondnon_ground'])}", -1, false, "", ""];