Jump to content

[Tutorial] Suicide Vest


Recommended Posts

On 2/14/2017 at 1:29 PM, DZG™ | DubStepMad said:

Here is a working deadman switch taken from RLG's mission file, please keep the author and someone would need to re-work this to get it running with newer verisons.

/*
	File: fn_DeadmanSwitch.sqf
	Author: Cobra
	www.rlgroleplay.com
	
	Description:
	Activates/deactivates a suicide vest dead man switch.
*/
private["_explosion"];
if(!(vest player in ["SuicideVest", "SuicideVest_Camo", "SuicideVest_Brown", "SuicideVest_khaki", "SuicideVest_olive"])) exitWith {};

if (life_suicidedeadman == 1) exitWith {
life_suicidedeadman = 0; 
["Deadman switch disengaged.","#d32df0"] spawn RLG_fnc_RLGNotificationSystem;
};

life_suicidedeadman = 1; 
["Deadman switch engaged.","#d32df0"] spawn RLG_fnc_RLGNotificationSystem;

waitUntil {
!(vest player in ["SuicideVest", "SuicideVest_Camo", "SuicideVest_Brown", "SuicideVest_khaki", "SuicideVest_olive"]) or !(alive player)
};
    if (life_suicidedeadman == 1) exitWith {
	life_suicidedeadman = 0;  
    [[1,format["TAKISTAN NEWS: A SUICIDE BOMB WAS JUST DETONATED!",_storename]],"life_fnc_broadcast",civilian,false] spawn life_fnc_MP;
    [[1,format["TAKISTAN NEWS: A SUICIDE BOMB WAS JUST DETONATED!",_storename]],"life_fnc_broadcast",civilian,false] spawn life_fnc_MP;
    [[1,format["TAKISTAN NEWS: A SUICIDE BOMB WAS JUST DETONATED!",_storename]],"life_fnc_broadcast",independent,false] spawn life_fnc_MP;
    [[1,format["TAKISTAN NEWS: A SUICIDE BOMB WAS JUST DETONATED!",_storename]],"life_fnc_broadcast",west,false] spawn life_fnc_MP;
	_explosion = "Bo_Mk82" createVehicle [0,0,9999];
    _explosion setPos (getPos player);
    _explosion setVelocity [100,0,0];
    removeVest player;
    removeHeadgear player:
    removeGoggles player;
    removeVest player;
    removeBackpack player;
    removeUniform player;
    removeAllWeapons player:
    removeAllAssignedItems player;
    if(alive player) then {
	player setDamage 1;
	};
};
    [] call SOCK_fnc_updateRequest;

 

That's a problem, you need their notification system too.

Link to post
Share on other sites
1 minute ago, DaBombGamer said:

That's a problem, you need their notification system too.

#include <macro.h>
/*
    Author: Travis Butts Edited by : Austin carlile
 	Desc: A new notification System
 	For: Red Line Gaming [RLG]
 	How to call: ["This is the message it will display!","#HEXCOLOR"] spawn RLG_fnc_RLGNotificationSystem;
 */
private ["_title", "_new", "_final", "_i"];
params ["_msg", "_color"];

_title = "<t align = 'center' shadow = '1' size='1.3' font='PuristaBold'>USG ROLEPLAY<br />NOTIFICATION SYSTEM</t>";
_new = "<br /><br /><t align = 'center' shadow = '1' size='1' font='PuristaBold'>NEWEST MESSAGE</t>";
_i = 0;
_final = "";

life_lastMessages = [[_msg,_color]] + life_lastMessages;

{
  if(_i < 1) then {
    _final = format["<br /><br /><t align='center' color='%2'>%1</t>",_x select 0,_x select 1] + _final;
    if(_i == 0) then {
      _final = _new + _final;
    };
    _i = _i + 1;
  };
} forEach life_lastMessages;

hint parseText (_title + _final);

if(count(life_lastMessages) > 1) then { life_lastMessages = []; };
  _rscLayer = "osefStatusBar" call BIS_fnc_rscLayer;
  _rscLayer cutRsc["osefStatusBar","PLAIN"];

Here you go, edit this and then add this to your functions.hpp 

Link to post
Share on other sites
Just now, DZG™ | DubStepMad said:
#include <macro.h>
/*
    Author: Travis Butts Edited by : Austin carlile
 	Desc: A new notification System
 	For: Red Line Gaming [RLG]
 	How to call: ["This is the message it will display!","#HEXCOLOR"] spawn RLG_fnc_RLGNotificationSystem;
 */
