Jump to content
Barba-negra

liveFeed screens dedicate server

Recommended Posts

Hello friends how are you? I'm currently trying to run a display script on a dedicated server, but strangely the image freezes, why is it happening? I think everything is fine, this scritps belongs to bangabob, and uses the following line:

 

waitUntil {!isnull player};
private ["_feedArray","_MonitorName","_array","_newArray"];

_monitorArray=(_this select 0);
_monitorHDD=_monitorArray select 0;
_array=(_this select 1);
_MonitorName= format ["%1",_monitorHDD];

   _newArray=[];

    {
    if (isNil _x) then {
                }else{    
                       _call = format ["%1",_x];
                        call (compile _call);
                        _newArray=_newArray+[call(compile _call)];
                    };
    } forEach _array;
    
    _feedArray=server getvariable _MonitorName;    
    
        if (isnil "_feedArray") 
            then {
            _feedArray=[];
            {
            if (isnil "_x") then {}else{_feedArray=_feedArray + [_x]; };
            }foreach _newArray;
            
            server setvariable [_MonitorName,_feedArray,true];
                    };
                    
    player setvariable ["MonName",_MonitorName];

    
        {
    if (isNil _x) then {
                }else{    
                       _call = format ["%1",_x];
                        call (compile _call);
                        _newArray=_newArray+[call(compile _call)];
                    };
    } forEach _array;
    
    waituntil {!isnil "_MonitorName"};        
        _feedArray=server getvariable _MonitorName;

    if    ((player in _newArray)and !(player in _feedArray)) then {
            
        _feedArray=_feedArray +[player];
        server setvariable [_MonitorName,_feedArray,true];
                        };
    
    _feedArray=server getvariable _MonitorName;    

if (!isserver || !isdedicated) 
        then {
            {
        null = [_x,_feedArray,server] execVM "LFC\livefeed.sqf";
        _x setObjectTexture [0,'#(argb,8,8,3)color(0,0,1,1)'];
        _x allowdamage false;
        _x enablesimulation false;
            }foreach _monitorArray;
            };

    {
    _x setvariable ["MonName",_MonitorName];
    _x setvariable ["MonitorArray",_monitorArray];
    
if (isplayer _x) 
    then {

    _x addEventHandler ["Respawn","CALL fnc_PLAYER_KILLED"];
                    
            }else{
            
            _x addmpEventHandler ["MPkilled","CALL fnc_AI_KILLED"];    
        
            };
            
    }foreach _feedArray;
    

    
fnc_AI_KILLED={

    _unit = _this select 0;
    _corpse = _this select 1;
    
        _MonitorName=_unit getvariable "MonName";
        _monitorArray=_unit getvariable "MonitorArray";
        
        
        _feedArray=server getvariable _MonitorName;
        _feedArray=_feedArray -[_unit];    

                server setvariable [_MonitorName,_feedArray,true];

};


fnc_PLAYER_KILLED={

    _unit = _this select 0;
    _corpse = _this select 1;
    
            _MonitorName=_unit getvariable "MonName";
            _monitorArray=_unit getvariable "MonitorArray";
            
            
        _feedArray=server getvariable _MonitorName;
        _feedArray=_feedArray -[_corpse];
        _feedArray=_feedArray +[_unit];
                        
                        _feedArray=_feedArray call BIS_fnc_arrayShuffle;            
                
        server setvariable [_MonitorName,_feedArray,true];

};


[_monitorArray,_MonitorName] spawn {

    private ["_monitorArray","_MonitorName"];
    
    _monitorArray=(_this select 0);
    _MonitorName=(_this select 1);
    
while {true} do {

    _feedArray=server getvariable _MonitorName;
    _oldArray = format ["%1",_feedArray];
        
        sleep 5;

    _feedArray=server getvariable _MonitorName;
    _newArray = format ["%1",_feedArray];
    
        if (_newArray != _oldArray || (count _feedArray) <= 1) then{    
                {
            null = [_x,_feedArray] execVM "LFC\livefeed.sqf";            
                }foreach _monitorArray;
            };
        };
};

 

I have tried it on a local game and it works very well, but I try it on a dedicated server and the imaen freezes and does not accommodate, any suggestions please?

Share this post


Link to post
Share on other sites

You're running it on server?  It seems a script to be run by client.  Uses 'player' command in a few places.  Player is objNull on dedicated server.

 

Share this post


Link to post
Share on other sites

I know what happens, it freezes when the unit is too far from the screen, for example a boat, if it is too far away the image freezes, open some way to increase the viewing view? on dedicated server, on local player it works fine regardless of distance

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×