Advertisement
Guest User

DonkeyPunch suicide delay function

a guest
Jun 19th, 2016
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. /**
  2. * ExileClient_gui_escape_suicide
  3. *
  4. * Exile Mod
  5. * www.exilemod.com
  6. * © 2015 Exile Mod Team
  7. *
  8. * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10. */
  11.  
  12. private["_maxSuicides","_suicideDelay","_currentSuicide","_product","_result","_display"];
  13.  
  14. _maxSuicides=getNumber(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "MaxSuicides");
  15. _suicideDelay=getNumber(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "SuicideDelay");
  16. _currentSuicide=missionNameSpace getVariable[format["ExileClientSuicided%1",getplayerUID player],0];
  17. _amountSuicides=missionNameSpace getVariable[format["ExileClientMaxSuicides%1",getplayerUID player],0];
  18. if(_amountSuicides < _maxSuicides)then
  19. {
  20. if ((diag_tickTime - _currentSuicide) > _suicideDelay)then
  21. {
  22. disableSerialization;
  23. _result = ["Do you really want to end your life?", "Confirm", "Yes", "Nah"] call BIS_fnc_guiMessage;
  24. waitUntil { !isNil "_result" };
  25. if (_result) then
  26. {
  27. _display = findDisplay 49;
  28. if !(isNull _display) then
  29. {
  30. _display closeDisplay 2;
  31. };
  32. missionNameSpace setVariable[format["ExileClientSuicided%1",getplayerUID player],diag_tickTime];
  33. _product = _amountSuicides + 1;
  34. missionNameSpace setVariable[format["ExileClientMaxSuicides%1",getplayerUID player],_product];
  35. player allowDamage true;
  36. player setDamage 1;
  37.  
  38. };
  39. }
  40. else
  41. {
  42. disableSerialization;
  43. //_result = ["Why do you want to SUICIDE so quickly?", "Confirm", "I'm A Douche", "JusCuz"] call BIS_fnc_guiMessage;
  44. _display = findDisplay 49;
  45. _display closeDisplay 2;
  46. hint "DonkeyPunch Suicide Delay Enabled :P";
  47. ["Whoops",["DonkeyPuncheD Suicide Delay"]] call ExileClient_gui_notification_event_addNotification;
  48. };
  49. }
  50. else
  51. {
  52. disableSerialization;
  53. //_result = ["Do you honestly think you have another suicide left?", "Confirm", "I DO, I DO", "Nah"] call BIS_fnc_guiMessage;
  54. _display = findDisplay 49;
  55. _display closeDisplay 2;
  56. hint "DonkeyPunch Suicide Maximum Reached :P";
  57. ["Whoops",["Suicide Max Reached DonkeyPuncheD"]] call ExileClient_gui_notification_event_addNotification;
  58.  
  59. };
  60. true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement