text stringlengths 0 929k |
|---|
// by Bon_Inf* |
if(not local player) exitWith{}; |
if((count (units group player) + count bon_recruit_queue) >= bon_max_units_allowed) exitWith {hint "You've reached the max. allowed group size."}; |
#include "dialog\definitions.sqf" |
disableSerialization; |
_update_queue = { |
_display = findDisplay BON_RECRUITING_DIALOG; |
_queuelist = _display displayCtrl BON_RECRUITING_QUEUE; |
_queuelist ctrlSetText format["Units queued: %1",count bon_recruit_queue]; |
}; |
_display = findDisplay BON_RECRUITING_DIALOG; |
_listbox = _display displayCtrl BON_RECRUITING_UNITLIST; |
_sel = lbCurSel _listbox; if(_sel < 0) exitWith{}; |
_unittype = bon_recruit_recruitableunits select _sel; |
_typename = lbtext [BON_RECRUITING_UNITLIST,_sel]; |
_queuepos = 0; |
_queuecount = count bon_recruit_queue; |
if(_queuecount > 0) then { |
_queuepos = (bon_recruit_queue select (_queuecount - 1)) + 1; |
hint parseText format["<t size='1.0' font='PuristaMedium' color='#ef2525'>%1</t> added to queue.",_typename]; |
}; |
bon_recruit_queue = bon_recruit_queue + [_queuepos]; |
[] call _update_queue; |
WaitUntil{_queuepos == bon_recruit_queue select 0}; |
sleep (1.5 * (_queuepos min 1)); |
hint parseText format["Processing your <t size='1.0' font='PuristaMedium' color='#ffd800'>%1</t>.",_typename]; |
sleep 3; |
/********************* UNIT CREATION ********************/ |
_unit = group player createUnit [_unittype, [(getPos bon_recruit_barracks select 0) + 10 - random 10,(getPos bon_recruit_barracks select 1) + 10 - random 20,0], [], 0, "FORM"]; |
_unit setRank "PRIVATE"; |
[_unit] execVM (BON_RECRUIT_PATH+"init_newunit.sqf"); |
/*******************************************************/ |
hint parseText format["Your <t size='1.0' font='PuristaMedium' color='#008aff'>%1</t> %2 has arrived.",_typename,name _unit]; |
bon_recruit_queue = bon_recruit_queue - [_queuepos]; |
[] call _update_queue; |
<|endoftext|> |
/* ---------------------------------------------------------------------------- |
Function: btc_fnc_findsafepos |
Description: |
Find safe position. |
Parameters: |
_check_pos - Center position. [Array] |
_mindist - Minimum distance from the center position. [Number] |
_random_area - Maximum distance from the center position. [Number] |
_objdist - Minimum distance from the resulting position to the center of nearest object. Specifying quite large distance here will slow the function and might often fail to find suitable position. Recommended value: 0 - 10. [Number] |
_allow_water - Allow water position. [Boolean] |
Returns: |
Examples: |
(begin example) |
_result = [getPos player] call btc_fnc_findsafepos; |
(end) |
Author: |
Vdauphin |
---------------------------------------------------------------------------- */ |
params [ |
["_check_pos", [0, 0, 0], [[]]], |
["_mindist", 0, [0]], |
["_random_area", 100, [0]], |
["_objdist", 0, [0]], |
["_allow_water", false, [false, 0]] |
]; |
private _return_pos = []; |
for "_i" from 0 to 4 do { |
_return_pos = [_check_pos, _mindist, _random_area, _objdist, [0, 1] select _allow_water, 60 * (pi / 180), 0] call BIS_fnc_findSafePos; |
if (count _return_pos isEqualTo 2) exitWith { |
_return_pos = [_return_pos select 0, _return_pos select 1, 0]; |
}; |
_random_area = _random_area * 1.5; |
}; |
_return_pos |
<|endoftext|> |
/* |
Author: Karel Moricky |
Description: |
Halts current function and all it's parents and shows an error message. |
Parameter(s): |
_this select 0: STRING - Formatted message |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.