Jump to content

[Tutorial] Gagged Script


IceEagle132
 Share

Recommended Posts

Authors: Lowheartrate & Panada

Old Post Here

 

1. Make a File inside core\actions  Called: fn_gagAction.sqf

/*
    File: fn_gagAction.sqf
    Author: Lowheartrate & Panda
*/

private["_unit"];
_unit = cursorTarget;
if(isNull _unit) exitWith {};
if((player distance _unit > 3)) exitWith {};
if((_unit getVariable "gagged")) exitWith {};
if(side _unit == west) exitWith {};
if(player == _unit) exitWith {};
if(!isPlayer _unit) exitWith {};
_unit setVariable["gagged",true,true];
[player] remoteExec ["life_fnc_gagged", _unit,false]; 
hint format["You gagged %1.", _unit getVariable["realname",_unit]];
life_inv_gagkit = life_inv_gagkit - 1;

2. Make a File inside core\actions  Called: fn_gagged.sqf

/*
    File: fn_gagged.sqf
    Author: Lowheartrate & Panda
*/
private["_gagger"];
_gagger = [_this,0,Objnull,[Objnull]] call BIS_fnc_param;
hint format["You have been gagged by %1.", _gagger getVariable["realname",_gagger]];
titleText ["You have a gag over your mouth, you can no longer talk!", "PLAIN"];
enableRadio false;
5 enableChannel false;
3 enableChannel false;
4 enableChannel false;
waitUntil{!(player getVariable ["gagged",false]) OR !(player getVariable ["restrained",false])};
hint format["The gag was removed, you can again speak!"];
titleText ["You're not gagged", "PLAIN"];
enableRadio true;
5 enableChannel true;
3 enableChannel true;
4 enableChannel true;

3. Make a File inside core\actions  Called: fn_removeGagAction.sqf

/*
    File: fn_removeGagAction.sqf
    Author: Lowheartrate & Panda
*/
private["_unit"];
_unit = cursorTarget;
if(isNull _unit) exitWith {};
if(!(_unit getVariable "gagged")) exitWith {};
if(player == _unit) exitWith {};
if(!isPlayer _unit) exitWith {};
_unit setVariable["gagged",false,true];

4. Make a File inside Functions.hpp and add inside class actions:

class gagAction {};					
class gagged {};
class removeGagAction {};

5. Now open Config_vItems.hpp and add:

 class gagkit {
    variable = "gagkit";
    displayName = "STR_Item_GagKit";
    weight = 1;
    buyPrice = 5000;
    sellPrice = 2500;
    illegal = true;
    edible = -1;
    icon = "textures\icons\gag.paa";
};

6. Now open stringtable.xml and add:

<Key ID="STR_Item_GagKit">
    <Original>Gag Kit</Original>
</Key>

7. Next in Altis_Life.Altis\core\fn_setupActions.sqf add in case civilian:

//Add Gag
life_actions = life_actions + [player addAction["<t color='#FF0000'>Put On Gag</t>",life_fnc_gagAction,"",0,false,false,"",'!isNull cursorTarget && player distance cursorTarget < 3.5 && isPlayer cursorTarget && (cursorTarget getVariable["restrained",FALSE]) && !(cursorTarget getVariable ["gagged",FALSE]) && life_inv_gagkit > 0']];
//Remove Gag
life_actions = life_actions + [player addAction["<t color='#FFCC00'>Remove Gag</t>",life_fnc_removeGagAction,"",0,false,false,"",'!isNull cursorTarget && player distance cursorTarget < 3.5 && isPlayer cursorTarget && (cursorTarget getVariable["restrained",FALSE]) && (cursorTarget getVariable ["gagged",FALSE])']];

8. Lasr Open CfgRemoteExec.hpp and add:

F(life_fnc_gagged,CLIENT)

you

That's it. Enjoy :)

gag.paa

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
On 12/31/2016 at 0:36 AM, Nation said:

To my knowledge there is a way to disable talking with TFAR, A3L has it when knocked out you cant speak, ill post it if i find anything.

most arma 3 mission files have it in there already (lakeside ones), I would download one or look around for one and take it from there not to hard to find them

Edited by [IL] KingCrazyHunter
Link to comment
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
Reply to this topic...

×   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.

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.