mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
This is just in case something goes very wrong (like bad server lag) and the object doesn't spawn.
34 lines
844 B
Plaintext
34 lines
844 B
Plaintext
/*
|
|
1. Waits for an object to be created and then reveals it to the player.
|
|
2. Optionally deletes a temporary sign or marker placeholder object.
|
|
|
|
Parameters:
|
|
_this select 0: string - object class name to reveal
|
|
_this select 1: object - sign object or objNull if none
|
|
|
|
["objectClassName", objNull] call fn_waitForObject;
|
|
*/
|
|
|
|
private ["_class","_sign","_near"];
|
|
|
|
_class = _this select 0;
|
|
_sign = _this select 1;
|
|
_near = count (nearestObjects [player,[_class],50]);
|
|
|
|
[_class,_sign,_near] spawn {
|
|
_class = _this select 0;
|
|
_sign = _this select 1;
|
|
_near = _this select 2;
|
|
_time = diag_tickTime;
|
|
|
|
waitUntil {
|
|
uiSleep 1;
|
|
(count (nearestObjects [player,[_class],50]) != _near or (diag_tickTime - _time > 15))
|
|
};
|
|
|
|
if (!isNull _sign) then {
|
|
deleteVehicle _sign;
|
|
};
|
|
|
|
{player reveal _x;} count (nearestObjects [player,[_class],50]);
|
|
}; |