Advertisement
Guest User

Untitled

a guest
May 6th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. /*
  2. File: fn_jailMe.sqf
  3. Author Bryan "Tonic" Boardwine
  4.  
  5. Description:
  6. Once word is received by the server the rest of the jail execution is completed.
  7. */
  8. private["_ret","_bad","_time","_bail","_esc","_countDown"];
  9. _ret = [_this,0,[],[[]]] call BIS_fnc_param;
  10. _bad = [_this,1,false,[false]] call BIS_fnc_param;
  11. if(_bad) then { _time = time + 1100; } else { _time = time + (15 * 60); };
  12.  
  13. if(count _ret > 0) then { life_bail_amount = (_ret select 3); } else { life_bail_amount = 1500; _time = time + (10 * 60); };
  14. _esc = false;
  15. _bail = false;
  16.  
  17. [_bad] spawn
  18. {
  19. life_canpay_bail = false;
  20. if(_this select 0) then
  21. {
  22. sleep (10 * 60);
  23. }
  24. else
  25. {
  26. sleep (5 * 60);
  27. };
  28. life_canpay_bail = nil;
  29. };
  30.  
  31. while {true} do
  32. {
  33. if((round(_time - time)) > 0) then {
  34. _countDown = [(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString;
  35. hintSilent parseText format[(localize "STR_Jail_Time")+ "<br/> <t size='2'><t color='#FF0000'>%1</t></t><br/><br/>" +(localize "STR_Jail_Pay")+ " %3<br/>" +(localize "STR_Jail_Price")+ " $%2",_countDown,[life_bail_amount] call life_fnc_numberText,if(isNil "life_canpay_bail") then {"Yes"} else {"No"}];
  36. };
  37.  
  38. if(player distance (getMarkerPos "jail_marker") > 60) exitWith {
  39. _esc = true;
  40. };
  41.  
  42. if(life_bail_paid) exitWith {
  43. _bail = true;
  44. };
  45.  
  46. if((round(_time - time)) < 1) exitWith {hint ""};
  47. if(!alive player && ((round(_time - time)) > 0)) exitWith {};
  48. sleep 0.1;
  49. };
  50.  
  51.  
  52. switch (true) do
  53. {
  54. case (_bail) :
  55. {
  56. life_is_arrested = false;
  57. life_bail_paid = false;
  58. hint localize "STR_Jail_Paid";
  59. serv_wanted_remove = [player];
  60. player setPos (getMarkerPos "jail_release");
  61. [[getPlayerUID player],"life_fnc_wantedRemove",false,false] spawn life_fnc_MP;
  62. [5] call SOCK_fnc_updatePartial;
  63. };
  64.  
  65. case (_esc) :
  66. {
  67. life_is_arrested = false;
  68. hint localize "STR_Jail_EscapeSelf";
  69. [[0,format[localize "STR_Jail_EscapeNOTF",profileName]],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;
  70. [[getPlayerUID player,profileName,"901"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP;
  71. [5] call SOCK_fnc_updatePartial;
  72. };
  73.  
  74. case (alive player && !_esc && !_bail) :
  75. {
  76. life_is_arrested = false;
  77. hint localize "STR_Jail_Released";
  78. [[getPlayerUID player],"life_fnc_wantedRemove",false,false] spawn life_fnc_MP;
  79. player setPos (getMarkerPos "jail_release");
  80. [5] call SOCK_fnc_updatePartial;
  81. };
  82. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement