Jump to content
  • 0

log use of hotwirekits


VentZer0

Question

Hi
I have another half working idea that I need some help with.

A couple of vehicles disappeared on my server, and the owner are pretty surprised since I have indestructible locked vehicles.
But hotwirekits are extremely rare, so I want to monitor the use of them on vehicles.

This is what I did with the hotwire_veh.sqf

private ["_vehicle","_removed","_positionVeh","_positionPlayer","_vehiclediscrib","_logcursorTarget","_logcursorTargetType","_logplayerName","_logplayerID","_logplayerPos","_logvehicle","_logvehicleType","_logvehicleID","_logvehiclePos"];
_vehicle = _this select 3;
_positionVeh = getposATL _vehicle;
_positionPlayer = getposATL player;
_vehiclediscrib = _this;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_32") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
_removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove);
if (_removed == 1) then {
	if((random 20) > 15) then {
		PVDZE_veh_Lock = [_vehicle,false];
		if(player distance _vehicle < 10) then {
			if (local _vehicle) then {
				PVDZE_veh_Lock spawn local_lockUnlock
			} else {
				publicVariable "PVDZE_veh_Lock";
			};
		};
	} else {
		cutText [(localize "str_epoch_player_33") , "PLAIN DOWN"];
	};
};
_logplayerName = name player;
_logplayerID = (getPlayerUID player);
_logplayerPos = getposATL player;
_logvehicle = _vehicle;
_logvehicleID = _logvehicle getVariable ["CharacterID","0"];
_logvehiclePos = getposATL _vehicle;
diag_log format ["ATTENTION POSSIBLE-HOTWIREKIT-USE : %1 %2 %3 %4 %5 %6",_logplayerName,_logplayerID,_logplayerPos,_logvehicle,_logvehicleID,_logvehiclePos];
s_player_lockUnlock_crtl = -1;
DZE_ActionInProgress = false;



This gives out the diag_log line but only clientside, how do I get this to return the line serverside, so I can see it in the serverlog instead of in the local arma2oa.rpt file?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi

I have another half working idea that I need some help with.

A couple of vehicles disappeared on my server, and the owner are pretty surprised since I have indestructible locked vehicles.

But hotwirekits are extremely rare, so I want to monitor the use of them on vehicles.

This is what I did with the hotwire_veh.sqf

private ["_vehicle","_removed","_positionVeh","_positionPlayer","_vehiclediscrib","_logcursorTarget","_logcursorTargetType","_logplayerName","_logplayerID","_logplayerPos","_logvehicle","_logvehicleType","_logvehicleID","_logvehiclePos"];
_vehicle = _this select 3;
_positionVeh = getposATL _vehicle;
_positionPlayer = getposATL player;
_vehiclediscrib = _this;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_32") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
_removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove);
if (_removed == 1) then {
	if((random 20) > 15) then {
		PVDZE_veh_Lock = [_vehicle,false];
		if(player distance _vehicle < 10) then {
			if (local _vehicle) then {
				PVDZE_veh_Lock spawn local_lockUnlock
			} else {
				publicVariable "PVDZE_veh_Lock";
			};
		};
	} else {
		cutText [(localize "str_epoch_player_33") , "PLAIN DOWN"];
	};
};
_logplayerName = name player;
_logplayerID = (getPlayerUID player);
_logplayerPos = getposATL player;
_logvehicle = _vehicle;
_logvehicleID = _logvehicle getVariable ["CharacterID","0"];
_logvehiclePos = getposATL _vehicle;
diag_log format ["ATTENTION POSSIBLE-HOTWIREKIT-USE : %1 %2 %3 %4 %5 %6",_logplayerName,_logplayerID,_logplayerPos,_logvehicle,_logvehicleID,_logvehiclePos];
s_player_lockUnlock_crtl = -1;
DZE_ActionInProgress = false;

This gives out the diag_log line but only clientside, how do I get this to return the line serverside, so I can see it in the serverlog instead of in the local arma2oa.rpt file?

 

you need to publicvariable eventhandler for this, to make it simple you could just do something like this:

if(isServer)then{
	"PV_server_logevent" addPublicVariableEventHandler {diag_log format["[PV_SERVERLOGGER]: %1",(_this select 1)];};
};

now you can fire logs to the server from the clients like this:

PV_server_logevent = [name player,typeOf player,weapons player,items player,magazines player,worldName]
publicVariableServer "PV_server_logevent";

will return a serverlog looking like this:

[PV_SERVERLOGGER]: ["playername","playerskin",[players weapons],[players items],[players magazines],current worldname]
Link to comment
Share on other sites

  • 0

thx for the response!

clarification:

if(isServer)then{
	"PV_server_logevent" addPublicVariableEventHandler {diag_log format["[PV_SERVERLOGGER]: %1",(_this select 1)];};
};

does this go into the if (isServer) then {}; part of the init file, or does this have to be in the script that I want to get logs from?

Link to comment
Share on other sites

  • 0

thx for the response!

clarification:

if(isServer)then{
	"PV_server_logevent" addPublicVariableEventHandler {diag_log format["[PV_SERVERLOGGER]: %1",(_this select 1)];};
};

does this go into the if (isServer) then {}; part of the init file, or does this have to be in the script that I want to get logs from?

 

this event needs to be loaded on the server once, then it knows what to do when you use publicVariableServer

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...