Ja moin ich habe grade mal eine vanilla 4.0 aufgesetzt die hier aus dem forum
allerdings habe ich da ein problem gefunden wenn man im Knast ist kann man
die ablaufende zeit nicht sehen jemand ne ahnung `???
ob man nach den 15 min Knast zeit freigelassen wird teste ich grade
/Edit nach ablauf der knast zeit bleibt man leider im knast
Code: fn_jailMe.sqf
#include <macro.h>
/*
Author Bryan "Tonic" Boardwine
Description:
Once word is received by the server the rest of the jail execution is completed.
*/
private["_ret","_bad","_time","_bail","_esc","_countDown"];
_ret = [_this,0,[],[[]]] call BIS_fnc_param;
_bad = [_this,1,false,[false]] call BIS_fnc_param;
if(_bad) then { _time = time + 1100; } else { _time = time + (15 * 60); };
if(count _ret > 0) then { life_bail_amount = SEL(_ret,3); } 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 = nil;
};
while {true} 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(isNil "life_canpay_bail") then {"Yes"} else {"No"}];
};
if(player distance (getMarkerPos "jail_marker") > 60) 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";
serv_wanted_remove = [player];
player setPos (getMarkerPos "jail_release");
[[getPlayerUID player],"life_fnc_wantedRemove",false,false] call life_fnc_MP;
[5] call SOCK_fnc_updatePartial;
};
case (_esc): {
life_is_arrested = false;
hint localize "STR_Jail_EscapeSelf";
[[0,"STR_Jail_EscapeNOTF",true,[profileName]],"life_fnc_broadcast",nil,false] call life_fnc_MP;
[[getPlayerUID player,profileName,"901"],"life_fnc_wantedAdd",false,false] call life_fnc_MP;
[5] call SOCK_fnc_updatePartial;
};
case (alive player && !_esc && !_bail): {
life_is_arrested = false;
hint localize "STR_Jail_Released";
[[getPlayerUID player],"life_fnc_wantedRemove",false,false] call life_fnc_MP;
player setPos (getMarkerPos "jail_release");
[5] call SOCK_fnc_updatePartial;
};
};
Alles anzeigen
Code: fn_jail.sqf
#include <macro.h>
/*
File: fn_jail.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the initial process of jailing.
*/
private["_bad","_unit"];
_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
hint format["%1", _unit];
if(isNull _unit) exitWith {}; //Dafuq?
if(_unit != player) exitWith {}; //Dafuq?
if(life_is_arrested) exitWith {}; //Dafuq i'm already arrested
_bad = [_this,1,false,[false]] call BIS_fnc_param;
player SVAR ["restrained",false,true];
player SVAR ["Escorting",false,true];
player SVAR ["transporting",false,true];
titleText[localize "STR_Jail_Warn","PLAIN"];
hint localize "STR_Jail_LicenseNOTF";
player setPos (getMarkerPos "jail_marker");
if(_bad) then {
waitUntil {alive player};
sleep 1;
};
//Check to make sure they goto check
if(player distance (getMarkerPos "jail_marker") > 40) then {
player setPos (getMarkerPos "jail_marker");
};
[1] call life_fnc_removeLicenses;
if(life_inv_heroinu > 0) then {[false,"heroinu",life_inv_heroinu] call life_fnc_handleInv;};
if(life_inv_heroinp > 0) then {[false,"heroinp",life_inv_heroinp] call life_fnc_handleInv;};
if(life_inv_coke > 0) then {[false,"cocaine",life_inv_coke] call life_fnc_handleInv;};
if(life_inv_cokep > 0) then {[false,"cocainep",life_inv_cokep] call life_fnc_handleInv;};
if(life_inv_turtle > 0) then {[false,"turtle",life_inv_turtle] call life_fnc_handleInv;};
if(life_inv_cannabis > 0) then {[false,"cannabis",life_inv_cannabis] call life_fnc_handleInv;};
if(life_inv_marijuana > 0) then {[false,"marijuana",life_inv_marijuana] call life_fnc_handleInv;};
life_is_arrested = true;
removeAllWeapons player;
{player removeMagazine _x} foreach (magazines player);
[[player,_bad],"life_fnc_jailSys",false,false] call life_fnc_MP;
[5] call SOCK_fnc_updatePartial;
Alles anzeigen