Hier mal alle Files:
Code: fn_arrestDialog_Arrest.sqf
#include "..\..\script_macros.hpp"
/*
Player clicked arrest/ok [player, _time] call life_fnc_arrestAction;
*/
if(playerSide != west) exitWith {};
//Get minutes
private _time = ctrlText 1400;
if(! ([_time] call TON_fnc_isnumber)) exitWith {
hint localize "STR_ATM_notnumeric";
};
_time = parseNumber _time; //requested number
_time = round _time;
if(_time < 1 || _time > 120) exitWith { hint "Die Zeit muss zwischen 1 und 120 Minuten sein!"; };
titleText[format ["Du hast ihn für %1 Monate verhaftet!",_time],"PLAIN"];
closeDialog 0;
[cursorObject, _time] call life_fnc_arrestAction; // [player, 34] call life_fnc_arrestAction;
[0,"STR_NOTF_Arrested_1",true, [cursorObject getVariable ["realname",name cursorObject], player getVariable ["realname", name player], _time]] remoteExecCall ["life_fnc_broadcast",0];
Alles anzeigen
Code: fn_arrestAction.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_arrestAction.sqf
Author:
Description:
Arrests the targeted person.
*/
private _unit = _this select 0;
private _time = _this select 1;
/*if (isNull _unit) exitWith {}; //Not valid
if (isNil "_unit") exitWith {}; //Not Valid
if (!(_unit isKindOf "Man")) exitWith {}; //Not a unit
if (!isPlayer _unit) exitWith {}; //Not a human
if (!(_unit getVariable "restrained")) exitWith {}; //He's not restrained.
//if (!((side _unit) in [civilian,independent,east])) exitWith {}; Not a civ
if (isNull _unit) exitWith {}; //Not valid*/
detach _unit;
[_unit,false,_time] remoteExecCall ["life_fnc_jail",_unit];
[format ["Jail Log: Cop %1 hat %2 (%3) für %4 Minuten ins Gefängnis gesteckt",player getVariable ["realname",name player], _unit getVariable ["realname",name _unit], getPlayerUID _unit, _time]] remoteExec ["SOCK_fnc_diaLog",2];
Alles anzeigen
Code: fn_jail.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_jail.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the initial process of jailing.
*/
private _unit = _this select 0;
private _bad = _this select 1;
private _time = _this select 2;
if (life_is_arrested) exitWith {}; //Dafuq i'm already arrested
private _illegalItems = LIFE_SETTINGS(getArray,"jail_seize_vItems");
player setVariable ["restrained",false,true];
player setVariable ["Escorting",false,true];
player setVariable ["transporting",false,true];
titleText[localize "STR_Jail_Warn","PLAIN"];
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");
};
life_is_arrested = true;
if (LIFE_SETTINGS(getNumber,"jail_seize_inventory") isEqualTo 1) then {
[] spawn life_fnc_seizeClient;
} else {
removeAllWeapons player;
{player removeMagazine _x} forEach (magazines player);
};
[player,_bad,_time] remoteExecCall ["life_fnc_jailSys",RSERV];
[5] call SOCK_fnc_updatePartial;
Alles anzeigen
Code: fn_jailMe.sqf
#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]],
["_time",15,[0]]
];
_handle = [] spawn life_fnc_stripDownPlayer;
waitUntil {scriptDone _handle};
player forceAddUniform "U_C_WorkerCoveralls";
[] call life_fnc_playerSkins;
_time = time + (_time * 60);
if (count _ret > 0) then { life_bail_amount = (_ret select 2); } else { life_bail_amount = 1500; };
_esc = false;
_bail = false;
if(_time <= 0) then { _time = time + (15 * 60); hintC "Please Report to Admin: JAIL_FALLBACK_15, time is zero!"; };
while {true} do {
if((round(_time - time)) > 0) then {
_countDown = if(round (_time - time) > 60) then {format["%1 Minuten",round(round(_time - time) / 60)]} else {format["%1 Sekunden",round(_time - time)]};
hintSilent format["Verbleibende Zeit:\n %1\n",_countDown];
};
_remain = (round(_time - time));
if ((_remain % 60) isEqualTo 0) then {
player setVariable ["JailTime", (round(_remain / 60)) ];
[5] call SOCK_fnc_updatePartial;
};
player forceWalk true;
if (player distance (getMarkerPos "jail_marker") > 60) exitWith {
_esc = 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");
player setVariable ["JailTime",0];
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
[5] call SOCK_fnc_updatePartial;
};
case (_esc): {
life_is_arrested = false;
hint localize "STR_Jail_EscapeSelf";
[format ["Jail Log: %1 (%2) ist aus dem Gefängnis ausgebrochen",player getVariable ["realname",name player], getPlayerUID player]] remoteExec ["SOCK_fnc_diaLog",2];
[0,"STR_Jail_EscapeNOTF",true,[profileName]] remoteExecCall ["life_fnc_broadcast",west];
player setVariable ["JailTime",0];
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];
};
[5] call SOCK_fnc_updatePartial;
};
case (alive player && !_esc && !_bail): {
life_is_arrested = false;
hint localize "STR_Jail_Released";
[format ["Jail Log: %1 (%2) wurde aus dem Gefängnis entlassen",player getVariable ["realname",name player], getPlayerUID player]] remoteExec ["SOCK_fnc_diaLog",2];
if (life_HC_isActive) then {
[getPlayerUID player] remoteExecCall ["HC_fnc_wantedRemove",HC_Life];
} else {
[getPlayerUID player] remoteExecCall ["life_fnc_wantedRemove",RSERV];
};
player setPos (getMarkerPos "jail_release");
[5] call SOCK_fnc_updatePartial;
};
};
player forceWalk false; // Enable running & jumping
Alles anzeigen
Code: fn_jailSys.sqf
#include "\life_server\script_macros.hpp"
/*
File: fn_jailSys.sqf
Author: Bryan "Tonic" Boardwine
Description:
I forget?
*/
private["_unit","_bad","_id","_ret","_time"];
_unit = _this select 0;
_bad = _this select 1;
_time = _this select 2;
if(_bad) then {//Load time from database
_query = format["SELECT jail_time FROM players WHERE playerid='%2'", _time, getPlayerUID _unit];
_result = [_query,2] call DB_fnc_asyncCall;
_result = (_result select 0);
_time = _result;
} else {
_query = format["UPDATE players SET jail_time='%1' WHERE playerid='%2'", _time, getPlayerUID _unit];
_result = [_query,1] call DB_fnc_asyncCall;
};
_id = owner _unit;
_ret = [_unit] call life_fnc_wantedPerson;
[_ret,_bad,_time] remoteExec ["life_fnc_jailMe",_id];
Alles anzeigen
Code: fn_JailPlayer.sqf
#include "\life_server\script_macros.hpp"
/*
Sets jail values for player
*/
private["_player", "_playeruid", "_query", "_time"];
_player = _this select 0;
_playeruid = _this select 1;
_time = _this select 2;
_time = ceil _time; //to be sure
_player = owner _player;
_query = format["UPDATE players SET arrested='1', jail_time='%1' WHERE playerid='%2'", _time, _playeruid];
[_query,1] call DB_fnc_asyncCall;
Alles anzeigen