Wayans Posted October 24, 2013 Report Share Posted October 24, 2013 Someone knows how to cancel this script if you move? http://opendayz.net/threads/release-headshot-suicide.12062/ Link to comment Share on other sites More sharing options...
0 axeman Posted October 25, 2013 Report Share Posted October 25, 2013 Next time I think 'that shouldn't be too difficult' I might think again :) //Suicide script by Grafzahl edited by axeman to allow coming back from the brink. //File name: suicide.sqf private ["_Secondary","_lostHope","_plEH","_actSuicide"]; _Secondary = currentWeapon player; _plEH = player addEventHandler ["fired", "player SetDamage 1.1"]; _lostHope = time; r_interrupt = false; cutText [format["You think about your family... 10 Seconds"], "PLAIN DOWN"]; sleep 2; player playmove "ActsPercMstpSnonWpstDnon_suicide1B"; _actSuicide = 1; while {alive player}do{ if(r_interrupt)exitWith{ player playMoveNow "AmovPercMstpSlowWrflDnon_AmovPsitMstpSlowWrflDnon"; cutText [format["She wouldn't have wanted it to end this way.."], "PLAIN DOWN"]; while{true}do{ if(!((animationState player) in ["AmovPercMstpSlowWrflDnon_AmovPsitMstpSlowWrflDnon"]) && (alive player))exitWith{player removeEventHandler["fired", _plEH];sleep 1;player switchmove "";sleep 1;PVDZE_plr_Save = [player,[],true,true];publicVariableServer "PVDZE_plr_Save";}; }; }; if(time - _lostHope > 2 && _actSuicide < 2)then{ cutText [format["Your little daughter, and what happened to her... 6 Seconds"], "PLAIN DOWN"]; _actSuicide = 2; }; if(time - _lostHope > 6 && _actSuicide < 3)then{ cutText [format["You cant take this shit any longer... 2 Seconds"], "PLAIN DOWN"]; _actSuicide = 3; }; if(time - _lostHope > 7 && _actSuicide <4)then{ cutText [format["I come to you Sahra! Goodbye cruel world!"], "PLAIN DOWN"]; _actSuicide = 4; }; if(time - _lostHope > 9.2 && _actSuicide > 3)exitWith{ player fire _Secondary; }; sleep .1; }; Will only work properly on Epoch as I am using an epoch public variable to update the player, in the database, after cancelling the suicide animation. Without that a player who logs would get stuck in an endless loop of committing suicide and not actually dieing. There may be some timing issues depending on FPS also, have got it close as I can using an average FPS.. Also, is not perfect as the player changes to primary weapon when sitting yet still has the secondary as the main weapon. Feel free to tweak.. Link to comment Share on other sites More sharing options...
0 chi Posted December 29, 2013 Report Share Posted December 29, 2013 Im having problems with logging after i cancel the suicide and my player being alive but laying on the ground when i log back in. Seems to only do it when i log within a minute or so of canceling. Any suggestions? If i still have bullets for my pistol, then i can perform the suicide again and cancel it to get up, but when i relog, im on the ground again. Is there not a way to just stop it like when you interrupt giving yourself a bloodbag? Link to comment Share on other sites More sharing options...
0 axeman Posted December 29, 2013 Report Share Posted December 29, 2013 The problem is the database not being updated with the correct player state. Lag between the server and mysql will make this worse. A way round this may be to drop items of gear at the start of the script. Have found this a reliable way of getting a quick db update. . Link to comment Share on other sites More sharing options...
0 IGoGI Teasy Posted January 6, 2014 Report Share Posted January 6, 2014 hi, just added a menu cause some of my players said, that they didnt wanted to kill themselves.... and pushed the button accidently here is my modified code. part of "fn_selfActions.sqf" // ---------------------------------------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\nachfrage.sqf",_handGun,0,false,true,"", ""]; }; } else { player removeAction s_player_suicide; s_player_suicide = -1; }; // ---------------------------------------SUICIDE END------------------------------------ change the "custom\suicide\nachfrage.sqf" part to "yourdirection\suicide\nachfrage.sqf" then add the execute file below to a textdocument and name it "nachfrage.sqf" and save it in folder "suicide" [] execVM "custom\suicide\bestaetigen.sqf"; change again to your direction then add the menu with adding this code to a .txt-file and name it "bestaetigen.sqf" and change to your direction _path = "custom\suicide\"; _EXECscript = 'player execVM "'+_path+'%1"'; suicidemenu = [ ["",true], ["Commit Suicide!", [2], "", -5, [["expression", format[_execscript,"suicide.sqf"]]], "1", "1"], ["", [-1], "", -5, [["expression", ""]], "1", "0"], ["NO! Exit", [3], "", -3, [["expression", ""]], "1", "1"] ]; showCommandingMenu "#USER:suicidemenu"; last but not least, add the given suicide script to the suicide folder. should work at the first time. works great for me. :D so long mfg Teasy and thx to axeman for your great scripts :D Dismal 1 Link to comment Share on other sites More sharing options...
0 Dismal Posted April 18, 2014 Report Share Posted April 18, 2014 You teasy are a genius sir... thank you for the menu, solves my issues all at once. Link to comment Share on other sites More sharing options...
0 HollowAddiction Posted May 24, 2014 Report Share Posted May 24, 2014 not sure what im missing, but im not getting a scrollwheel option Link to comment Share on other sites More sharing options...
Question
Wayans
Someone knows how to cancel this script if you move?
http://opendayz.net/threads/release-headshot-suicide.12062/
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now