Last active
December 19, 2021 11:05
-
-
Save Fusselwurm/63d7d26bf5ada1f5c37090aedf5168c0 to your computer and use it in GitHub Desktop.
Fix vehicle honking: Proof of Concept
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// mit **playSound3D** | |
// PROBLEM Sound bleibt an der generierten Stelle kleben | |
removeAllUserActionEventHandlers ["DefaultAction", "Activate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Activate", { | |
xxx_honking_id = [ | |
{ | |
playSound3D [ | |
"a3\sounds_f\weapons\horns\MRAP_02_horn_2.wss", | |
vehicle player, | |
false, | |
[0, 0, 0], | |
1, | |
1, | |
200, | |
0.1, | |
false | |
]; | |
}, | |
0.7 | |
] call CBA_fnc_addPerFrameHandler | |
}]; | |
removeAllUserActionEventHandlers ["DefaultAction", "Deactivate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Deactivate", { | |
[xxx_honking_id] call CBA_fnc_removePerFrameHandler; | |
}]; | |
// mit **say3d** | |
removeAllUserActionEventHandlers ["DefaultAction", "Activate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Activate", { | |
xxx_honking_id = [ | |
{ | |
(vehicle player) say3D ["XXX_CarHorn", 200, 1, false, 0]; | |
}, | |
0.7 | |
] call CBA_fnc_addPerFrameHandler | |
}]; | |
removeAllUserActionEventHandlers ["DefaultAction", "Deactivate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Deactivate", { | |
[xxx_honking_id] call CBA_fnc_removePerFrameHandler; | |
}]; | |
// mit **createSoundSource** | |
removeAllUserActionEventHandlers ["DefaultAction", "Activate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Activate", { | |
xxx_honking_id = createSoundSource ["XXX_CarHorn", vehicle player, [], 0]; | |
xxx_honking_id attachTo [(vehicle player)]; | |
}]; | |
removeAllUserActionEventHandlers ["DefaultAction", "Deactivate"]; | |
xxx_eh = addUserActionEventHandler ["DefaultAction", "Deactivate", { deleteVehicle xxx_honking_id }]; |
diwako sagt, ich soll ein building (class: "building") ans fahrzeug attachen und darüber den sound abspielen. whynot.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cant do sensibly, waiting for : https://feedback.bistudio.com/T131341