Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Need help?

    Create a topic in the appropriate section
    Don't write everything in the chat!
  • Take a look at the marketplace

    There you can buy
    everything related to game servers
  • Don't want a ban?

    Please read our rules
    Don't disturb the order!
  • Sell or buy?

    Use services of the guarantor
    We will make your deal safe
  • 0
exploadead

Altis Life 4.4 действие на клавишу Q

Привет всем!
На версии 4.0 лайфа имело место выполнение действия по добыче ископаемых с помощью кирки и тд. на клавишу Q
Однако на версии 4.4 такого нет и приходится каждый раз заходить в инвентарь и нажимать на кирке Использовать чтобы совершить лишь одну попытку добычи.

Подскажите как можно добавить горячую клавишу Q для этого действия? Можно за вознаграждение!

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

Привет всем!

На версии 4.0 лайфа имело место выполнение действия по добыче ископаемых с помощью кирки и тд. на клавишу Q

Однако на версии 4.4 такого нет и приходится каждый раз заходить в инвентарь и нажимать на кирке Использовать чтобы совершить лишь одну попытку добычи.

Подскажите как можно добавить горячую клавишу Q для этого действия? Можно за вознаграждение!

 

Дело в том, что забиндить можно любую клавишу)), смотри файлы: 

 

fn_actionKeyHandler.sqf

fn_keyHandler.sqf

Share this post


Link to post
Share on other sites



  • 0

Это понятно... но где взять само "действие киркой" ? Пытался сделать по примеру как в 4.0... не сработало...

Share this post


Link to post
Share on other sites
  • 0

Это понятно... но где взять само "действие киркой" ? Пытался сделать по примеру как в 4.0... не сработало...

 

Выложи сюда код вышеперечисленных файлов.

Share this post


Link to post
Share on other sites
  • 0

Собственно вот эти файлы на текущей версии 4.4 :

 

#include "..\..\script_macros.hpp"
/*
*    File: fn_keyHandler.sqf
*    Author: Bryan "Tonic" Boardwine
*
*    Description:
*    Main key handler for event 'keyDown'
*/
private ["_handled","_shift","_alt","_code","_ctrl","_alt","_ctrlKey","_veh","_locked","_interactionKey","_mapKey","_interruptionKeys"];
_ctrl = SEL(_this,0);
_code = SEL(_this,1);
_shift = SEL(_this,2);
_ctrlKey = SEL(_this,3);
_alt = SEL(_this,4);
_speed = speed cursorTarget;
_handled = false;


_interactionKey = if((EQUAL(count (actionKeys "User10"),0))) then {219} else {(actionKeys "User10") select 0};
_mapKey = SEL(actionKeys "ShowMap",0);
//hint str _code;
_interruptionKeys = [17,30,31,32]; //A,S,W,D


//Vault handling...
if((_code in (actionKeys "GetOver") || _code in (actionKeys "salute") || _code in (actionKeys "SitDown") || _code in (actionKeys "Throw") || _code in (actionKeys "GetIn") || _code in (actionKeys "GetOut") || _code in (actionKeys "Fire") || _code in (actionKeys "ReloadMagazine") || _code in [16,18]) && ((player GVAR ["restrained",false]) || (player GVAR ["playerSurrender",false]) || life_isknocked || life_istazed)) exitWith {
    true;
};


if(life_action_inUse) exitWith {
    if(!life_interrupted && _code in _interruptionKeys) then {life_interrupted = true;};
    _handled;
};


//Hotfix for Interaction key not being able to be bound on some operation systems.
if(!(EQUAL(count (actionKeys "User10"),0)) && {(inputAction "User10" > 0)}) exitWith {
    //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
    if(!life_action_inUse) then {
        [] spawn {
            private "_handle";
            _handle = [] spawn life_fnc_actionKeyHandler;
            waitUntil {scriptDone _handle};
            life_action_inUse = false;
        };
    };
    true;
};


if (life_container_active) then {
    switch (_code) do {
        //space key
        case 57: {
            [life_container_activeObj] spawn life_fnc_placedefinestorage;
        };
    };
    true;
};


