Guten Morgen zusammen,
Ich habe folgendes Problem. Ich kann jemanden festnehmen und den dann ins Gefängnis schicken. Der Marker für das zurück spawnen ist auch da. ist auch mit "jail_marker" bezeichnet. Ich werde z.B. ins Gefängnis gesteckt, der teleport dort hin funktioniert auch. Es kommt aber folgende Fehlermeldung.
Allerdings ist dann das Problem, dass die Gefängniszeit nicht anläuft. Egal wie lange man drin sitzt. Es passiert nichts. Auch wenn ich versuche die Strafe zu bezahlen, passiert einfach nichts. Man kommt nichtmehr aus dem Gefängnis raus. Ab diesem Zeitpunkt kann man auch nichtmehr ausloggen. Der Beenden Button bleibt schraffiert.
Ich hätte auch gerne, dass man eine Gefängnisuniform bekommt und das inv leer ist bis auf etwas Geld und (Wasser / und taktischer Speck), kann man das einbauen und wenn ja wie?
Ich lade hier mal die jail-Dateien hoch.
#include <macro.h>
/*
File: fn_jail.sqf
Author: Bryan "Tonic" Boardwine
Description:
Starts the initial process of jailing.
*/
private["_bad","_unit","_time"];
_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;
_time = [_this,2,15,[0]] 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,"heroinUnprocessed",life_inv_heroinu] call life_fnc_handleInv;}; //heroinu
if(life_inv_heroinp > 0) then {[false,"heroinProcessed",life_inv_heroinp] call life_fnc_handleInv;}; //heroinp
if(life_inv_coke > 0) then {[false,"cocaineUnprocessed",life_inv_coke] call life_fnc_handleInv;}; //cocaine
if(life_inv_cokep > 0) then {[false,"cocaineProcessed",life_inv_cokep] call life_fnc_handleInv;}; //cocainep
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;};
if(life_inv_mash > 0) then {[false,"mash",life_inv_mash] call life_fnc_handleInv;}; //Moonshine
if(life_inv_moonshine > 0) then {[false,"moonshine",life_inv_moonshine] call life_fnc_handleInv;}; //Moonshine
if(life_inv_bottledshine > 0) then {[false,"bottledshine",life_inv_bottledshine] call life_fnc_handleInv;}; //Moonshine
[] call life_fnc_jailMe;
life_is_arrested = true;
removeAllWeapons player;
{player removeMagazine _x} foreach (magazines player);
[[player,_bad,_time],"life_fnc_jailSys",false,false] call life_fnc_MP;
[5] call SOCK_fnc_updatePartial;
Alles anzeigen
#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","_time"];
_ret = [_this,0,[],[[]]] call BIS_fnc_param;
_bad = [_this,1,false,[false]] call BIS_fnc_param;
_time = [_this,2,15,[0]] call BIS_fnc_param;
_time = time + (_time * 60);
//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); };
if(count _ret > 0) then { life_bail_amount = (_ret select 3); } else { life_bail_amount = 20000;
_esc = false;
_bail = false;
if(_time <= 0) then { _time = time + (15 * 60); hintC "Please Report to Admin: JAIL_FALLBACK_15, time is zero!"; };
[_bad,_time] spawn {
life_canpay_bail = false;
life_bail_amount = life_bail_amount * 5;
if(_this select 0) then {
sleep ( (_this select 1) * 0.5 );
//sleep (10 * 60);
} else {
sleep ( (_this select 1) * 0.2 );
//sleep (5 * 60);
};
life_canpay_bail = nil;
};
while {true} do
{
if((round(_time - time)) > 0) then
{
_countDown = if(round (_time - time) > 60) then {format["%1 minute(s)",round(round(_time - time) / 60)]} else {format["%1 second(s)",round(_time - time)]};
if(isNil "life_canpay_bail") then
{
hintSilent format["Time Remaining:\n %1\n\nCan pay Bail: %3\nBail Amount: $%2",_countDown,[life_bail_amount] call life_fnc_numberText];
}
else
{
hintSilent format["Time Remaining:\n %1\n",_countDown];
};
};
if(player distance (getMarkerPos "jail_marker") > 180) 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 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] spawn life_fnc_MP;
[5] call SOCK_fnc_updatePartial;
};
case (_esc) :
{
life_is_arrested = false;
hint localize "STR_Jail_EscapeSelf";
[[0,format["%1 has escaped from jail!",profileName]],"life_fnc_broadcast",nil,false] spawn life_fnc_MP;
[[getPlayerUID player,profileName,"901"],"life_fnc_wantedAdd",false,false] spawn 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] spawn life_fnc_MP;
player setPos (getMarkerPos "jail_release");
[5] call SOCK_fnc_updatePartial;
};
};
/*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;
[] call life_fnc_jailMe;
};
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
Wie man sieht habe ich einige Tipps versucht umzusetzen. (ausgeklammert ist immer der alte code) Aber irgendwie komme ich nicht weiter.
Wäre schön wenn mir da jemand helfen könnte.
Saturin78