[Code Snippet] No Voice On Side!

AlienX

Valued Member!
Hello all,
Been working on this one tonight, thought i would share it.

I do not have time to create a release thread or a tutorial thread - after all it is 04:40 in the morning, so i will shove this code here and let you guys and gals loose on it!

Code:
[] spawn {
        disableSerialization;
 
       _detectedChannels = ["Side channel", "Group channel"];
 
        while {true} do
        {
            _display1 = findDisplay 55;
            _display2 = findDisplay 63;
     
            if ( (!isNull _display1) AND (!isNull _display2) ) then {
                _txt1 = ctrlText ((findDisplay 55) displayCtrl 101);
                _txt2 = ctrlText ((findDisplay 63) displayCtrl 101);
         
                _txtchk1 = "\ca\ui\textures\mikrak.paa";
         
                if ( (_txt1 == _txtchk1) AND (_txt2 in _detectedChannels) ) then {
                    hintSilent ( "Warning: Please do not use voice!" );
                };
            };
          
            sleep 2;
        };
    };

This will show a hint message when the user has been talking on side chat with voice (mic).
Highly customizable, i hope you enjoy.
 
Make a new sqf file inside your mission folder, perhaps noVoiceOnSide.sqf - put the code inside this.
Then, inside init.sqf inside the !isDedicated if statement, put [] execvm "noVoiceOnSide.sqf";
 
Where exactly would I want to put [] execvm "noVoiceOnSide.sqf"; in the init, right after [] execVM "Scripts\kh_actions.sqf"; ?

Code:
if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf";
    //Conduct map operations
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
        "heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
    if (dayz_antihack == 1) then {
    [] execVM "\z\addons\dayz_code\system\antihack.sqf";
    };
};

So I should have it like this?

Code:
if (!isDedicated) then {[] execVM "Scripts\kh_actions.sqf"; [] execvm "noVoiceOnSide.sqf";
    //Conduct map operations
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor = [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
        "heliCrash" addPublicVariableEventHandler {
        _list = nearestObjects [_this select 1, ["CraterLong"], 100];
        {deleteVehicle _x;} foreach _list;
    };
    if (dayz_antihack == 1) then {
    [] execVM "\z\addons\dayz_code\system\antihack.sqf";
    };
};
 
Back
Top