Also dass ist das Script um ATM "Auszurauben(Also wie Tanke nur das da steht wird gehackt
Code
private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_rip","_pos"];
_shop = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; //The object that has the action attached to it is _this. ,0, is the index of object, ObjNull is the default should there be nothing in the parameter or it's broken
_robber = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param; //Can you guess? Alright, it's the player, or the "caller". The object is 0, the person activating the object is 1
//_kassa = 1000; //The amount the shop has to rob, you could make this a parameter of the call (https://community.bistudio.com/wiki/addAction). Give it a try and post below ;)
_action = [_this,2] call BIS_fnc_param;//Action name
if(side _robber != civilian) exitWith { hint "Du kannst den ATM nicht hacken!" };
if(_robber distance _shop > 5) exitWith { hint "Bleibe 5m nahe am ATM!" };
if !(_kassa) then { _kassa = 1000; };
if (_rip) exitWith { hint "Ob du dumm bist??? Es kann nur einer am ATM sein!" };
if (vehicle player != _robber) exitWith { hint "Raus aus dem scheiß Auto!" };
if !(alive _robber) exitWith {};
if(!([false,"lappi",1] call life_fnc_handleInv)) exitWith {"Du hast kein Laptop"};
if (_kassa == 0) exitWith { hint "Kein Geld im ATM!" };
_rip = true;
_kassa = 10 + round(random 10000);
_shop removeAction _action;
_shop switchMove "AmovPercMstpSsurWnonDnon";
_chance = random(100);
if(_chance >= 50) then {[1,format["ALARM! - ATM: %1 wird Gehackt!", _shop]] remoteExec ["life_fnc_broadcast",west]; };
_cops = (west countSide playableUnits);
if(_cops < 2) exitWith{[_vault,-1] remoteExec ["disableSerialization;",2]; hint "Sicherheitsfirma hat dich endeckt und den ATM gesperrt!";};
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["ATM wird gehackt. Bleibe in der Nähe (10m) (1%1)...","%"];
_progress progressSetPosition 0.01;
_cP = 0.0001;
if(_rip) then
{
while{true} do
{
sleep 3;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["ATM wird gehackt. Bleibe in der Nähe (10m) (%1%2)...",round(_cP * 100),"%"];
_Pos = position player; // by ehno: get player pos
_marker = createMarker ["Marker200", _Pos]; //by ehno: Place a Maker on the map
"Marker200" setMarkerColor "ColorRed";
"Marker200" setMarkerText "!ACHTUNG! Hacker am ATM !ACHTUNG!";
"Marker200" setMarkerType "mil_warning";
if(_cP >= 1) exitWith {};
if(_robber distance _shop > 10.5) exitWith { };
if!(alive _robber) exitWith {};
};
if!(alive _robber) exitWith { _rip = false; };
if(_robber distance _shop > 10.5) exitWith { deleteMarker "Marker200"; _shop switchMove ""; hint "Laptop getrennt! - Sicherheitsfirma hat deine IP."; 5 cutText ["","PLAIN"]; _rip = false; };
5 cutText ["","PLAIN"];
titleText[format["Du hast $%1 erhackt, Nun gib Gas bevor die Cops dich sehen!",[_kassa] call life_fnc_numberText],"PLAIN"];
deleteMarker "Marker200"; // by ehno delete maker
life_cash = life_cash + _kassa;
_rip = false;
life_use_atm = false;
sleep (30 + random(180));
life_use_atm = true;
if!(alive _robber) exitWith {};
[getPlayerUID _robber,name _robber,"211"] remoteExec ["life_fnc_wantedAdd",2];
};
sleep 300;
_action = _shop addAction["ATM Hacken",life_fnc_atmhack];
_shop switchMove "";
Alles anzeigen
Und das ist der Log fehler:
Code
Error in expression < hint "Bleibe 5m nahe am ATM!" };
if !(_kassa) then { _kassa = 1000; };
if (_ri>
19:01:12 Error position: <_kassa) then { _kassa = 1000; };
if (_ri>
19:01:12 Error Nicht definierte Variable in Ausdruck: _kassa
19:01:12 File core\functions\fn_atmhack.sqf [life_fnc_atmhack], line 16
19:01:15 Error in expression < hint "Bleibe 5m nahe am ATM!" };
if !(_kassa) then { _kassa = 1000; };
if (_ri>
19:01:15 Error position: <_kassa) then { _kassa = 1000; };
if (_ri>
19:01:15 Error Nicht definierte Variable in Ausdruck: _kassa
19:01:15 File core\functions\fn_atmhack.sqf [life_fnc_atmhack], line 16
Alles anzeigen
Bin ich hier zu doof oder ist da halt wirklich kein fehler?