switch (_code) do {
    //Space key for Jumping
    case 57: {
        if(isNil "jumpActionTime") then {jumpActionTime = 0;};
        if(_shift && {!(EQUAL(animationState player,"AovrPercMrunSrasWrflDf"))} && {isTouchingGround player} && {EQUAL(stance player,"STAND")} && {speed player > 2} && {!life_is_arrested} && {SEL((velocity player),2) < 2.5} && {time - jumpActionTime > 1.5}) then {
            jumpActionTime = time; //Update the time.
            [player,true] spawn life_fnc_jumpFnc; //Local execution
            [player,false] remoteExec ["life_fnc_jumpFnc",RANY]; //Global execution
            _handled = true;
        };
    };


    //Surrender (Shift + B)
    case 48: {
        if(_shift) then {
            if(player GVAR ["playerSurrender",false]) then {
                player SVAR ["playerSurrender",false,true];
            } else {
                [] spawn life_fnc_surrender;
            };
            _handled = true;
        };
    };


    //Map Key
    case _mapKey: {
        switch (playerSide) do {
            case west: {if(!visibleMap) then {[] spawn life_fnc_copMarkers;}};
            case independent: {if(!visibleMap) then {[] spawn life_fnc_medicMarkers;}};
            case civilian: {if(!visibleMap) then {[] spawn life_fnc_civMarkers;}};
        };
    };


    //Holster / recall weapon. (Shift + H)
    case 35: {
        if(_shift && !_ctrlKey && !(EQUAL(currentWeapon player,""))) then {
            life_curWep_h = currentWeapon player;
            player action ["SwitchWeapon", player, player, 100];
            player switchCamera cameraView;
        };


        if(!_shift && _ctrlKey && !isNil "life_curWep_h" && {!(EQUAL(life_curWep_h,""))}) then {
            if(life_curWep_h in [RIFLE,LAUNCHER,PISTOL]) then {
                player selectWeapon life_curWep_h;
            };
        };
    };


    //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
    case _interactionKey: {
        if(!life_action_inUse) then {
            [] spawn  {
                private "_handle";
                _handle = [] spawn life_fnc_actionKeyHandler;
                waitUntil {scriptDone _handle};
                life_action_inUse = false;
            };
        };
    };


    //Restraining (Shift + R)
    case 19: {
        if(_shift) then {_handled = true;};
        if(_shift && playerSide == west && {!isNull cursorTarget} && {cursorTarget isKindOf "Man"} && {(isPlayer cursorTarget)} && {(side cursorTarget in [civilian,independent])} && {alive cursorTarget} && {cursorTarget distance player < 3.5} && {!(cursorTarget GVAR "Escorting")} && {!(cursorTarget GVAR "restrained")} && {speed cursorTarget < 1}) then {
            [] call life_fnc_restrainAction;
        };
    };


    //Knock out, this is experimental and yeah... (Shift + G)
    case 34: {
        if(_shift) then {_handled = true;};
        if(_shift && playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" && isPlayer cursorTarget && alive cursorTarget && cursorTarget distance player < 4 && speed cursorTarget < 1) then {
            if((animationState cursorTarget) != "Incapacitated" && (currentWeapon player == primaryWeapon player OR currentWeapon player == handgunWeapon player) && currentWeapon player != "" && !life_knockout && !(player GVAR ["restrained",false]) && !life_istazed && !life_isknocked) then {
                [cursorTarget] spawn life_fnc_knockoutAction;
            };
        };
    };


    //T Key (Trunk)
    case 20: {
        if(!_alt && !_ctrlKey && !dialog && {!life_action_inUse}) then {
            if(vehicle player != player && alive vehicle player) then {
                if((vehicle player) in life_vehicles) then {
                    [vehicle player] call life_fnc_openInventory;
                };
            } else {
                private "_list";
                _containers = [getPosATL player, ["Box_IND_Grenades_F","B_supplyCrate_F"], 2.5] call life_fnc_nearestObjects;
                if (count _containers > 0) then {
                    _container = _containers select 0;
                    [_container] call life_fnc_openInventory;
                } else {
                    _list = ["landVehicle","Air","Ship"];
                    if(KINDOF_ARRAY(cursorTarget,_list) && {player distance cursorTarget < 7} && {vehicle player == player} && {alive cursorTarget} && {!life_action_inUse}) then {
                        if(cursorTarget in life_vehicles) then {
                            [cursorTarget] call life_fnc_openInventory;
                        };
                    };
                };
            };
        };
    };


    //L Key?
    case 38: {
        //If cop run checks for turning lights on.
        if(_shift && playerSide in [west,independent]) then {
            if(vehicle player != player && (typeOf vehicle player) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
                if(!isNil {vehicle player GVAR "lights"}) then {
                    if(playerSide == west) then {
                        [vehicle player] call life_fnc_sirenLights;
                    } else {
                        [vehicle player] call life_fnc_medicSirenLights;
                    };
                    _handled = true;
                };
            };
        };


        if(!_alt && !_ctrlKey) then { [] call life_fnc_radar; };
    };


    //Y Player Menu
    case 21: {
        if(!_alt && !_ctrlKey && !dialog && !(player GVAR ["restrained",false]) && {!life_action_inUse}) then {
            [] call life_fnc_p_openMenu;
        };
    };


    //F Key
    case 33: {
        if(playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
            [] spawn {
                life_siren_active = true;
                sleep 4.7;
                life_siren_active = false;
            };


            _veh = vehicle player;
            if(isNil {_veh GVAR "siren"}) then {_veh SVAR ["siren",false,true];};
            if((_veh GVAR "siren")) then {
                titleText [localize "STR_MISC_SirensOFF","PLAIN"];
                _veh SVAR ["siren",false,true];
            } else {
                titleText [localize "STR_MISC_SirensON","PLAIN"];
                _veh SVAR ["siren",true,true];
                if(playerSide == west) then {
                    [_veh] remoteExec ["life_fnc_copSiren",RCLIENT];
                } else {
                    [_veh] remoteExec ["life_fnc_medicSiren",RCLIENT];
                };
            };
        };
    };


    //O Key
    case 24: {
        if(_shift) then {
            if (soundVolume != 1) then {
                1 fadeSound 1;
                systemChat localize "STR_MISC_soundnormal";
            } else {
                1 fadeSound 0.1;
                systemChat localize "STR_MISC_soundfade";
            };
        };
    };
    




    //U Key
    case 22: {
        if(!_alt && !_ctrlKey) then {
            if(vehicle player == player) then {
                _veh = cursorTarget;
            } else {
                _veh = vehicle player;
            };


            if(_veh isKindOf "House_F" && {playerSide == civilian}) then {
                if(_veh in life_vehicles && player distance _veh < 8) then {
                    _door = [_veh] call life_fnc_nearestDoor;
                    if(EQUAL(_door,0)) exitWith {hint localize "STR_House_Door_NotNear"};
                    _locked = _veh GVAR [format["bis_disabled_Door_%1",_door],0];


                    if(EQUAL(_locked,0)) then {
                        _veh SVAR [format["bis_disabled_Door_%1",_door],1,true];
                        _veh animate [format["door_%1_rot",_door],0];
                        systemChat localize "STR_House_Door_Lock";
                    } else {
                        _veh SVAR [format["bis_disabled_Door_%1",_door],0,true];
                        _veh animate [format["door_%1_rot",_door],1];
                        systemChat localize "STR_House_Door_Unlock";
                    };
                };
            } else {
                _locked = locked _veh;
                if(_veh in life_vehicles && player distance _veh < 8) then {
                    if(EQUAL(_locked,2)) then {
                        if(local _veh) then {
                            _veh lock 0;
                        } else {
                            [_veh,0] remoteExecCall ["life_fnc_lockVehicle",_veh];
                        };
                        systemChat localize "STR_MISC_VehUnlock";
                    } else {
                        if(local _veh) then {
                            _veh lock 2;
                        } else {
                            [_veh,2] remoteExecCall ["life_fnc_lockVehicle",_veh];
                        };
                        systemChat localize "STR_MISC_VehLock";
                    };
                };
            };
        };
    };
};


