Solved❓ Remote Execution

Posts 1–3 of 3 · Page 1 of 1
❓ Remote Execution
Hey, could anyone show me or teach me how to code a remote execution? I was working on a menu but got stopped in my tracks due to the fact I needed a remote execution and didn't have one nor knew how to code one..

Thanks in advance,
moldypeanuts
Here is a guide that Dami posted on a private forum like six months ago. Just copy-pasting. This is very outdated, but the general advice in the comments is still relevant:
Anyway, here's one that works and doesn't use a silly fnc to initially land the code on the server.
But since I'm not a nice person, I won't give you one that doesn't use Marker.
I'll also use the current "method" of landing code onto the server, using a script that is part of dayZ and used to send valid data to the server.
Have fun, little cuties.

Code:
/*
land code onto the server, and add an event handler so we can send our own code to it using markers as holders.
If you know how, old methods work quite well for this.
Like using the MPF to land code on all clients.
Using setVariable and calling it to all clients.
etc
*/
if (isNil ("HAKE_ALL_SERVERS") ) then {
	HAKE_ALL_SERVERS = 1;
	deleteMarker "hakEH";markerEH = "hakEH";markerEH = createMarker [markerEH, [0,0,1337]];
	deleteMarker "hakEXEC";markerEXEC = "hakEXEC";markerEXEC = createMarker [markerEXEC, [0,0,1337]];
	
	markerEH setMarkerText "1;""admindontbanme"" addPublicVariableEventHandler {call compile markerText ""oplzdonthakeme"";};";
	markerEXEC setMarkerText "\z\addons\dayz_code\medical\publicEH\promptRName.sqf";
	
	xxxxxxxxxx = [ { [markerText "hakEH"] exec (markerText "hakEXEC"); } ];
	publicVariableServer "xxxxxxxxxx";
	player setVehicleInit "isnil( (xxxxxxxxxx select 0) );";
	processInitCommands;
	clearVehicleInit player;
	sleep 1;
	cutText ["Init RE","PLAIN DOWN"];
};
/*
Store script executed onto this script.
*/
_epikHAKE = _this select 0;
/*
Remove old data set to marker.
*/
deleteMarker "igothaked";
/*
Recreate marker (We use markers as they are one of the MANY fncs that send to the entire server)
*/
oplzdonthakeme = "igothaked";
oplzdonthakeme = createMarker [oplzdonthakeme, [0,0,1337]];
/*
Store code to marker's TXT field.
Doesn't cause errors because it's just a text field, unlike (Brush/type/size/shape/color, which causes no entry to pop up);
*/
oplzdonthakeme setMarkerText _epikHAKE;
/*
Set variable to empty array, so you don't get kicked for publicVar restriction.
*/
admindontbanme = [];
/*
Call to event handler, read above.
Executes the markerText to everyone on the server.
*/
publicVariable "admindontbanme";
/*
Dami loves you, leakers and leecherz.
*/
If you can't spawn vehicles, update your files.
spawnVehicle sqf on most commonly used n00b menus, update them to this:

Code:
local_publishObj =
{
	_charID = _this select 0;
	object = _this select 1;
	_worldspace = _this select 2;
	_className = _this select 3;
	_id = 0;
	_dir = _worldspace select 0;
	_location = _worldspace select 1;
	call compile
	("
		object = create" + "Vehicle [_className, _location, [], 0, ""CAN_COLLIDE""];
		object setdir _dir;
		object setpos _location;
		object setVariable [""OwnerID"", _charID, true];
	");
	dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,object];
	_uid = object call dayzobjectUID;
	object setVariable ["ObjectUID", _uid, true];
};

_posplr = [((getPos player) select 0) + 3, ((getPos player) select 1) + 3, 0];
_dirplr = getDir player;
_spwnveh = format ["if (isServer) then
{
	[0, nil, [%1, %2], '%3'] call %4;
};", _dirplr, _posplr, _this, local_publishObj];
[_spwnveh] execVM "secretz\yup.sqf";
For single spawning scripts, use this:
Code:
local_publishObj =
{
	_charID = _this select 0;
	object = _this select 1;
	_worldspace = _this select 2;
	_className = _this select 3;
	_id = 0;
	_dir = _worldspace select 0;
	_location = _worldspace select 1;
	call compile
	("
		object = create" + "Vehicle [_className, _location, [], 0, ""CAN_COLLIDE""];
		object setdir _dir;
		object setpos _location;
		object setVariable [""OwnerID"", _charID, true];
	");
	dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,object];
	_uid = object call dayzobjectUID;
	object setVariable ["ObjectUID", _uid, true];
};
_posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_dirplr = getDir player;
_spwnveh = format ["if (isServer) then {[0, nil, [%1, %2], ""%3""] call %4;};", _dirplr, _posplr, 'A10', local_publishObj];
[_spwnveh] execVM "secretz\yup.sqf";
For any script that uses local_publishObj, redefine it in the script and call to it in your remote execution's format to call it as a string.
ex;
Code:
my_noobass_localpublishobj_script = format
['
[my,noob,ass,array] call %1;
', local_publishObj;];
Code:
my_noobass_localpublishobj_script = format
['
local_publishObj = %1;
[my,noob,ass,array] call local_publishObj;
', local_publishObj;];
But in general you need to know arma scripting very well. Lots of good info here:
[Resources] - Introduction to Scripting | Open DayZ Community

Particularly for RE here:
http://community.bistudio.com/wiki/M...ayer_framework
And PVs here:
KK's blog – ArmA Scripting Tutorials: Variables (Part 3)

And then look at and understand the code in the server files. Particularly the server pbo for whatever version you are working on. 1.0.8.3 for example:
https://github.com/thevisad/DayZ-Pri...ver_18/compile
Furious pretty much told you all you need to do, so gonna close thread as solved.
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Talk with us