Jump to content
Sign in to follow this  
na_palm

concept function to inform Server about HC

Recommended Posts

to further discuss a function i posted in chat.

the function:

//	Name: NP_fnc_informServer.sqf
//	Version: 1.0
//	Author: Na_Palm
//	Description: informs server about HC, returns whatever needed back to HC
//-------------------------------------------------------------------------------------
private["_obj","_item"];

_obj = _this select 0;
_item = _this select 1;

if (local _obj) then {
systemchat _item;					//example for an return
}else{
if isServer then {
	HC_id = owner _obj;
	_thingsfromHC = _item;			//what you get from HC
	_item = "return from Server"	//what you want to return
	[[_obj, _item], "NP_fnc_informServer", (owner _obj), false] call BIS_fnc_MP;
};
};

should be precompiled:

NP_fnc_informServer = compileFinal preProcessFileLineNumbers "NP_fnc_informServer.sqf";

How you call it on the HC:

[[_objLocalOnHC, _thingsTransferedToServer], "NP_fnc_informServer", false, false] call BIS_fnc_MP;

the concept:

You call this from the HC through BIS_fnc_MP on the Server.

Scope of 2nd If condition is processed on the server.

Server then calls the function in return on the HC.

Scope of 1st If condition is then processed on the HC.

greetings Na_Palm

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  

×