_handled;
 

 

 

и

 

 

 

#include "..\..\script_macros.hpp"/*
    File: fn_actionKeyHandler.sqf
    Author: Bryan "Tonic" Boardwine


    Description:
    Master action key handler, handles requests for picking up various items and
    interacting with other players (Cops = Cop Menu for unrestrain,escort,stop escort, arrest (if near cop hq), etc).
*/
private["_curTarget","_isWater","_CrateModelNames","_crate"];
_curTarget = cursorTarget;
if(life_action_inUse) exitWith {}; //Action is in use, exit to prevent spamming.
if(life_interrupted) exitWith {life_interrupted = false;};
_isWater = surfaceIsWater (visiblePositionASL player);


if(EQUAL(LIFE_SETTINGS(getNumber,"global_ATM"),1)) then{
    //Check if the player is near an ATM.
    if((call life_fnc_nearATM) && {!dialog}) exitWith {
        [] call life_fnc_atmMenu;
    };
};


if(isNull _curTarget) exitWith {
    if(_isWater) then {
        private "_fish";
        _fish = (nearestObjects[visiblePosition player,["Fish_Base_F"],3]) select 0;
        if(!isNil "_fish") then {
            [_fish] call life_fnc_catchFish;
        };
    } else {
        _animals = [position player, ["Sheep_random_F","Goat_random_F","Hen_random_F","Cock_random_F","Rabbit_F"], 3.5] call life_fnc_nearestObjects;
        if (count _animals > 0) then {
            _animal = _animals select 0;
            if (!alive _animal) then {
                [_animal] call life_fnc_gutAnimal;
            };
        } else {
            if(playerSide == civilian && !life_action_gathering) then {
                if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
                life_action_gathering = true;
                _handle = [] spawn life_fnc_gather;
                waitUntil {scriptDone _handle};
                life_action_gathering = false;
            };
        };
    };
};


