Jump to content

computermancer

Recommended Posts

29 minutes ago, Hux said:

I can't seem to get this to work.

I think I've installed it correctly.

I have my cmEarplugs folder in my altis mission pbo.

Also the onPlayerKilled.sqf and onPlayerRespawn.sqf  are in my mission pbo.

This is my init:

  Reveal hidden contents

 

call compile preProcessFileLineNumbers "cmEarplugs\config.sqf";

 

 

[] execVM "trader\init.sqf";
[] execVM "trader\HALV_takegive_crypto_init.sqf";
[] execVM "trader\resetvehicleammo.sqf";


[] execVM "IgiLoad\IgiLoadInit.sqf";

// Welcome Credits
[] execVM "welcome\welcome.sqf";

[] execVM "addons\messages\init.sqf";

if(hasInterface) then{
    [] execVM "addons\service_point\service_point.sqf";
    
};

Config:

  Reveal hidden contents

//============================================
// cmEarplugs Script
// written by computermancer
// superfunserver.com
//switch technique inspired by mgm
//============================================

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//                     CONFIG :         CHOOSE YOUR BEHAVIOR

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//DO YOU WANT EARPLUGS HOTKEY TO WORK?
// if you are using EPAH you should disable for peace of mind.
cmEarplugsKeyPressEnabled = false;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HOTKEY CONFIGURATION FOR: TOGGLE EARPLUG IN/OUT VIA KEYPRESS FUNCTION
// List of Available Hotkey Options
//    To use    INSERT                    as your hotkey, please choose:        1        in the variable below
//    To use    NumPadMultiply        as your hotkey, please choose:        2        in the variable below
//    To use    NumPadDivide            as your hotkey, please choose:        3        in the variable below
//    To use    F4                            as your hotkey, please choose:        4        in the variable below
//    To use    F5                            as your hotkey, please choose:        5        in the variable below
cmEarplugs_myHotkeyChoice = 4;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//                    CHOOSE INSERT & REMOVE BEHAVIOR    

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FIRST NUMBER : Choose how LONG it takes  until sound is REDUCED
// SECOND NUMBER:" Choose how LOUD the sound is when it is REDUCED
cmManMuteSound = {1 fadeSound 0.25;};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//FIRST NUMBER : Choose how LONG it takes  until sound RETURNS
//SECOND NUMBER:" Choose how LOUD the sound is when it is done RETUNRNING
cmManReturnSound = {1 fadeSound 1;};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE YOUR INSERT MESSAGE:
cmManMuteMessage = {
hint "You have inserted your earplugs.";
systemchat "You have inserted your earplugs.";
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE YOUR REMOVE MESSAGE:
cmManReturnSoundMsg = {
hint "You have removed your earplugs.";
systemchat "You have removed your earplugs.";
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CHOOSE IF YOU WANT AUTOINSERT & AUTOREMOVE OF EARPLUGS:
InsertAutoEarplugs=true;
RemoveAutoEarplugs=true;

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//                    CHOOSE AUTO-INSERT & REMOVE BEHAVIOR

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FIRST NUMBER : Choose how LONG it takes  until sound is REDUCED
// SECOND NUMBER:" CHoose how LOUD the sound is when it is REDUCED
cmMuteSound = {5 fadeSound 0.25;};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//FIRST NUMBER : Choose how LONG it takes  until sound RETURNS
//SECOND NUMBER:" CHoose how LOUD the sound is when it is done RETUNRNING
cmReturnSound = {10 fadeSound 1;};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE YOUR AUTO-INSERT MESSAGE
cmMuteMessage = {
hint "Earplugs have been auto-inserted...";
systemchat "Earplugs have been auto-inserted...";
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//CHOOSE YOUR AUTO-REMOVE MESSAGE
cmReturnSoundMsg = {
hint "Earplugs have been auto-removed.";
systemchat "Earplugs have been auto-removed.";
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                    END CONFIGURABLES
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

 

 

 

 

 

 

 

 

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

EP_req_1 = {

    private ["_cm_trigger2"];
    _cm_trigger2 = vehicle player != player;
    _cm_trigger2
    
};

 

cm_EP_LOOP = {


    while {true} do {
    
        waitUntil {uisleep 0.5; vehicle player != player};
        
            _cm_whatImInATM = vehicle player;
            inCaseofDeath = _cm_whatImInATM;
            if (InsertAutoEarplugs) then {
                if (earplugsout) then {
                    [] call cmMuteSound;
                    [] call cmMuteMessage;
                    earplugsout=false;
                };
            };

            //_cm_whatImInATM addEventHandler ["GetOut", {[_this] call cmGetOut}];
            
            if (isNil {_cm_whatImInATM getVariable "HasEarplugMenu"}) then {_cm_whatImInATM setVariable["HasEarplugMenu", "hasNoMenu"];};
            
            _checkington = (_cm_whatImInATM getVariable "HasEarplugMenu");
            if (_checkington == "hasNoMenu") then {
                _null = _cm_whatImInATM addaction ["<img image='cmEarplugs\earplugs.paa' /><t color=""#38eeff""> Earplugs</t>","[] call cm_Earplugs_FUNc","",0,false,false,"","[] call EP_req_1"];                            
                _cm_whatImInATM setVariable ["HasEarplugMenu","hasMenu"];
                systemChat "Earplugs menu has been added.";
            };
            
        waitUntil {uisleep 0.5; vehicle player == player};
        
            //_feedME = _this select 0;
            //_fedTrueName = _feedME select 0;
            theOneTrueName = _cm_whatImInATM;
            theOneTrueName setVariable ["HasEarplugMenu","hasMenu"];
            if (RemoveAutoEarplugs) then {
            if (!earplugsout) then {
                [] call cmReturnSound;
                [] call cmReturnSoundMsg;
                earplugsout=true;
            
                };
            };

    };
    
};


cm_Earplugs_FUNc = {

    if (earplugsout) then {
        [] call cmManMuteMessage;
        [] call cmManMuteSound;
        earplugsout=false;
    } else {
        [] call cmManReturnSoundMsg;
        [] call cmManReturnSound;    
        earplugsout=true;
    };
    

    
};


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DO NOT CHANGE THE VALUES BELOW
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

cmEarplugs_hotkeyDIKCodeNumberINSERT                         = 210;
cmEarplugs_hotkeyDIKCodeNumberNUMPADMULTIPLY     = 55;
cmEarplugs_hotkeyDIKCodeNumberNUMPADDIVIDE             = 181;
cmEarplugs_hotkeyDIKCodeNumberF4                                    = 62;
cmEarplugs_hotkeyDIKCodeNumberF5                                    = 63;

switch cmEarplugs_myHotkeyChoice do {
    case 1:        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberINSERT};
    case 2:        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberNUMPADMULTIPLY};
    case 3:        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberNUMPADDIVIDE};
    case 4:        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberF4};
    case 5:        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberF5};
    case 0;
    default        { cmEarplugs_hotkeyDIKCodeNumber = cmEarplugs_hotkeyDIKCodeNumberINSERT};
};
publicVariable    "cmEarplugs_hotkeyDIKCodeNumber";


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//END ALL
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

