Asian Kid Posted May 2, 2014 Report Share Posted May 2, 2014 This is a simple suicide script that adds right click to the pisoals to execute the suicide. How is this different? Add scream before death no extra sound file need. You can add your own sound or sounds in the scriptOver kills the player so die if they have a SD weaponFixed it so the pistol sound is shot not the primary Easy custom config to change the sound and messageThis script is still not done so please let me know what is not working. Installation guide skip this if you are running epochNot running epoch well you have to add this to the self actions at the bottom.// ---------------------------------------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 oneInstall right click addon/script and add this to itThanks to @Turtle and @FriendlyPAclass 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 2The scriptPlace this script in custom folder and name it suicide.sqfprivate ["_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 Friendly 1 Link to comment Share on other sites More sharing options...
kassquatch Posted May 2, 2014 Report Share Posted May 2, 2014 awesome! Im guessing if I wanted to put in a if statement to check to see if legs are broken or blood is below say 5000 it would just have to wrap this in an if? and declare a variable to whatever player broken legs and low blood are? (new to this arma coding, so would have to look for what that is) /////////////////////////////// ////////////Actions//////////// /////////////////////////////// player playmove "AidlPpneMstpSnonWnonDnon_SleepA_standUp" sleep 1.5; player playmove "ActsPercMstpSnonWpstDnon_suicide1B"; sleep 8.4; Link to comment Share on other sites More sharing options...
Friendly Posted May 2, 2014 Report Share Posted May 2, 2014 Hey when I press commit suicide it just makes my guy lay down and then get back up and I am using the right click one. Link to comment Share on other sites More sharing options...
Asian Kid Posted May 2, 2014 Author Report Share Posted May 2, 2014 Hey when I press commit suicide it just makes my guy lay down and then get back up and I am using the right click one. ok thx didn't get to test it yesterday. Link to comment Share on other sites More sharing options...
Donnovan Posted May 2, 2014 Report Share Posted May 2, 2014 I can't test now, but i believe the player will play the stand up animetion even if he is already standing: player playmove "AidlPpneMstpSnonWnonDnon_SleepA_standUp" sleep 1.5; Don't? I will release my script, tonight, when i got home. Sorry for the delay, i wish it could have helped you. Link to comment Share on other sites More sharing options...
ARcoolJ Posted May 2, 2014 Report Share Posted May 2, 2014 He does the animation but didnt shoot himself. Also i have a scroll menu "commit suicide", that i guess, shouldn´t be there. Link to comment Share on other sites More sharing options...
Donnovan Posted May 2, 2014 Report Share Posted May 2, 2014 You can kill the player with: player setDamage 1.0; You can make player fire (may have systax error): player secondaryWeapon "fire"; And you can schedule player death for when he fires (may have systax error): player addEventHandler ["fired",{player setDamage 1.0;}]; player secondaryWeapon "fire"; //will shot and launch the event scheduled above {player set Damage 1.0;} The shot that comes from the secondary weapon do not hurt the player, what kill hin is the comand "player setDamage 1.;0". I just need to check the syntax for the last 2 codes. I'm not at home and can't do it now. Asian Kid, by the way, and sorry to ask, who is that person in your Avatar? He have "Xavier" in its name? Thankyou. Link to comment Share on other sites More sharing options...
ARcoolJ Posted May 2, 2014 Report Share Posted May 2, 2014 Let me answer this for you, it is Mr. Chow from the movie "The Hangover" :D Link to comment Share on other sites More sharing options...
lmapper Posted May 2, 2014 Report Share Posted May 2, 2014 *google translater* <3 I think this action is necessary to show only if a player has broken leg, or a little blood. In other cases, it is very much in the way and you can accidentally press. Donnovan 1 Link to comment Share on other sites More sharing options...
ARcoolJ Posted May 2, 2014 Report Share Posted May 2, 2014 /////////////////////////////// ///////Over kills them///////// /////////////////////////////// r_player_blood = r_player_blood - 13000; player setVariable["USEC_BloodQty",r_player_blood,true]; _unit = player; _selection = "body"; _damage = 1.0; _unit setHit[_selection,_damage]; //########################################################################################################### //###########################################END OF SUICDE############################################################# //########################################################################################################### For me it says that the damage is 1.0 and it still doesnt kill the player Link to comment Share on other sites More sharing options...
Donnovan Posted May 2, 2014 Report Share Posted May 2, 2014 (...) In other cases, it is very much in the way and you can accidentally press. Great appointment. I have one player in my server that have choosen it accidentaly while we was playing. I also did that. I will require double selection. Hope to finish today. Link to comment Share on other sites More sharing options...
Asian Kid Posted May 3, 2014 Author Report Share Posted May 3, 2014 I fix the errors at a different time. Made this at 3am in the morning Link to comment Share on other sites More sharing options...
Asian Kid Posted May 4, 2014 Author Report Share Posted May 4, 2014 Updated Link to comment Share on other sites More sharing options...
Mikano Posted May 10, 2014 Report Share Posted May 10, 2014 What is the "right click addon/script" you are referencing? I've looked for it but can't find it mentioned anyone on here except for in this thread. Link to comment Share on other sites More sharing options...
StiflersM0M Posted May 19, 2014 Report Share Posted May 19, 2014 Hey, only want give a hint if anybody else have it, "z_scream_" is not declared for me, which cause that everytime a player commit suicide this anoying "sound z_scream_ not found" message is appear for everyone. if anybody else have this problem, make it look like this "_sound = ["z_scream_3"] call bis_fnc_selectRandom;" Link to comment Share on other sites More sharing options...
Line2.lv Posted May 19, 2014 Report Share Posted May 19, 2014 Yeah, it`s very REAL, that you can do suicide without any bullets :D Link to comment Share on other sites More sharing options...
reactortrip Posted May 22, 2014 Report Share Posted May 22, 2014 If using right click options, add: closeDialog 602; to the top of the suicide.sqf to force close the inventory window. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now