[CODE lang="cpp" title="In my normal game as long as send 2 people to prison server will be stuck help me!"]/*
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["_ret","_bad","_bail","_esc","_countDown","_jailed","_spawnObjs","_jailSpawnPos","_jailReleasePos"];
_ret = [_this,0,[],[[]]] call BIS_fnc_param;
_jailSpawn = [_this,1,"",[""]] call BIS_fnc_param;
_jailRelease = [_this,2,"",[""]] call BIS_fnc_param;
//_jailed = true;
if (count _ret > 0) then
{
if (count (_ret select 2) > 0) then
{
{
if (_x == "Cannabalism") exitWith
{
_jailSpawn = "jail_marker_asylum";
};
} forEach (_ret select 2);
};
};
_jailSpawnPos = if (isNil (format["%1_notepad",_jailSpawn])) then { getMarkerPos _jailSpawn } else { getPosATL (call compile format["%1_notepad",_jailSpawn]) };
_jailReleasePos = if (isNil (format["%1_notepad",_jailRelease])) then { getMarkerPos _jailRelease } else { getPosATL (call compile format["%1_notepad",_jailRelease]) };
player setPosATL _jailSpawnPos;
closeDialog 0;
life_is_arrested = true;
life_bail_paid = false;
life_breakout = false;
// Luon 20171226 Arma 3 Bug
_tmp = _ret;
[false] call life_fnc_seizePlayerIllegalAction;
_ret = _tmp;
[] call life_fnc_civFetchGear;
player setVariable ["parole", nil, true];
player setVariable ["paroleViolated", nil, true];
player setVariable ["prisoner", true, true];
player setVariable ["blindfolded", nil, true];
player setVariable ["copLevel", 0];
removeVest player;
removeHeadgear player;
removeBackpack player;
player setDamage 0;
player forceAddUniform "U_C_Scientist";
[] call life_fnc_equipGear;
player setVariable["can_revive", nil, true];
player setDamage 0;
[0] call life_fnc_setPain;
[false] call life_fnc_brokenLeg;
if(count _ret > 0) then {
life_bail_amount = (_ret select 3);
if (life_jail_time < 1) then { life_jail_time = _ret select 4; };
} else {
life_bail_amount = 1500;
life_jail_time = 5 * 60;
};
if (life_jail_time > 3600) then { life_jail_time = 3600; }; // Set to 60 mins for Skiptracer Talents
if(!isNil "was_interrogated") then {life_jail_time = round(life_jail_time * 1.33); was_interrogated = nil};
_esc = false;
_bail = false;
life_canpay_bail = nil;
[] call life_fnc_sessionUpdate;
_endTime = round (time + life_jail_time);
while {life_is_arrested} do {
//life_maxWeight = 96;
if !(life_laser_inprogress) then {removeAllWeapons player};
life_jail_time = round (_endTime - time);
life_can_trial = ((life_jail_time > 900) && !life_requested_trial);
if(life_jail_time > 0) then
{
_countDown = if(life_jail_time > 60) then {format["%1 分钟",round(life_jail_time / 60)]} else {format["%1 second(s)",life_jail_time]};
if (life_bail_amount >= life_executionThreshold && (life_configuration select 9)) then { _countDown = format["死囚\n生存考验.\n\n%1", _countDown]; };
hintSilent format["剩余时间:\n %1\n\n可否缴纳保释金: %3\n保释金: $%2",_countDown,[life_bail_amount] call life_fnc_numberText,if(isNil "life_canpay_bail") then {"是"} else {"否"}];
//_jailed = true;
};
if(life_bail_paid) exitWith
{
_bail = true;
//_jailed = false;
};
if (life_prison_inProgress && player distance2D prison_teleport < 25 && prison_gate_1 animationPhase "Door_1_rot" >= 0.5) exitWith {life_breakout=true};
if !(isNull objectParent player) then {player action ["Eject", vehicle player]};
if(player distance2D (getMarkerPos "corrections") > 100 && !(player getVariable ["defendant",false]) && !life_laser_inprogress) then // exitWith
{
systemChat "狱警:离那些高墙远一点!";
player setPosATL _jailSpawnPos;
//_esc = true;
};
if(life_jail_time < 1) exitWith {hint ""};
if(!alive player && (life_jail_time > 0)) exitWith
{
//_jailed = false;
};
life_thirst = 100;
life_hunger = 100;
[] call life_fnc_hudUpdate;
};
waitUntil { !life_isdowned };
player setVariable ["arrested", nil, true];
player setVariable ["prisoner", nil, true];
life_abort_enabled = true;
life_can_trial = false;
life_requested_trial = false;
life_jail_time = 0;
life_inv_shank = 0;
profileNamespace setVariable["asylum",false];
switch (true) do
{
case (_bail) :
{
life_is_arrested = false;
life_bail_paid = false;
life_breakout = false;
hint "你被释放了.";
serv_wanted_remove = [player];
publicVariableServer "serv_wanted_remove";
player setPosATL _jailReleasePos;
[] call life_fnc_civLoadGear;
[] call life_fnc_sessionUpdate;
[] call life_fnc_equipGear;
//_jailed = false;
};
case (life_breakout) :
{
life_is_arrested = false;
life_breakout = false;
hint "你从越狱了,你仍然拥有之前的悬赏金并增加了一项越狱的罪行.";
[[0,format["%1 越狱了!",name player]],"life_fnc_broadcast",nil,false] call life_fnc_MP;
//[[getPlayerUID player],"life_fnc_wantedPardon",false,false] call life_fnc_MP;
//sleep 2;
serv_killed = [player,"901"];
publicVariableServer "serv_killed";
};
case (alive player && !life_breakout && !_bail) :
{
life_is_arrested = false;
life_breakout = false;
hint "监狱服刑期已满,你被释放了.";
serv_wanted_remove = [player];
publicVariableServer "serv_wanted_remove";
[] call life_fnc_civLoadGear;
[] call life_fnc_sessionUpdate;
[] call life_fnc_equipGear;
if (lif_ebail_amount >= life_executionThreshold && (life_configuration select 9)) then
{
playSound "handcuffs";
cutText["坐在椅子上时,你的头被遮住了.","BLACK FADED"];
0 cutFadeOut 999999;
if (isWeaponDeployed player) then { player playMove ""; };
player setPos (getMarkerPos "respawn_civilian");
sleep 1;
playSound "elechair";
sleep 9;
player setDamage 1;
[["999999",4000,"add",player],"ASY_fnc_updateGangBank",false,false] call life_fnc_MP;
life_respawned = true;
cutText ["", "BLACK IN", 0.75];
[] call life_fnc_spawnMenu;
}
else
{
if (isWeaponDeployed player) then { player playMove ""; };
player setPosATL _jailReleasePos;
};
};
};
[/CODE]
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["_ret","_bad","_bail","_esc","_countDown","_jailed","_spawnObjs","_jailSpawnPos","_jailReleasePos"];
_ret = [_this,0,[],[[]]] call BIS_fnc_param;
_jailSpawn = [_this,1,"",[""]] call BIS_fnc_param;
_jailRelease = [_this,2,"",[""]] call BIS_fnc_param;
//_jailed = true;
if (count _ret > 0) then
{
if (count (_ret select 2) > 0) then
{
{
if (_x == "Cannabalism") exitWith
{
_jailSpawn = "jail_marker_asylum";
};
} forEach (_ret select 2);
};
};
_jailSpawnPos = if (isNil (format["%1_notepad",_jailSpawn])) then { getMarkerPos _jailSpawn } else { getPosATL (call compile format["%1_notepad",_jailSpawn]) };
_jailReleasePos = if (isNil (format["%1_notepad",_jailRelease])) then { getMarkerPos _jailRelease } else { getPosATL (call compile format["%1_notepad",_jailRelease]) };
player setPosATL _jailSpawnPos;
closeDialog 0;
life_is_arrested = true;
life_bail_paid = false;
life_breakout = false;
// Luon 20171226 Arma 3 Bug
_tmp = _ret;
[false] call life_fnc_seizePlayerIllegalAction;
_ret = _tmp;
[] call life_fnc_civFetchGear;
player setVariable ["parole", nil, true];
player setVariable ["paroleViolated", nil, true];
player setVariable ["prisoner", true, true];
player setVariable ["blindfolded", nil, true];
player setVariable ["copLevel", 0];
removeVest player;
removeHeadgear player;
removeBackpack player;
player setDamage 0;
player forceAddUniform "U_C_Scientist";
[] call life_fnc_equipGear;
player setVariable["can_revive", nil, true];
player setDamage 0;
[0] call life_fnc_setPain;
[false] call life_fnc_brokenLeg;
if(count _ret > 0) then {
life_bail_amount = (_ret select 3);
if (life_jail_time < 1) then { life_jail_time = _ret select 4; };
} else {
life_bail_amount = 1500;
life_jail_time = 5 * 60;
};
if (life_jail_time > 3600) then { life_jail_time = 3600; }; // Set to 60 mins for Skiptracer Talents
if(!isNil "was_interrogated") then {life_jail_time = round(life_jail_time * 1.33); was_interrogated = nil};
_esc = false;
_bail = false;
life_canpay_bail = nil;
[] call life_fnc_sessionUpdate;
_endTime = round (time + life_jail_time);
while {life_is_arrested} do {
//life_maxWeight = 96;
if !(life_laser_inprogress) then {removeAllWeapons player};
life_jail_time = round (_endTime - time);
life_can_trial = ((life_jail_time > 900) && !life_requested_trial);
if(life_jail_time > 0) then
{
_countDown = if(life_jail_time > 60) then {format["%1 分钟",round(life_jail_time / 60)]} else {format["%1 second(s)",life_jail_time]};
if (life_bail_amount >= life_executionThreshold && (life_configuration select 9)) then { _countDown = format["死囚\n生存考验.\n\n%1", _countDown]; };
hintSilent format["剩余时间:\n %1\n\n可否缴纳保释金: %3\n保释金: $%2",_countDown,[life_bail_amount] call life_fnc_numberText,if(isNil "life_canpay_bail") then {"是"} else {"否"}];
//_jailed = true;
};
if(life_bail_paid) exitWith
{
_bail = true;
//_jailed = false;
};
if (life_prison_inProgress && player distance2D prison_teleport < 25 && prison_gate_1 animationPhase "Door_1_rot" >= 0.5) exitWith {life_breakout=true};
if !(isNull objectParent player) then {player action ["Eject", vehicle player]};
if(player distance2D (getMarkerPos "corrections") > 100 && !(player getVariable ["defendant",false]) && !life_laser_inprogress) then // exitWith
{
systemChat "狱警:离那些高墙远一点!";
player setPosATL _jailSpawnPos;
//_esc = true;
};
if(life_jail_time < 1) exitWith {hint ""};
if(!alive player && (life_jail_time > 0)) exitWith
{
//_jailed = false;
};
life_thirst = 100;
life_hunger = 100;
[] call life_fnc_hudUpdate;
};
waitUntil { !life_isdowned };
player setVariable ["arrested", nil, true];
player setVariable ["prisoner", nil, true];
life_abort_enabled = true;
life_can_trial = false;
life_requested_trial = false;
life_jail_time = 0;
life_inv_shank = 0;
profileNamespace setVariable["asylum",false];
switch (true) do
{
case (_bail) :
{
life_is_arrested = false;
life_bail_paid = false;
life_breakout = false;
hint "你被释放了.";
serv_wanted_remove = [player];
publicVariableServer "serv_wanted_remove";
player setPosATL _jailReleasePos;
[] call life_fnc_civLoadGear;
[] call life_fnc_sessionUpdate;
[] call life_fnc_equipGear;
//_jailed = false;
};
case (life_breakout) :
{
life_is_arrested = false;
life_breakout = false;
hint "你从越狱了,你仍然拥有之前的悬赏金并增加了一项越狱的罪行.";
[[0,format["%1 越狱了!",name player]],"life_fnc_broadcast",nil,false] call life_fnc_MP;
//[[getPlayerUID player],"life_fnc_wantedPardon",false,false] call life_fnc_MP;
//sleep 2;
serv_killed = [player,"901"];
publicVariableServer "serv_killed";
};
case (alive player && !life_breakout && !_bail) :
{
life_is_arrested = false;
life_breakout = false;
hint "监狱服刑期已满,你被释放了.";
serv_wanted_remove = [player];
publicVariableServer "serv_wanted_remove";
[] call life_fnc_civLoadGear;
[] call life_fnc_sessionUpdate;
[] call life_fnc_equipGear;
if (lif_ebail_amount >= life_executionThreshold && (life_configuration select 9)) then
{
playSound "handcuffs";
cutText["坐在椅子上时,你的头被遮住了.","BLACK FADED"];
0 cutFadeOut 999999;
if (isWeaponDeployed player) then { player playMove ""; };
player setPos (getMarkerPos "respawn_civilian");
sleep 1;
playSound "elechair";
sleep 9;
player setDamage 1;
[["999999",4000,"add",player],"ASY_fnc_updateGangBank",false,false] call life_fnc_MP;
life_respawned = true;
cutText ["", "BLACK IN", 0.75];
[] call life_fnc_spawnMenu;
}
else
{
if (isWeaponDeployed player) then { player playMove ""; };
player setPosATL _jailReleasePos;
};
};
};
[/CODE]