[HELP] Headshot Suicide

Rite

Member
Hi all,

2 questions.
How can you abort this suicide?
Is there a button?

I tried to get rid of my gun before timeout that worked but i fell down and did NOT die from the finger to the head. ;)
You fall down but cannot move anymore so i put myself death in the database.

But the people joining my server and dropping the gun before shot. can not spawn anymore?
Anyone a script idea "If dropped gun abort suicide?"

Thx
 
You could check if they still have the gun a second time. I'm pretty sure the script sits and waits for you to move within the text dialog which should be 10 seconds.

Under
Code:
sleep 2;
add
Code:
// Final gun check
_fGun = currentWeapon player;
if (_fGun != _Secondary) exitWith {cutText [format["You drop your gun instead and think. You can go on!"], "PLAIN DOWN"];};

If they drop their gun before it reaches that area of the code then it'll give that message. It will have to be their secondary they drop. Adding it to your bag should also stop it.
 
To fix the player being dead and being stuck in the animation add
Code:
if (alive player) then {
    player SetDamage 1.1;
};
Under
Code:
player fire _Secondary;

So if they drop their gun while in the middle of the animation (which is after the second gun check) it will still kill them.
 
Thx Vampire it works great.

Below the code for others who want to use it!

Related to the following post:
http://opendayz.net/threads/release-headshot-suicide.12062/


Code:
private ["_Secondary"];
canAbort = true;
_Secondary = currentWeapon player;
player addEventHandler ["fired", {if (alive player) then { player SetDamage 1.1;};}];
cutText [format["You think about your family... 10 Seconds"], "PLAIN DOWN"];
sleep 4;
cutText [format["Your little daughter, and what happened to her... 6 Seconds"], "PLAIN DOWN"];
sleep 4;
cutText [format["You cant take this shit any longer... 2 Seconds"], "PLAIN DOWN"];
sleep 2;
// Final gun check
_fGun = currentWeapon player;
if (_fGun != _Secondary) exitWith {cutText [format["Good choice my friend, you gave it second thoughts, this life you're living is wonderful!!"], "PLAIN DOWN"];player removeAllEventHandlers "fired";};
cutText [format["Goodbye cruel world!"], "PLAIN DOWN"];
canAbort = false;
player playmove "ActsPercMstpSnonWpstDnon_suicide1B";
sleep 8.4;
player fire _Secondary;
if (alive player) then {
    player SetDamage 1.1;
};
 
Last input.
Code:
this live your living is wonderful!!

Should be
Code:
this life you're living is wonderful!!

:p
 
The next problem i have now is that the body of the suicide cannot "hide body". It stays there!
 
Hmm, why would you want to hide it for one? doesn't seem like a big issue.
Not sure how you would do it by the script as the body isn't defined yet.

I don't know how you would fix it.
 
Ok got a point there you are right. not a big issue. ;)
Just tried it it but it would not hide the body .. haha
 
Is it not giving the option?
Might be that it still is considered an alive unit.
I would have to find the right script that is ran when a player is normally killed and spawn it for it to make it a dead body. I think the headshot suicide creator had the same issue and never found a fix.
 
no the option shows. but the body won't hide. No issue!
But i just found a bug. i just canceled my suicide and then pick up my gun again that i dropped, after that i took a shot at a zombie and then i died ! o_O


is there a way to set a timer after this ? maby 2 sec after cancel damage!
 
replace this line
Code:
if (_fGun != _Secondary) exitWith {cutText [format["Good choice my friend, you gave it second thoughts, this live you're living is wonderful!!"], "PLAIN DOWN"];};
with
Code:
if (_fGun != _Secondary) exitWith {cutText [format["Good choice my friend, you gave it second thoughts, this life you're living is wonderful!!"], "PLAIN DOWN"];player removeAllEventHandlers "fired";};
 
The issue is it sets an event to detect you firing your gun which the script forces you to do to shoot yourself.
I forgot to remove the event if you chose to live.
 
Back
Top