Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Save New Duplicate & Edit Just Text Twitter
- >
- #include "..\..\script_macros.hpp"
- /*
- File: fn_jailMe.sqf
- Author Bryan "Tonic" Boardwine
- Description:
- Once word is received by the server the rest of the jail execution is completed.
- */
- private ["_time","_bail","_esc","_countDown"];
- params [
- ["_ret",[],[[]]],
- ["_bad",false,[false]]
- ];
- //Begin jail uniform
- hint "Il tuo equipaggiamento è stato inserito nell' armadietto delle prove!";
- old_gear = getUnitLoadout player;
- removeUniform player;
- removeHeadgear player;
- removeVest player;
- removeGoggles player;
- removeBackpack player;
- removeallWeapons player;
- removeallAssignedItems player;
- player addUniform "U_C_Scientist";
- [] call life_fnc_playerSkins;
- if (_bad) then { _time = time + 1100; } else { _time = time + (15 * 60); };
- if (count _ret > 0) then { life_bail_amount = (_ret select 2); } else { life_bail_amount = 1500; _time = time + (10 * 60); };
- _esc = false;
- _bail = false;
- [_bad] spawn {
- life_canpay_bail = false;
- if (_this select 0) then {
- sleep (10 * 60);
- } else {
- sleep (5 * 60);
- };
- life_canpay_bail = true;
- };
- for "_i" from 0 to 1 step 0 do {
- if ((round(_time - time)) > 0) then {
- _countDown = [(_time - time),"MM:SS.MS"] call BIS_fnc_secondsToString;
- 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 (life_canpay_bail) then {"Yes"} else {"No"}];
- };
- if (LIFE_SETTINGS(getNumber,"jail_forceWalk") isEqualTo 1) then {
- player forceWalk true;
- };
- private _escDist = [[["Altis", 60], ["Tanoa", 145]]] call TON_fnc_terrainSort;
- if (player distance (getMarkerPos "jail_marker") > _escDist) exitWith {
- _esc = true;
- };
- if (life_bail_paid) exitWith {
- _bail = true;
- };
- if ((round(_time - time)) < 1) exitWith {hint ""};
- if (!alive player && ((round(_time - time)) > 0)) exitWith {};
- sleep 0.1;
- };
- switch (true) do {
- case (_bail): {
- life_is_arrested = false;
- life_bail_paid = false;
- hint localize "STR_Jail_Paid";
- player setPos (getMarkerPos "jail_release");
- if (life_HC_isActive) then {
- [getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
- } else {
- [getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
- };
- player setUnitLoadout old_gear;
- hint "Poichè hai scontato la tua pena in prigione a breve riceverai i tuoi vestiti!";
- [] call life_fnc_saveGear;
- [5] call SOCK_fnc_updatePartial;
- };
- case (_esc): {
- life_is_arrested = false;
- hint localize "STR_Jail_EscapeSelf";
- [0,"STR_Jail_EscapeNOTF",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
- if (life_HC_isActive) then {
- [getPlayerUID player,profileName,"901"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
- } else {
- [getPlayerUID player,profileName,"901"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
- };
- hint "Poichè sei scappato dalla prigione i tuoi vestiti sono stati distrutti dalla polizia!";
- [] call life_fnc_saveGear;
- [5] call SOCK_fnc_updatePartial;
- };
- case (alive player && !_esc && !_bail): {
- life_is_arrested = false;
- hint localize "STR_Jail_Released";
- if (life_HC_isActive) then {
- [getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
- } else {
- [getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
- };
- player setUnitLoadout old_gear;
- hint "Poichè hai scontato la tua pena in prigione a breve riceverai i tuoi vestiti!";
- [] call life_fnc_saveGear;
- player setPos (getMarkerPos "jail_release");
- [5] call SOCK_fnc_updatePartial;
- };
- };
- player forceWalk false; // Enable running & jumping
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement