Poste mal deine keyhandler hier. Vielleicht hast ja irgendwie die Tasten doppelt belegt oder so irgendwas.
[Tutorial] Ohrenstöpsel
-
- Altis Life
-
Plotmod -
31. März 2016 um 02:21
-
-
Spoiler anzeigen
// ohrstoepsel P
case 25:
{
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
}; -
die komplette fn_keyhandler.sqf bitte, damit das Ratespiel ein Ende hat
-
@JAGGANOT benutzt du ACE???
-
Was spielt das in diesem Thread eine Rolle ?
-
Weils mit ACE nicht geht ACE Stellt dan sofort auf Normal Lautstärke
-
Bei mir passiert rein garnichts. muss ich das noch iwie mit was anderem verknüpfen oder so?
Hier auf jeden Fall mal meine keyhandler.sqf
Spoiler anzeigen
#include "..\..\script_macros.hpp"
/*
File: fn_keyHandler.sqf
Author: Bryan "Tonic" BoardwineDescription:
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")) && {(player GVAR ["restrained",false])}) 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;
};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;
};
};//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;}};
};
};//Holster / recall weapon.
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...
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 getVariable["restrained",false]) && !life_istazed) 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";
_list = ["landVehicle","Air","Ship","House_F"];
if(KINDOF_ARRAY(cursorTarget,_list) && {player distance cursorTarget < 7} && {vehicle player == player} && {alive cursorTarget} && {!life_action_inUse}) then {
if(cursorTarget in life_vehicles OR {!(cursorTarget GVAR ["locked",true])}) 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"]) 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 && {!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 {
//I do not have a custom sound for this and I really don't want to go digging for one, when you have a sound uncomment this and change medicSiren.sqf in the medical folder.
//[_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 < 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 < 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";
};
};
};
};
};
};case 207:
{
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
};_handled;
-
[_veh,2] remoteExecCall ["life_fnc_lockVehicle",_veh];
};
systemChat localize "STR_MISC_VehLock";
};
};
};
};
};
};<--- die hiercase 207:
{
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
};
};<--- da hin verschieben
_handled;dann sollte es gehen
-
Tada und es funktioniert!
Danke
-
Bei der 4.5 geht es leider auch nicht habe auch ace und habe dies auch auf anderen server gesehn die das it ace könn
Spoiler anzeigen
case 209:
{
if(_shift) then
{
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
};
}; -
case 209:
{
if(_shift) then
{
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
};
};Hier:
Code
Alles anzeigencase 209: { if(_shift) then { switch (player SVAR["Earplugs",0]) do { case 0: {hint composeText [ image "icons\sound.paa"," 90% Leiser"]; 1 fadeSound 0.1; player SVAR ["Earplugs", 10]; }; case 10: {hint composeText [ image "icons\sound.paa"," 60% Leiser"]; 1 fadeSound 0.4; player SVAR ["Earplugs", 40]; }; case 40: {hint composeText [ image "icons\sound.paa"," 30% Leiser"]; 1 fadeSound 0.7; player SVAR ["Earplugs", 70]; }; case 70: {hint composeText [ image "icons\sound_new.paa"," Normaler Sound"]; 1 fadeSound 1; player SVAR["Earplugs", 0]; }; }; }; };
Dürfte, dann wieder gehen
-
jetzt geht der befehl garnicht mehr sprich der text wird nichtmal angezeigt
-
wenn ich das script eifn_keyHandler.sqfnfüge(4.4.4r) dann gehen sämtliche altis tasten nicht mehr (u,z etc)
-
Dann liegt ein Fehler beim einfügen vor. ARMA ist in Sachen Scripts sehr sensibel - wahrscheinlich vll nur eine Klammer oder Komma vergessen
-
- oder Doppelbelegung.
Seit der 4.4r3 sind nämlich standardmäßig Ohrstöpsel drin, kann sein du hast die gleiche Taste erwischt -
war n Space zu viel^^ danke:)
jetzt nur noch das garagen problem lösen und dann is alles wieder in butter auf dem server^^
-
Sorry vorab das ich den Beitrag nach der langen zeit wieder aufwerfe
Ich hab SealDrop Altis Life v.3.1.4.8-[lexicon]extDB[/lexicon] auf meinem Server
nun is das problem das die Ohrstöpsel nicht funktionieren
Hat wer das Script bei der version 3.1.4.8 zum laufen gebracht ?Lg
-
Kann man es einbauen das sobald man den Kopfhörer an hat das die ganze Zeit ein Icon im Hud angezeigt wird?
-
Möglich ist es, die frage ist nur wie?
-
Ich hab auch die v4.4r4 Und bei mir geht es auch nicht.
Spoiler anzeigen
//NUM_* Key = Für Ohrstöpsel
case 55:
{
if(_shift) then {
switch (player getVariable["Earplugs",0]) do {
case 0: {hint composeText [image "icons\ohrstoepsel\sound.paa","Der Sound ist nun 90% leiser! "]; 1 fadeSound 0.1; player setVariable ["Earplugs", 10]; };
case 10: {hint composeText [image "icons\ohrstoepsel\sound.paa","Der Sound ist nun 60%leiser!"]; 1 fadeSound 0.4; player setVariable ["Earplugs", 40]; };
case 40: {hint composeText [image "icons\ohrstoepsel\sound.paa","Der Sound ist nun 30%leiser!"]; 1 fadeSound 0.7; player setVariable ["Earplugs", 70]; };
case 70: {hint composeText [image "icons\ohrstoepsel\sound.paa","Der Sound ist nun wieder normal!"]; 1 fadeSound 1; player setVariable ["Earplugs", 0]; };
};
};
};_handled;
Aber es rührt sich nix. Bitte um Hilfe
-