if((_curTarget isKindOf "B_supplyCrate_F" OR _curTarget isKindOf "Box_IND_Grenades_F") && {player distance _curTarget < 3} ) exitWith {
    if(alive _curTarget) then {
        [_curTarget] call life_fnc_containerMenu;
    };
};


if(_curTarget isKindOf "House_F" && {player distance _curTarget < 12} OR ((nearestObject [[16019.5,16952.9,0],"Land_Dome_Big_F"]) == _curTarget OR (nearestObject [[16019.5,16952.9,0],"Land_Research_house_V1_F"]) == _curTarget)) exitWith {
    [_curTarget] call life_fnc_houseMenu;
};


if(dialog) exitWith {}; //Don't bother when a dialog is open.
if(vehicle player != player) exitWith {}; //He's in a vehicle, cancel!
life_action_inUse = true;


//Temp fail safe.
[] spawn {
    sleep 60;
    life_action_inUse = false;
};


//Check if it's a dead body.
if(_curTarget isKindOf "Man" && {!alive _curTarget} && !(_curTarget GVAR["Revive",false]) && {playerSide in [west,independent]}) exitWith {
    //Hotfix code by ins0
    if(((playerSide == west && {(EQUAL(LIFE_SETTINGS(getNumber,"revive_cops"),1))}) || playerSide == independent) && {"Medikit" in (items player)}) then {
        [_curTarget] call life_fnc_revivePlayer;
    };
};




//If target is a player then check if we can use the cop menu.
if(isPlayer _curTarget && _curTarget isKindOf "Man") then {
    if((_curTarget GVAR ["restrained",false]) && !dialog && playerSide == west) then {
        [_curTarget] call life_fnc_copInteractionMenu;
    };
} else {
    //OK, it wasn't a player so what is it?
    private["_isVehicle","_miscItems","_money","_list"];


    _list = ["landVehicle","Ship","Air"];
    _isVehicle = if(KINDOF_ARRAY(_curTarget,_list)) then {true} else {false};
    _miscItems = ["Land_BottlePlastic_V1_F","Land_TacticalBacon_F","Land_Can_V3_F","Land_CanisterFuel_F","Land_Suitcase_F"];
    _animalTypes = ["Salema_F","Ornate_random_F","Mackerel_F","Tuna_F","Mullet_F","CatShark_F","Turtle_F"];
    _money = "Land_Money_F";


    //It's a vehicle! open the vehicle interaction key!
    if(_isVehicle) then {
        if(!dialog) then {
            if(player distance _curTarget < SEL(SEL(boundingBox _curTarget,1),0)+2) then {
                [_curTarget] call life_fnc_vInteractionMenu;
            };
        };
    } else {
        //Is it a animal type?
        if((typeOf _curTarget) in _animalTypes) then {
            if(EQUAL((typeOf _curTarget),"Turtle_F") && !alive _curTarget) then {
                private "_handle";
                _handle = [_curTarget] spawn life_fnc_catchTurtle;
                waitUntil {scriptDone _handle};
            } else {
                private "_handle";
                _handle = [_curTarget] spawn life_fnc_catchFish;
                waitUntil {scriptDone _handle};
            };
        } else {
            //OK, it wasn't a vehicle so let's see what else it could be?
            if((typeOf _curTarget) in _miscItems) then {
                [_curTarget,player,false] remoteExecCall ["TON_fnc_pickupAction",RSERV];
            } else {
                //It wasn't a misc item so is it money?
                if(EQUAL((typeOf _curTarget),_money) && {!(_curTarget GVAR ["inUse",false])}) then {
                    [_curTarget,player,true] remoteExecCall ["TON_fnc_pickupAction",RSERV];
                };
            };
        };
    };
};
 

 

 