private ["_title", "_new", "_final", "_i"];
params ["_msg", "_color"];

_title = "<t align = 'center' shadow = '1' size='1.3' font='PuristaBold'>USG ROLEPLAY<br />NOTIFICATION SYSTEM</t>";
_new = "<br /><br /><t align = 'center' shadow = '1' size='1' font='PuristaBold'>NEWEST MESSAGE</t>";
_i = 0;
_final = "";

life_lastMessages = [[_msg,_color]] + life_lastMessages;

{
  if(_i < 1) then {
    _final = format["<br /><br /><t align='center' color='%2'>%1</t>",_x select 0,_x select 1] + _final;
    if(_i == 0) then {
      _final = _new + _final;
    };
    _i = _i + 1;
  };
} forEach life_lastMessages;

hint parseText (_title + _final);

if(count(life_lastMessages) > 1) then { life_lastMessages = []; };
  _rscLayer = "osefStatusBar" call BIS_fnc_rscLayer;
  _rscLayer cutRsc["osefStatusBar","PLAIN"];

Here you go, edit this and then add this to your functions.hpp 

I don't need it, I was just letting you know ;)

Link to post
Share on other sites
  • 3 weeks later...
  • 4 weeks later...
On 3/10/2016 at 8:47 AM, IceEagle132 said:

Author: "John Meiers & TrinityNetwork because I took this from their server.

Posted by: AlaskaVet

Fist of create a new file inside "Altis_Life.Altis\core\actions" & name it "fn_suicideBomb.sqf"

Add the following:

#include "..\..\script_macros.hpp"
/*
    ALAH SNACKBAR! 
*/
private["_boom", "_list"];
_player = player;
if(vest player != "V_HarnessOGL_gry") exitWith {};
if(life_isSuicide) exitWith {};
life_isSuiciding = true;

_player say3D "akbar";
sleep 8;


if(vest player != "V_HarnessOGL_gry") exitWith {life_isSuiciding = false;};
if((player getVariable "restrained")) exitWith {life_isSuiciding = false;}; //He's restrained.
if((player getVariable "zipted")) exitWith {life_isSuiciding = false;}; //He's restrained.

//BOOM    
removeVest player;
removeAllWeapons player:
removeAllAssignedItems player;
_boom = "Bo_Mk82" createVehicle [0,0,9999];
_boom setPos (getPos player);
_boom setVelocity [100,0,0];

if(alive player) then {player setDamage 1;};

life_isSuicide = false;

player setVariable["zipted", false, true];
player setVariable["restrained", false, true];
[] call SOCK_fnc_updateRequest;

[0,format["BREAKING NEWS: A suicide vest was detonated by %1!",profileName]] remoteExec ["life_fnc_broadcast",0];

The open "configuration.sqf" and in the "Backend Variables" Add

life_isSuiciding = false;

Now open your "fn_setupActions.sqf" and add under "case civilian"

//Suicide alahsnackbar
		life_actions = life_actions + [player addAction["<t color='#FF0000'>Activate Suicide Vest</t>",life_fnc_suicideBomb,"",0,false,false,"",' vest player == "V_HarnessOGL_gry" && alive player && playerSide == civilian && !life_istazed && !(player getVariable "restrained") && !(player getVariable "Escorting") && !(player getVariable "transporting")']];

 

Open "Functions.hpp" Under "class Actions" Add

class suicideBomb {};

 

Now open "description.ext" and under "class CfgSounds" Add

class akbar
    {
        name = "akbar";
        sound[] = {"\sounds\akbar.ogg",1.0, 1};
        titles[] = {};
    };

Then download the sound file from below and add it to your sounds folder. And that's it. The vest is set to "V_HarnessOGL_gry" but you can change it to what ever you want.

 

akbar.ogg

how i can set the 3d sound in game? becouse when i go to suicide the player don't other the Akbar

Link to post
Share on other sites
  • 4 weeks later...
  • 1 year later...
  • 4 months later...
  • 3 months later...
  • 1 year later...
  • 1 month later...

Share your setvariable.log But I assume you need to add !=zipted to  setvariable.txt

50 minutes ago, KllTA said:

after adding this I now get battleye setvariable #1 restriction everytime I join the server and then get kicked cant find how to fix anywhere

 

 

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

×
×
  • Create New...

Important Information

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