Server rpt: http://pastebin.com/CcwWhhLK

I use Epoch Anti Hack but I have auto insert  enabled.

I have key press set to false:  cmEarplugsKeyPressEnabled = false;

I see no option in action menu when I'm in a vehicle.

Have I missed something?

This one is easy - happy to help troubleshoot but you need to do your prep work first. I checked your server RPT it is full of errors. Fix the errors first, then we can talk about this one.

Link to comment
Share on other sites

12 minutes ago, mgm said:

This one is easy - happy to help troubleshoot but you need to do your prep work first. I checked your server RPT it is full of errors. Fix the errors first, then we can talk about this one.

 

I have no idea why those errors are there. Are you saying they may have something to do with this script not working?

I'm used to A2 Epoch and am new to A3 Epoch so I'm trying to learn the differences.

Thanks for the reply. I'll see if I can figure out those errors...

 

Link to comment
Share on other sites

6 minutes ago, Hux said:

 

I have no idea why those errors are there. Are you saying they may have something to do with this script not working?

I'm used to A2 Epoch and am new to A3 Epoch so I'm trying to learn the differences.

Thanks for the reply. I'll see if I can figure out those errors...

 

I don't know if the other errors impact the operation of earplugs.
basically earplugs is a very small script, if it's not working it's got to be something basic (antihack, corrupt file, file not loading etc.).

however, if you already have errors maybe earplugs is not even getting a chance to kick in so I'm saying if you reach a "clean, working state" before you try to add this, then we can (hopefully) quickly troubleshoot what's wrong  with this one. either fix the others or maybe temporarily remove all and just run earplugs.

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
×
×
  • Create New...