
All checks were successful
Build / Build (push) Successful in 28s
This commit refactors several client-side functions to improve code consistency and readability. - Standardizes function descriptions by removing redundant "Function: forge_client..." prefixes and "[Description]" sections, focusing on concise descriptions of the function's purpose. - Updates variable handling in arsenal functions to use GVAR and EGVARS for default values, improving consistency and reducing code duplication. - Removes the bank init function as it is no longer needed. - Adds a done variable to the preinit file.
36 lines
778 B
Plaintext
36 lines
778 B
Plaintext
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
* Author: IDSolutions
|
|
* Create a sound source and play an ambient sfx sound
|
|
*
|
|
* Arguments:
|
|
* 0: The sound source <OBJECT>
|
|
* 1: The name of the SFX sound <STRING>
|
|
* 2: Number of seconds before SFX sound will be deleted <NUMBER>
|
|
*
|
|
* Return Value:
|
|
* N/A
|
|
*
|
|
* Examples:
|
|
* [this, "sfx_sound_name"] spawn forge_client_ambient_fnc_ambientSound
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
|
|
params [["_source", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_sfx", "", [""]], ["_time", nil, [0]]];
|
|
|
|
private _sound0 = createSoundSource [_sfx, position _source, [], 0];
|
|
|
|
while { alive _source } do {
|
|
if (!isNil "_time") exitWith {
|
|
uiSleep _time;
|
|
deleteVehicle _sound0;
|
|
};
|
|
|
|
uiSleep 5;
|
|
|
|
if (!alive _source) exitWith {
|
|
deleteVehicle _sound0;
|
|
};
|
|
}; |