/* File: fn_stealKey.sqf Author: S.Lambert Description: Gives a copy of the key to the player send in parameter */ private["_thief","_veh","_uid","_owners","_index","_vehicle"]; _thief = _this select 0; if(isNull _thief OR isNil "_thief") exitWith { diag_log format["::stealKey:: Problem don't have receive theif", _thief]; }; for "_i" from 0 to (count life_vehicles)-1 do { _veh = life_vehicles select _i; if (!(_veh isKindOf "House_F")) then //Can't steal house key ! { if(!isNull _veh && alive _veh && (_veh distance _thief) < 25) then //Only proximity véhicle { _uid = getPlayerUID _thief; _owners = _veh getVariable "vehicle_info_owners"; _index = [_uid,_owners] call life_fnc_index; if(_index == -1) then { _owners pushBack [_uid,_thief getVariable["realname",name _thief]]; _veh setVariable["vehicle_info_owners",_owners,true]; }; [[format["::StealKey System :: %1 steals keys of %2", name _thief, name player]],"TON_fnc_writeLog",false,false] spawn life_fnc_MP; hint format["Dein Autoschüssel wird gerade geklaut von %1",typeOf _veh]; [[_veh,_thief,profileName], "life_fnc_clientGetKey",_thief,false] spawn life_fnc_MP; }; }; };