Jump to content
  • 0

sound question


lonewolfgaming

Question

I am wanting to add a sound to play when my DZMS missions pop up on the map to alert players that a mission is active. I have added sounds to scripts before, but was not sure if the same format would work for the sound to play so all players could hear. An example of what I have used is: _nul = [objNull, player, rSAY, "drunk"] call RE; that I use in a drink beer script that plays while the effects are happening. Any help would be great.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
2 hours ago, lonewolfgaming said:

I am wanting to add a sound to play when my DZMS missions pop up on the map to alert players that a mission is active. I have added sounds to scripts before, but was not sure if the same format would work for the sound to play so all players could hear. An example of what I have used is: _nul = [objNull, player, rSAY, "drunk"] call RE; that I use in a drink beer script that plays while the effects are happening. Any help would be great.

i was using this in bombcrate but in clientside _nul = [objNull, player, rSAY, "bombmsg"] call RE;  (work only into mpmissions folder)

Not work for server side. 

I think the way is using a public variable like in WAI missions ( see into custom\remote\ folder)

 

switch_on_off.sqf

Spoiler

private["_state"];

_state = player getVariable["radiostate",true];

if(_state) then {
    systemChat "[RADIO] OFF";
    player setvariable["radiostate",false];
} else {
    systemChat "[RADIO] ON";
    player setvariable["radiostate",true];
};

remote.sqf

Spoiler

 if(!isDedicated) then {

    fnc_remote_message = {
    
        private ["_type","_message","_player"];
    
        _type         = _this select 0;
        _message     = _this select 1;
        
        call {
            if(_type == "radio") exitWith {
                if(player hasWeapon "ItemRadio") then {
                    if(player getVariable["radiostate",true]) then {
                        systemChat _message;
                        [objNull,player,rSAY,"Radio_Message_Sound",30] call RE;
                    };
                };
            };
            if(_type == "global") exitWith { systemChat _message; };
        };
    };
    
    "RemoteMessage" addPublicVariableEventHandler { (_this select 1) call fnc_remote_message; };

};

remote_ready = true;

 

allso check it:

 

Link to comment
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
  • Advertisement
  • Discord

×
×
  • Create New...