1
+ scriptName " ammobox_action_manager" ;
2
+
1
3
waitUntil {! isNil " build_confirmed" };
2
4
waitUntil {! isNil " one_synchro_done" };
3
5
waitUntil {! isNil " one_eco_done" };
@@ -57,10 +59,24 @@ while {true} do {
57
59
_b_action_id2 = _next_box addAction [" <t color='#FFFF00'>" + localize " STR_ACTION_STORE_CRATE" + " </t>" ,{[(_this select 0 ), (nearestObjects [player ,KPLIB_storageBuildings,20 ]) select 0 ,true ] call KPLIB_fnc_crateToStorage ;}," " ,- 502 ,true ,true ," " ," build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)" ];
58
60
_b_action_id3 = _next_box addAction [" <t color='#FFFF00'>" + localize " STR_ACTION_CRATE_VALUE" + " </t>" ,{[_this select 0 ] call KPLIB_fnc_checkCrateValue ;uiSleep 3 ; hint " " ;}," " ,- 503 ,true ,true ," " ," build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)" ];
59
61
_b_action_id4 = _next_box addAction [" <t color='#FFFF00'>" + localize " STR_ACTION_CRATE_PUSH" + " </t>" ,{(_this select 0 ) setPos ((_this select 0 ) getPos [1 , (player getDir (_this select 0 ))]);}," " ,- 504 ,true ,false ," " ," build_confirmed == 0 && (_this distance _target < 5) && (vehicle player == player)" ];
62
+ _b_action_id_carry = _next_box addAction [
63
+ " <t color='#FFFF00'>" + localize " STR_ACTION_CRATE_CARRY" + " </t>" ,
64
+ {
65
+ params [" _crate" , " _player" ];
66
+ _crate attachTo [_player , [0 , 2 , 1 ]];
67
+ _player setVariable [" KPLIB_carriedObject" , _crate ];
68
+ },
69
+ " " , - 504 , true , false , " " ,
70
+ toString {
71
+ build_confirmed == 0 && _this in _this && {isNull (_this getVariable [" KPLIB_carriedObject" , objNull ])}
72
+ },
73
+ 5 // radius
74
+ ];
60
75
_next_box setVariable [" KPLIB_ammo_box_action" , _b_action_id1 , false ];
61
76
_next_box setVariable [" KP_crate_store_action" , _b_action_id2 , false ];
62
77
_next_box setVariable [" KP_crate_value_action" , _b_action_id3 , false ];
63
78
_next_box setVariable [" KP_crate_push_action" , _b_action_id4 , false ];
79
+ _next_box setVariable [" KP_crate_carry_action" , _b_action_id_carry , false ];
64
80
_managed_boxes pushback _next_box ;
65
81
};
66
82
@@ -75,6 +91,8 @@ while {true} do {
75
91
_next_box removeAction (_next_box getVariable [" KP_crate_store_action" , - 1 ]);
76
92
_next_box removeAction (_next_box getVariable [" KP_crate_value_action" , - 1 ]);
77
93
_next_box removeAction (_next_box getVariable [" KP_crate_push_action" , - 1 ]);
94
+ _next_box removeAction (_next_box getVariable [" KP_crate_carry_action" , - 1 ]);
95
+ _next_box removeAction (_next_box getVariable [" KP_crate_drop_action" , - 1 ]);
78
96
}
79
97
} foreach _managed_boxes ;
80
98
0 commit comments