Как сделать чтобы на Q бралась именно кирка и добывала ресурс... не понимаю((

Edited by exploadead (see edit history)

Share this post


Link to post
Share on other sites
  • 0

Собственно вот эти файлы на текущей версии 4.4 :

 

#include "..\..\script_macros.hpp"
/*
*    File: fn_keyHandler.sqf
*    Author: Bryan "Tonic" Boardwine
*
*    Description:
*    Main key handler for event 'keyDown'
*/
private ["_handled","_shift","_alt","_code","_ctrl","_alt","_ctrlKey","_veh","_locked","_interactionKey","_mapKey","_interruptionKeys"];
_ctrl = SEL(_this,0);
_code = SEL(_this,1);
_shift = SEL(_this,2);
_ctrlKey = SEL(_this,3);
_alt = SEL(_this,4);
_speed = speed cursorTarget;
_handled = false;


_interactionKey = if((EQUAL(count (actionKeys "User10"),0))) then {219} else {(actionKeys "User10") select 0};
_mapKey = SEL(actionKeys "ShowMap",0);
//hint str _code;
_interruptionKeys = [17,30,31,32]; //A,S,W,D


//Vault handling...
if((_code in (actionKeys "GetOver") || _code in (actionKeys "salute") || _code in (actionKeys "SitDown") || _code in (actionKeys "Throw") || _code in (actionKeys "GetIn") || _code in (actionKeys "GetOut") || _code in (actionKeys "Fire") || _code in (actionKeys "ReloadMagazine") || _code in [16,18]) && ((player GVAR ["restrained",false]) || (player GVAR ["playerSurrender",false]) || life_isknocked || life_istazed)) exitWith {
    true;
};


if(life_action_inUse) exitWith {
    if(!life_interrupted && _code in _interruptionKeys) then {life_interrupted = true;};
    _handled;
};


//Hotfix for Interaction key not being able to be bound on some operation systems.
if(!(EQUAL(count (actionKeys "User10"),0)) && {(inputAction "User10" > 0)}) exitWith {
    //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
    if(!life_action_inUse) then {
        [] spawn {
            private "_handle";
            _handle = [] spawn life_fnc_actionKeyHandler;
            waitUntil {scriptDone _handle};
            life_action_inUse = false;
        };
    };
    true;
};


if (life_container_active) then {
    switch (_code) do {
        //space key
        case 57: {
            [life_container_activeObj] spawn life_fnc_placedefinestorage;
        };
    };
    true;
};


switch (_code) do {
    //Space key for Jumping
    case 57: {
        if(isNil "jumpActionTime") then {jumpActionTime = 0;};
        if(_shift && {!(EQUAL(animationState player,"AovrPercMrunSrasWrflDf"))} && {isTouchingGround player} && {EQUAL(stance player,"STAND")} && {speed player > 2} && {!life_is_arrested} && {SEL((velocity player),2) < 2.5} && {time - jumpActionTime > 1.5}) then {
            jumpActionTime = time; //Update the time.
            [player,true] spawn life_fnc_jumpFnc; //Local execution
            [player,false] remoteExec ["life_fnc_jumpFnc",RANY]; //Global execution
            _handled = true;
        };
    };


    //Surrender (Shift + B)
    case 48: {
        if(_shift) then {
            if(player GVAR ["playerSurrender",false]) then {
                player SVAR ["playerSurrender",false,true];
            } else {
                [] spawn life_fnc_surrender;
            };
            _handled = true;
        };
    };


    //Map Key
    case _mapKey: {
        switch (playerSide) do {
            case west: {if(!visibleMap) then {[] spawn life_fnc_copMarkers;}};
            case independent: {if(!visibleMap) then {[] spawn life_fnc_medicMarkers;}};
            case civilian: {if(!visibleMap) then {[] spawn life_fnc_civMarkers;}};
        };
    };


    //Holster / recall weapon. (Shift + H)
    case 35: {
        if(_shift && !_ctrlKey && !(EQUAL(currentWeapon player,""))) then {
            life_curWep_h = currentWeapon player;
            player action ["SwitchWeapon", player, player, 100];
            player switchCamera cameraView;
        };


        if(!_shift && _ctrlKey && !isNil "life_curWep_h" && {!(EQUAL(life_curWep_h,""))}) then {
            if(life_curWep_h in [RIFLE,LAUNCHER,PISTOL]) then {
                player selectWeapon life_curWep_h;
            };
        };
    };


    //Interaction key (default is Left Windows, can be mapped via Controls -> Custom -> User Action 10)
    case _interactionKey: {
        if(!life_action_inUse) then {
            [] spawn  {
                private "_handle";
                _handle = [] spawn life_fnc_actionKeyHandler;
                waitUntil {scriptDone _handle};
                life_action_inUse = false;
            };
        };
    };


    //Restraining (Shift + R)
    case 19: {
        if(_shift) then {_handled = true;};
        if(_shift && playerSide == west && {!isNull cursorTarget} && {cursorTarget isKindOf "Man"} && {(isPlayer cursorTarget)} && {(side cursorTarget in [civilian,independent])} && {alive cursorTarget} && {cursorTarget distance player < 3.5} && {!(cursorTarget GVAR "Escorting")} && {!(cursorTarget GVAR "restrained")} && {speed cursorTarget < 1}) then {
            [] call life_fnc_restrainAction;
        };
    };


    //Knock out, this is experimental and yeah... (Shift + G)
    case 34: {
        if(_shift) then {_handled = true;};
        if(_shift && playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" && isPlayer cursorTarget && alive cursorTarget && cursorTarget distance player < 4 && speed cursorTarget < 1) then {
            if((animationState cursorTarget) != "Incapacitated" && (currentWeapon player == primaryWeapon player OR currentWeapon player == handgunWeapon player) && currentWeapon player != "" && !life_knockout && !(player GVAR ["restrained",false]) && !life_istazed && !life_isknocked) then {
                [cursorTarget] spawn life_fnc_knockoutAction;
            };
        };
    };


    //T Key (Trunk)
    case 20: {
        if(!_alt && !_ctrlKey && !dialog && {!life_action_inUse}) then {
            if(vehicle player != player && alive vehicle player) then {
                if((vehicle player) in life_vehicles) then {
                    [vehicle player] call life_fnc_openInventory;
                };
            } else {
                private "_list";
                _containers = [getPosATL player, ["Box_IND_Grenades_F","B_supplyCrate_F"], 2.5] call life_fnc_nearestObjects;
                if (count _containers > 0) then {
                    _container = _containers select 0;
                    [_container] call life_fnc_openInventory;
                } else {
                    _list = ["landVehicle","Air","Ship"];
                    if(KINDOF_ARRAY(cursorTarget,_list) && {player distance cursorTarget < 7} && {vehicle player == player} && {alive cursorTarget} && {!life_action_inUse}) then {
                        if(cursorTarget in life_vehicles) then {
                            [cursorTarget] call life_fnc_openInventory;
                        };
                    };
                };
            };
        };
    };


    //L Key?
    case 38: {
        //If cop run checks for turning lights on.
        if(_shift && playerSide in [west,independent]) then {
            if(vehicle player != player && (typeOf vehicle player) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
                if(!isNil {vehicle player GVAR "lights"}) then {
                    if(playerSide == west) then {
                        [vehicle player] call life_fnc_sirenLights;
                    } else {
                        [vehicle player] call life_fnc_medicSirenLights;
                    };
                    _handled = true;
                };
            };
        };


        if(!_alt && !_ctrlKey) then { [] call life_fnc_radar; };
    };


    //Y Player Menu
    case 21: {
        if(!_alt && !_ctrlKey && !dialog && !(player GVAR ["restrained",false]) && {!life_action_inUse}) then {
            [] call life_fnc_p_openMenu;
        };
    };


    //F Key
    case 33: {
        if(playerSide in [west,independent] && {vehicle player != player} && {!life_siren_active} && {((driver vehicle player) == player)}) then {
            [] spawn {
                life_siren_active = true;
                sleep 4.7;
                life_siren_active = false;
            };


            _veh = vehicle player;
            if(isNil {_veh GVAR "siren"}) then {_veh SVAR ["siren",false,true];};
            if((_veh GVAR "siren")) then {
                titleText [localize "STR_MISC_SirensOFF","PLAIN"];
                _veh SVAR ["siren",false,true];
            } else {
                titleText [localize "STR_MISC_SirensON","PLAIN"];
                _veh SVAR ["siren",true,true];
                if(playerSide == west) then {
                    [_veh] remoteExec ["life_fnc_copSiren",RCLIENT];
                } else {
                    [_veh] remoteExec ["life_fnc_medicSiren",RCLIENT];
                };
            };
        };
    };


    //O Key
    case 24: {
        if(_shift) then {
            if (soundVolume != 1) then {
                1 fadeSound 1;
                systemChat localize "STR_MISC_soundnormal";
            } else {
                1 fadeSound 0.1;
                systemChat localize "STR_MISC_soundfade";
            };
        };
    };
    




    //U Key
    case 22: {
        if(!_alt && !_ctrlKey) then {
            if(vehicle player == player) then {
                _veh = cursorTarget;
            } else {
                _veh = vehicle player;
            };


            if(_veh isKindOf "House_F" && {playerSide == civilian}) then {
                if(_veh in life_vehicles && player distance _veh < 8) then {
                    _door = [_veh] call life_fnc_nearestDoor;
                    if(EQUAL(_door,0)) exitWith {hint localize "STR_House_Door_NotNear"};
                    _locked = _veh GVAR [format["bis_disabled_Door_%1",_door],0];


                    if(EQUAL(_locked,0)) then {
                        _veh SVAR [format["bis_disabled_Door_%1",_door],1,true];
                        _veh animate [format["door_%1_rot",_door],0];
                        systemChat localize "STR_House_Door_Lock";
                    } else {
                        _veh SVAR [format["bis_disabled_Door_%1",_door],0,true];
                        _veh animate [format["door_%1_rot",_door],1];
                        systemChat localize "STR_House_Door_Unlock";
                    };
                };
            } else {
                _locked = locked _veh;
                if(_veh in life_vehicles && player distance _veh < 8) then {
                    if(EQUAL(_locked,2)) then {
                        if(local _veh) then {
                            _veh lock 0;
                        } else {
                            [_veh,0] remoteExecCall ["life_fnc_lockVehicle",_veh];
                        };
                        systemChat localize "STR_MISC_VehUnlock";
                    } else {
                        if(local _veh) then {
                            _veh lock 2;
                        } else {
                            [_veh,2] remoteExecCall ["life_fnc_lockVehicle",_veh];
                        };
                        systemChat localize "STR_MISC_VehLock";
                    };
                };
            };
        };
    };
};


_handled;
 

 

 

и

 

 

 

#include "..\..\script_macros.hpp"/*
    File: fn_actionKeyHandler.sqf
    Author: Bryan "Tonic" Boardwine


    Description:
    Master action key handler, handles requests for picking up various items and
    interacting with other players (Cops = Cop Menu for unrestrain,escort,stop escort, arrest (if near cop hq), etc).
*/
private["_curTarget","_isWater","_CrateModelNames","_crate"];
_curTarget = cursorTarget;
if(life_action_inUse) exitWith {}; //Action is in use, exit to prevent spamming.
if(life_interrupted) exitWith {life_interrupted = false;};
_isWater = surfaceIsWater (visiblePositionASL player);


if(EQUAL(LIFE_SETTINGS(getNumber,"global_ATM"),1)) then{
    //Check if the player is near an ATM.
    if((call life_fnc_nearATM) && {!dialog}) exitWith {
        [] call life_fnc_atmMenu;
    };
};


if(isNull _curTarget) exitWith {
    if(_isWater) then {
        private "_fish";
        _fish = (nearestObjects[visiblePosition player,["Fish_Base_F"],3]) select 0;
        if(!isNil "_fish") then {
            [_fish] call life_fnc_catchFish;
        };
    } else {
        _animals = [position player, ["Sheep_random_F","Goat_random_F","Hen_random_F","Cock_random_F","Rabbit_F"], 3.5] call life_fnc_nearestObjects;
        if (count _animals > 0) then {
            _animal = _animals select 0;
            if (!alive _animal) then {
                [_animal] call life_fnc_gutAnimal;
            };
        } else {
            if(playerSide == civilian && !life_action_gathering) then {
                if(life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
                life_action_gathering = true;
                _handle = [] spawn life_fnc_gather;
                waitUntil {scriptDone _handle};
                life_action_gathering = false;
            };
        };
    };
};


if((_curTarget isKindOf "B_supplyCrate_F" OR _curTarget isKindOf "Box_IND_Grenades_F") && {player distance _curTarget < 3} ) exitWith {
    if(alive _curTarget) then {
        [_curTarget] call life_fnc_containerMenu;
    };
};


if(_curTarget isKindOf "House_F" && {player distance _curTarget < 12} OR ((nearestObject [[16019.5,16952.9,0],"Land_Dome_Big_F"]) == _curTarget OR (nearestObject [[16019.5,16952.9,0],"Land_Research_house_V1_F"]) == _curTarget)) exitWith {
    [_curTarget] call life_fnc_houseMenu;
};


if(dialog) exitWith {}; //Don't bother when a dialog is open.
if(vehicle player != player) exitWith {}; //He's in a vehicle, cancel!
life_action_inUse = true;


//Temp fail safe.
[] spawn {
    sleep 60;
    life_action_inUse = false;
};


//Check if it's a dead body.
if(_curTarget isKindOf "Man" && {!alive _curTarget} && !(_curTarget GVAR["Revive",false]) && {playerSide in [west,independent]}) exitWith {
    //Hotfix code by ins0
    if(((playerSide == west && {(EQUAL(LIFE_SETTINGS(getNumber,"revive_cops"),1))}) || playerSide == independent) && {"Medikit" in (items player)}) then {
        [_curTarget] call life_fnc_revivePlayer;
    };
};




//If target is a player then check if we can use the cop menu.
if(isPlayer _curTarget && _curTarget isKindOf "Man") then {
    if((_curTarget GVAR ["restrained",false]) && !dialog && playerSide == west) then {
        [_curTarget] call life_fnc_copInteractionMenu;
    };
} else {
    //OK, it wasn't a player so what is it?
    private["_isVehicle","_miscItems","_money","_list"];


    _list = ["landVehicle","Ship","Air"];
    _isVehicle = if(KINDOF_ARRAY(_curTarget,_list)) then {true} else {false};
    _miscItems = ["Land_BottlePlastic_V1_F","Land_TacticalBacon_F","Land_Can_V3_F","Land_CanisterFuel_F","Land_Suitcase_F"];
    _animalTypes = ["Salema_F","Ornate_random_F","Mackerel_F","Tuna_F","Mullet_F","CatShark_F","Turtle_F"];
    _money = "Land_Money_F";


    //It's a vehicle! open the vehicle interaction key!
    if(_isVehicle) then {
        if(!dialog) then {
            if(player distance _curTarget < SEL(SEL(boundingBox _curTarget,1),0)+2) then {
                [_curTarget] call life_fnc_vInteractionMenu;
            };
        };
    } else {
        //Is it a animal type?
        if((typeOf _curTarget) in _animalTypes) then {
            if(EQUAL((typeOf _curTarget),"Turtle_F") && !alive _curTarget) then {
                private "_handle";
                _handle = [_curTarget] spawn life_fnc_catchTurtle;
                waitUntil {scriptDone _handle};
            } else {
                private "_handle";
                _handle = [_curTarget] spawn life_fnc_catchFish;
                waitUntil {scriptDone _handle};
            };
        } else {
            //OK, it wasn't a vehicle so let's see what else it could be?
            if((typeOf _curTarget) in _miscItems) then {
                [_curTarget,player,false] remoteExecCall ["TON_fnc_pickupAction",RSERV];
            } else {
                //It wasn't a misc item so is it money?
                if(EQUAL((typeOf _curTarget),_money) && {!(_curTarget GVAR ["inUse",false])}) then {
                    [_curTarget,player,true] remoteExecCall ["TON_fnc_pickupAction",RSERV];
                };
            };
        };
    };
};
 

 

 

Как сделать чтобы на Q бралась именно кирка и добывала ресурс... не понимаю((

Клавиша Windows чем не устроила??)))

Share this post


Link to post
Share on other sites
  • 0

Клавиша Windows чем не устроила??)))

 

