Custom Suicide script 5/1/14

AsianKid

Well-Known Member
This is a simple suicide script that adds right click to the pisoals to execute the suicide.

How is this different?
  1. [/*]
  2. Add scream before death no extra sound file need. You can add your own sound or sounds in the script[/*]
  3. Over kills the player so die if they have a SD weapon[/*]
  4. Fixed it so the pistol sound is shot not the primary [/*]
  5. Easy custom config to change the sound and message[/*]
This script is still not done so please let me know what is not working.

Installation guide

skip this if you are running epoch
Not running epoch well you have to add this to the self actions at the bottom.
Code:
// ---------------------------------------SUICIDE START------------------------------------
 
private ["_handGun"];
_handGun = currentWeapon player;
if ((_handGun in ["glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","UZI_EP1","Sa61_EP1","Colt1911"]) && (player ammo _handGun > 0)) then {
    hasSecondary = true;
} else {
    hasSecondary = false;
};
if((speed player <= 1) && hasSecondary && _canDo) then {
    if (s_player_suicide < 0) then {
        s_player_suicide = player addaction[("<t color=""#ff0000"">" + ("Commit Suicide") +"</t>"),"custom\suicide.sqf",_handGun,0,false,true,"", ""];
    };
} else {
    player removeAction s_player_suicide;
    s_player_suicide = -1;
};
 
// ---------------------------------------SUICIDE END------------------------------------

Step one
Install right click addon/script and add this to it
Thanks to @Turtle and @FriendlyPA
Code:
class ExtraRc {
    class glock17_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };
    class M9 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class M9SD {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class Makarov {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };
    class revolver_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class UZI_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class Sa61_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class Colt1911 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };		
    class UZI_SD_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };
    class revolver_gold_EP1 {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };	
    class MakarovSD {
        class CommitSuicide {
            text = "Commit Suicide";
            script = "execVM ""custom\suicide.sqf"";";
        };
    };
};

Step 2
The script
Place this script in custom folder and name it suicide.sqf
Code:
private ["_Secondary","_SMessage","_sound","_dis"];
//###########################################################################################################
//#################################ASIAN KID suicide script#################################################
//###########################################################################################################
////////////CONFIG////////////
/*
0 is to set false
1 is to set true
*/
sound = 1;         //Enable if you want a message to show before the player dies
messages = 1;     //Enable if you want a message to show before the player dies
////////////////////////EXTRA////////////////////////////////////////////
customsound = 0; //If you want to use your own sound
_customsoundname = "scream"; //Must define it in the description.ext
/////////////////////////////////////////////////////////////////////////
_dis = 50;      //Distance heard by the souund
_SMessage = format["My name is %1 and I hope there is better place",format["%1", name player]];  //suicide message
//###########################################################################################################
///////////////////////////////
////////////Starting////////////
///////////////////////////////
canAbort = true; //stops people from aborting
player addEventHandler ["fired", {if (alive player) then { player SetDamage 1.1;};}];
sleep 1;
///////////////////////////////
////////////Message////////////
///////////////////////////////
if (messages == 1) then {
cutText [format[_SMessage], "PLAIN DOWN"];
};
///////////////////////////////
////////////Actions////////////
///////////////////////////////
player playmove "PlayerStand";
sleep 1.5;
player playmove "ActsPercMstpSnonWpstDnon_suicide1B";
sleep 8.4;
///////////////////////////////
/////Scream before death///////
///////////////////////////////
if (sound == 1) then {
if (customsound == 1) then {
_sound = [_customsoundname] call bis_fnc_selectRandom;
}else{
_sound = ["z_scream_3","z_scream_"] call bis_fnc_selectRandom;
};
_nul = [nil, player, rSAY, [_sound,_dis]] call RE;
sleep 0.5;
};
///////////////////////////////
///////Player shoots///////////
///////////////////////////////
canAbort = false;
player fire _Secondary;
sleep 0.2;
///////////////////////////////
///////Over kills them/////////
///////////////////////////////
r_player_blood = r_player_blood - 13000;
player setVariable["USEC_BloodQty",r_player_blood,true];
_unit = player;
_selection = "body"; 
_damage = 1;
_unit setHit[_selection,_damage];
//###########################################################################################################
//###########################################END OF SUICDE#############################################################
//###########################################################################################################

Report any errors and enjoy
 
Last edited:
Back
Top