spawned vehicle

5 posts in this topic

Hello, can anyone help me with one thing, im using a3_infiSTAR_Exile_customApps to spawn quad, and the problem is clients dont pack them after they use it,  so they are all over the map, how can i make i timer for this vehicles so they will despawn if you dont interract with them??? thank you

  • Like 1

Share this post

Link to post
Share on other sites

do you know what it means?

                [netId _vehicleObject, _displayName, _itemNeeded],
                    params["_objNetId", "_displayName", "_itemNeeded"];
                    _vehicleObject = objectFromNetId _objNetId;

                    _function = "
                        _vehicleObject = _this select 0;
                        _actionId = _this select 2;
                        if(local _vehicleObject)then
                            _vehicleObject removeAction _actionId;
                            deleteVehicle _vehicleObject;
                            [player,'packRequest',["+str _itemNeeded+"]] remoteExecCall ['fn_xm8apps_server', 2, false];
                            ['ErrorTitleAndText', ['infiSTAR pack', 'Please get in the driver seat first!']] spawn ExileClient_gui_toaster_addTemplateToast;
                    _function = compile _function;

                    _title = format["<img size='1'image='\exile_assets\texture\ui\xm8_app_settings_ca.paa'/> <t color='#0096ff'>Pack %1</t>",_displayName];
                    _vehicleObject addAction [_title, _function, "", 1, true, true, "", "player distance _target < 8"];
            ] remoteExecCall ["call",remoteExecutedOwner,false];
            [_vehicleObject] spawn {
                private ["_wait","_tick", "_vehObj","_driver"];
                _wait = true;
                _tick = 0;
                _vehObj = [_this,0,objNull] call BIS_fnc_param;

                while {_wait} do {
                    UISleep 1;
                    if(isNull _vehObj)exitWith{_wait = false};

                    _driver = driver _vehObj;
                    if(isNull _driver)then{
                        _tick = _tick + 1;
                        _tick = 0;

                    if(_tick >= 600)exitWith{_wait = false};

                moveOut (driver _vehObj);
                _vehObj call ExileServer_system_vehicleSaveQueue_removeVehicle;
                _vehObj call ExileServer_system_simulationMonitor_removeVehicle;
                deleteVehicle _vehObj;

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.