Так на Win собирается только руками. Ресурсы которые требуют кирку не собираются на Win. Можно было бы сделать и на Win но как?))

Share this post


Link to post
Share on other sites
  • 0

Неужели никто помочь не может? Вознаграждение материальное гарантирую!

Share this post


Link to post
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

  • Similar Content

    • By Tamirlan
      Народ помогите! У меня проблема! В один момент все персонажи (игроки), когда залетают на остров одеты не в свою одежду и у всех в рюкзаках пустые пластиковые бутылки! не знаю вообще как это исправить! SOS! Есть подозрение что что то произошло с базой данных! но не уверен! Может кто сталкивался с такой проблемой? Как решали... не будьте равнодушными пожалуйста помогите... (началось с того что один из игроков покупал пластиковые бутылки и не заметил что купил слишком много что у него они стали вываливаться и появляться на земле (в рюкзаке место закончилось)) в момент покупки бутылок говорит что что то на секунду подвисло и после этого все кто залетает в игру стали появляться в его одежде и с бутылками. Это было вчера. Сегодня кто то купил одежду сантаклауса и теперь все появляются в одежде санты. Причем если корректно  выйти из миссии и после зайти на последнюю точку подключения все ок. А если выбрать любой город то все как я описывал выше. Плиз помогите решить этот полтергейст!) 
  • Our picks

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.