[Code Snippet] No Voice On Side!

Discussion in 'Scripting Discussions' started by AlienX, Aug 2, 2013.

  1. AlienX

    AlienX Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    115
    Likes Received:
    56
    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.
     
  2. ShepardSR

    ShepardSR New Member

    Joined:
    Apr 29, 2013
    Messages:
    25
    Likes Received:
    0
    where put this code?
     
  3. AlienX

    AlienX Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    115
    Likes Received:
    56
    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";
     
  4. infiSTAR

    infiSTAR Member

    Joined:
    May 21, 2013
    Messages:
    40
    Likes Received:
    13
    very nice! thank you for sharing
     
  5. medeiros_nathan_09

    medeiros_nathan_09 Member

    Joined:
    Jun 1, 2013
    Messages:
    33
    Likes Received:
    2
    how to have global and side also?
     
  6. AlienX

    AlienX Valued Member!

    Joined:
    Apr 8, 2013
    Messages:
    115
    Likes Received:
    56
    I have ammended the first post to help with your request, please note this will not work for people who are in the lobby.
     
  7. Speed

    Speed New Member

    Joined:
    May 2, 2014
    Messages:
    3
    Likes Received:
    0
    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";
        };
    };
     
  8. WagnerMello

    WagnerMello Member

    Joined:
    Jul 18, 2016
    Messages:
    38
    Likes Received:
    0
    Hello friend I tried putting this script on my server but now he is kicking me restriction # 13
     

Share This Page