Suicide Script Confirmation

The current suicide script is perfect for doing exactly what it is intended for. Is there a possible way to add a confirmation to that? Perhaps another scroll wheel option saying "Confirm" and "Back out"?
 

Matt L

OpenDayZ Rockstar!
The current suicide script is perfect for doing exactly what it is intended for. Is there a possible way to add a confirmation to that? Perhaps another scroll wheel option saying "Confirm" and "Back out"?
The easiest way to do this would to have the original fn_selfActions point to a menu that says Confirm - this would then point to the suicide script, or exit. Would be easy to set up
 

Matt L

OpenDayZ Rockstar!
have the fn_selfActions point to suicide_exec.sqf :
Code:
systemChat ('Are you sure you wish to kill yourself?');
cutText ["                \nUse your scroll wheel to confirm or deny!","PLAIN"];
execVM "suicide\suicide_confirm.sqf";
then in the suicide folder (you can change filepaths of course, just make sure you do it in the menu itself also) place suicide_confirm.sqf :
Code:
pathtosuicide = "suicide\";
EXECscript1 = 'player execVM "'+pathtosuicide+'%1"';
 
Suicideconfirm =
[
    ["",false],
        ["Confirm suicide?", [2], "", -5, [["expression", format[EXECscript1,"suicide.sqf"]]], "1", "1"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
   
];};
 
showCommandingMenu "#USER:Suicideconfirm";
of course suicide.sqf would be whatever yours is named, and make sure to change the pathtosuicide as according as well.

EDIT: fixed missing brackets...sorry guys
 
Hey nice idea!!, :)
This is my selfactions suicide script:
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>"),"suicide.sqf",_handGun,0,false,true,"", ""];
    };
} else {
    player removeAction s_player_suicide;
    s_player_suicide = -1;
};
 
// ---------------------------------------SUICIDE END------------------------------------
Where to put the code you give?... and the second code is a separated script right?

thanks
 
ya nothing comes up for confirmation on the scroll wheel. it does initiate the suicide_exec though but everytime i hit commit suicide again it just repeats asking am i sure i want to kill myself
 

Matt L

OpenDayZ Rockstar!
ya nothing comes up for confirmation on the scroll wheel. it does initiate the suicide_exec though but everytime i hit commit suicide again it just repeats asking am i sure i want to kill myself
do you have the actual menu pointing to the script itself? Sounds like you have the menu pointing back to suicide_exec
 
i have fn_selfactions pointing to suicide_exec.sqf then i have suicide_exec.sqf pointing to suiccide_confirm.sqf, then suicide_confirm.sqf is pointing to the actual suicide.sqf

fn_selfactions executes the suicide_exec.sgf because it actually shows the text ingame but just no confirmation selection
Code:
systemChat ('Are you sure you wish to kill yourself?');
cutText ["                \nUse your scroll wheel to confirm or deny!","PLAIN"];
execVM "suicide\suicide_confirm.sqf";
 

Matt L

OpenDayZ Rockstar!
i have fn_selfactions pointing to suicide_exec.sqf then i have suicide_exec.sqf pointing to suiccide_confirm.sqf, then suicide_confirm.sqf is pointing to the actual suicide.sqf

fn_selfactions executes the suicide_exec.sgf because it actually shows the text ingame but just no confirmation selection
Code:
systemChat ('Are you sure you wish to kill yourself?');
cutText ["                \nUse your scroll wheel to confirm or deny!","PLAIN"];
execVM "suicide\suicide_confirm.sqf";
add me on skype mattlampley96 and send me the files one by one, i'll double check it all
 
ya nothing comes up for confirmation on the scroll wheel. it does initiate the suicide_exec though but everytime i hit commit suicide again it just repeats asking am i sure i want to kill myself
i seem to have the same problem if you guys sort it can i have a copy of your files plz :)
 
this is my error log

Code:
showCommandingMenu "#USER:Suicideco>
  Error position: <;};
 
showCommandingMenu "#USER:Suicideco>
  Error Missing ]
File mpmissions\__CUR_MP.chernarus\addons\suicide\suicide_confirm.sqf, line 11
Error in expression <, -3, [["expression", ""]], "1", "1"]
 
];};
 

Matt L

OpenDayZ Rockstar!
this is my error log

Code:
showCommandingMenu "#USER:Suicideco>
  Error position: <;};
 
showCommandingMenu "#USER:Suicideco>
  Error Missing ]
File mpmissions\__CUR_MP.chernarus\addons\suicide\suicide_confirm.sqf, line 11
Error in expression <, -3, [["expression", ""]], "1", "1"]
 
];};
I made a noob error, I believe.
Code:
["Confirm suicide?", [2], "", -5, [["expression", format[EXECscript1,"suicide.sqf"]], "1", "1"],
the part that executes the script has 3 opening brackets and 2 closing, needs an extra one. I coded this hastily, i'm sorry. Will fix my original post
 
Hate to be the bearer of bad news matty but still no good!? here are my edit files just incase ive messed it up

fn_selfActions.sqf
Code:
// ---------------------------------------SUICIDE START------------------------------------
 
private ["_handGun"];
_handGun = currentWeapon player;
if ((_handGun in ["revolver_gold_EP1","glock17_EP1","M9","M9SD","Makarov","MakarovSD","revolver_EP1","UZI_EP1","Sa61_EP1","Colt1911"]) && (player ammo _handGun > 0)) then {
    hasSecondary = true;
} else {
    hasSecondary = false;
};
if (player ammo _handGun == 1) then {
    lastRound = true;
} else {
    lastRound = false;
};
if((speed player <= 1) && hasSecondary && lastRound && _canDo) then {
    if (s_player_suicide < 0) then {
        s_player_suicide = player addaction[("<t color=""#ff0000"">" + ("Commit Suicide") +"</t>"),"addons\suicide\suicide_init.sqf",_handGun,0,false,true,"", ""];
    };
} else {
    player removeAction s_player_suicide;
    s_player_suicide = -1;
};
 
// ---------------------------------------SUICIDE END------------------------------------
suicide_init.sqf

Code:
systemChat ('Are you sure you wish to kill yourself?');
cutText ["                \nUse your scroll wheel to confirm or deny!","PLAIN"];
execVM "addons\suicide\suicide_confirm.sqf";
suicide_confirm.sqf

Code:
pathtosuicide = "addons\suicide\";
EXECscript1 = 'player execVM "'+pathtosuicide+'%1"';
 
Suicideconfirm =
[
    ["",false],
        ["Confirm suicide?", [2], "", -5, [["expression", format[EXECscript1,"suicide.sqf"]]], "1", "1"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
 
];};
 
showCommandingMenu "#USER:Suicideconfirm";
made that change.. removed the extra addons/suicide/
 

Matt L

OpenDayZ Rockstar!
Code:
pathtosuicide = "addons\suicide\";
EXECscript1 = 'player execVM "'+pathtosuicide+'%1"';
 
Suicideconfirm =
[
    ["",false],
        ["Confirm suicide?", [2], "", -5, [["expression", format[EXECscript1,"addons\suicide\suicide.sqf"]]], "1", "1"],
        ["", [-1], "", -5, [["expression", ""]], "1", "0"],
            ["Exit", [13], "", -3, [["expression", ""]], "1", "1"]
 
];};
 
showCommandingMenu "#USER:Suicideconfirm";

Code:
pathtosuicide = "addons\suicide\";
Code:
[["expression", format[EXECscript1,"addons\suicide\suicide.sqf"]]]
After EXECscript1 it should just be suicide.sqf, otherwise it's looking for it in a folder called addons\suicide\addons\suicide\suicide.sqf
 
Top