Jump to content
Sign in to follow this  
Patriot123

How get varname of object?

Recommended Posts

In Arma 2 I use script:

On server:

_unitname = "sometext";
_time = time;
_class = "Skoda";
_position = [1000,1000,0];
_dir = 100;

_newvehobj = _class createVehicle _position;
_newvehobj setpos _position;
_newvehobj setdir _dir;
_newvehobj setVehicleInit format['this setVehicleVarName "vcl_%1_%2"; vcl_%1_%2 = this; this lock true;',_unitname, _time];
processInitCommands;
clearVehicleInit _newvehobj;

On client:

player groupchat["%1",cursortarget]; // Cursor target on created vehicle...

Result: "vcl_sometext_123"

Good. But in Arma 3 SetVehicleInit is disabled. I try create in Arma 3:

Server:


_unitname = "sometext";
_time = time;
_class = "C_Hatchback_01_F";
_position = [1000,1000,0];
_dir = 100;

_newvehobj = _class createVehicle _position;
_newvehobj setpos _position;
_newvehobj setdir _dir;

_vclname = format["vcl_%1_%2",_unitname, _time];

_newvehobj setVehicleVarName _vclname ;
_newvehobj call compile format["%1 = _this;",_vclname];
publicvariable _vclname ;
missionNamespace setVariable [_vclname ,_newvehobj,true];

Client result: "61ac6040# 1769919: hatchback_01_f.p3d REMOTE"

How to make Arma 3 to be the same as in Arma 2?? BIS_fnc_MP work only for current player... Please, help me!

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
Sign in to follow this  

×