Jump to content

Logging attempts to hijack


Recommended Posts

Hello. It's my first job, please tell me if you find errors.

 

Little client-server script, who write to server RPT, when player try hijack vehicle.

Features:

* Log all attempts

* Forbid list of classnames

* Tabu on hijack in sage-zone (Infistar)

 

It look like:

              name && playerUID     classname && objectID     GPS            coords            result
[HOTWIRE]: dimquea (**************) BTR90 (*************) at @123123 [123.123,123.123,0.123] - SUCCESS
[HOTWIRE]: dimquea (**************) BTR90 (*************) at @123123 [123.123,123.123,0.123] - FAIL
[HOTWIRE]: dimquea (**************) BTR90 (*************) at @123123 [123.123,123.123,0.123] - HW-Forbid
[HOTWIRE]: dimquea (**************) BTR90 (*************) at @123123 [123.123,123.123,0.123] - Safe-Zone

Instruction:

 

mission.pbo

1) In fn_selfActions.sqf find

_Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "\z\addons\dayz_code\actions\hotwire_veh.sqf",_cursortarget, 2, true, true, "", ""];

replace to

_Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_HOTWIRE",_text], "hotwire_veh.sqf",_cursortarget, 2, true, true, "", ""];

2) make file hotwire_veh.sqf, and put in code:

////////////////////////////////////////////////////////////////////////////////////
// [RU48] Y.O.B.A // https://vk.com/dayz48 // [email protected] // skype: dimquea //
////////////////////////////////////////////////////////////////////////////////////
private ["_vehicle","_donVeh","_pos","_map","_uid","_class","_removed","_hotw","_id"];
_vehicle = _this select 3;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_32") , "PLAIN DOWN"]; };
_pos = getPosATL player;
_map = mapGridPosition getPos player;
_uid = getPlayerUID player;
_class = typeOf _vehicle;
_id = _vehicle getVariable['ObjectID','0'];

_donVeh = ["T90","M1A1","BTR90","BMP2_INS","BMP2_CDF","GAZ_Vodnik_HMG","Su34","F35B","MI24_D","Ka60_GL_PMC","Mi171Sh_rockets_CZ_EP1"];
if (typeOf cursorTarget in _donVeh) exitWith {
	cutText [("Нельзя взломать.") , "PLAIN DOWN"];
	_hotw = "HW-Forbid";
	PVDZE_atp = format["[HOTWIRE]: %2 (%3) %4 (%7) at @%6 %5 - %1",_hotw,(name player),_uid,_class,_pos,_map,_id];
	publicVariableServer "PVDZE_atp";
};
if (!isNil 'outNow') exitWith {
	cutText [("Нельзя взламывать в сейф-зоне.") , "PLAIN DOWN"];
	_hotw = "Safe-Zone";
	PVDZE_atp = format["[HOTWIRE]: %2 (%3) %4 (%7) at @%6 %5 - %1",_hotw,(name player),_uid,_class,_pos,_map,_id];
	publicVariableServer "PVDZE_atp";
};
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 10) <= 7.5) 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";
				_hotw = "SUCCESS";
				PVDZE_atp = format["[HOTWIRE]: %2 (%3) %4 (%7) at @%6 %5 - %1",_hotw,(name player),_uid,_class,_pos,_map,_id];
				publicVariableServer "PVDZE_atp";
			};
		};
	} else {
		cutText [(localize "str_epoch_player_33") , "PLAIN DOWN"];
		_hotw = "FAIL";
		PVDZE_atp = format["[HOTWIRE]: %2 (%3) %4 (%7) at @%6 %5 - %1",_hotw,(name player),_uid,_class,_pos,_map,_id];
		publicVariableServer "PVDZE_atp";
	};
};
s_player_lockUnlock_crtl = -1;
DZE_ActionInProgress = false;

done!

 

I hope it be usefull.

Sorry for my English, pm me if you find errors.

 

UPD 31.05.15: migrate to PVDZE_atp.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...