Jump to content
  • 0
Sign in to follow this  
lonewolfgaming

sound question

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.

Share this post


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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...