Jump to content
Sign in to follow this  
alleycat

equipment code failing (dedicated server)

Recommended Posts

On server:

if ((_suits == 0)) then
{
	//pick random unit
	_inf = allUnits call BIS_fnc_selectRandom;
	diag_log text format ["The new infiltrator is: %1", name _inf];	


	[_inf] execVM "client\player\turn.sqf";
};

turn.sqf

/*
turn.sqf

*/

_obj = _this select 0;


diag_log text "START turn.sqf";




removeAllweapons _obj;
removeAllitems _obj;
removeUniform _obj;
removevest _obj;
removeAllAssignedItems _obj; 



_obj addUniform "U_B_Wetsuit";
_obj linkItem "NVGoggles";
_obj linkItem "ItemMap";
_obj addvest "V_TacVest_camo";

_obj addMagazine "20Rnd_556x45_UW_mag"; 
_obj addMagazine "20Rnd_556x45_UW_mag";  
_obj addMagazine "20Rnd_556x45_UW_mag"; 
_obj addMagazine "20Rnd_556x45_UW_mag"; 
_obj addMagazine "20Rnd_556x45_UW_mag"; 
_obj addMagazine "20Rnd_556x45_UW_mag";
_obj addWeapon "arifle_SDAR_F";


_obj addMagazine "16Rnd_9x21_Mag"; 
_obj addMagazine "16Rnd_9x21_Mag"; 
_obj addWeapon "hgun_P07_F";		
_obj addHandgunItem "muzzle_snds_L";		

diag_log text "ADDED GEAR + UNIFORM turn.sqf";	
sleep 1;

_item = ["INF1","INF2","INF3","INF4","INF5"] call BIS_fnc_selectRandom;  
_obj setPos [ getmarkerpos _item select 0, getmarkerpos _item select 1, (getmarkerpos _item select 2) -1];

sleep 5;

diag_log text "END turn.sqf";

What happens in the game when playing on dedicated: The affected player gets moved to the markers but all gear code is ignored.

server rpt:

19:34:10 The new infiltrator is: cat
19:34:10 START turn.sqf
19:34:10 ADDED GEAR + UNIFORM turn.sqf
19:34:12 Client: Object 2:2 (type Type_85) not found.
19:34:12 Client: Object 2:1 (type Type_85) not found.
19:34:13 Error: Object(2 : 2) not found
19:34:13 Error: Object(2 : 1) not found
19:34:14 Client: Object 2:2 (type Type_85) not found.
19:34:14 Client: Object 2:1 (type Type_85) not found.
19:34:16 Client: Object 2:2 (type Type_85) not found.
19:34:16 Client: Object 2:1 (type Type_85) not found.
19:34:16 END turn.sqf

client rpt:

control[DebugConsole]: Unexpected control type [15]
control[MessageBox]: Unexpected control type [15]
control[MessageBox]: Unexpected control type [15]
control[DebugConsole]: Unexpected control type [15]
control[DebugConsole]: Unexpected control type [15]
control[MessageBox]: Unexpected control type [15]
control[MessageBox]: Unexpected control type [15]

Share this post


Link to post
Share on other sites

I narrowed the problem down to this:

serverside script calls:

[_inf] execVM "client\player\turn.sqf";

I expected this to run on the client, but it only runs on the server. How to force a client to run a client side script from the server?

Share this post


Link to post
Share on other sites

[ [ _inf ], "BIS_fnc_execVM", _inf ] spawn BIS_fnc_MP;

This will execute the given script file only the client where "_inf" is local.

Share this post


Link to post
Share on other sites

Thanks,

How would the syntax look with my script name?

---------- Post added at 19:17 ---------- Previous post was at 18:51 ----------

I have used

[[ _inf], "client\player\turn.sqf", _inf, true] spawn BIS_fnc_MP;

But then a function error appears saying that function does not exist.

Share this post


Link to post
Share on other sites

Sorry my bad, forgot to include that part in the arguments. >.<

Try this:

[ [ [ _inf ], "client\player\turn.sqf" ], "BIS_fnc_execVM", _inf ] spawn BIS_fnc_MP;

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  

×