Moin,
ich hatte ja vor kurzem mal gefragt, weil ich den angezeigten Namen der Tankstelle ändern wollte.
Jedoch hab ich mittlerweile das Problem, dass die Tankstellenräube nicht mehr funktionieren, das Script bricht mittendrin ab.
Man kann den laden Anfangen auszurauben und sobald die Progressbar erscheint ist es schon wieder vorbei, die Progressbar hat man dann permanent on Screen und es verändert sich nichts mehr und es passiert nichts mehr.
Wäre prima wenn da jemand was sieht
Code
Code
/*
file: fn_robShops.sqf
Author: MrKraken
Edit: HighLife
Description:
Executes the rob shob action!
*/
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 darfst die Tankstelle nicht ausrauben!" };
if(_robber distance _shop > 5) exitWith { hint "Ich muss näher ran (5m)!" };
if !(_kassa) then { _kassa = 1000; };
if (_rip) exitWith { hint "Es ist bereits ein Raub in gange!" };
if (vehicle player != _robber) exitWith { hint "Von hier seh ich den Verkäufer nicht mehr." };
if !(alive _robber) exitWith {};
if (currentWeapon _robber == "") exitWith { hint "Haha, du machst mir keine Angst! Hau ab!" };
if (_kassa == 0) exitWith { hint "Da ist kein Geld in der Kasse!" };
_rip = true;
_kassa = 500 + round(random 2500);
_shop removeAction _action;
_shop switchMove "AmovPercMstpSsurWnonDnon";
_shopname = _shop;
switch(_shopname) do {
case Station_shop_1: { _shopname = "Tuvanaka"; };
case Station_shop_2: { _shopname = "La Rochelle Ost"; };
case Station_shop_3: { _shopname = "Regina"; };
case Station_shop_04: { _shopname = "Nicolet Ost"; };
case Station_shop_06: { _shopname = "Belfort"; };
case Station_shop_07: { _shopname = "La Rochelle West"; };
case Station_shop_08: { _shopname = "Nicolet West"; };
case Station_shop_09: { _shopname = "Tanouka Sud"; };
case Station_shop_10: { _shopname = "Balavu"; };
case Station_shop_11: { _shopname = "Georgetown Mitte"; };
case Station_shop_12: { _shopname = "Katkoula Ost"; };
case Station_shop_13: { _shopname = "Verkehrsübungsplatz"; };
case Station_shop_14: { _shopname = "Nandai"; };
case Station_shop_15: { _shopname = "Harcourt"; };
case Station_shop_16: { _shopname = "Kotomo"; };
case Station_shop_17: { _shopname = "Yanukka"; };
case Station_shop_18: { _shopname = "Lijnhaven Industriegebiet"; };
case Station_shop_19: { _shopname = "Lami"; };
case Station_shop_20: { _shopname = "Vagalala"; };
case Station_shop_21: { _shopname = "Aéroport de Tanoa"; };
case Station_shop_22: { _shopname = "Katkoula West"; };
case Station_shop_23: { _shopname = "Lijnhaven"; };
case Station_shop_24: { _shopname = "Ouméré"; };
case Station_shop_25: { _shopname = "Lifou"; };
case Station_shop_26: { _shopname = "Georgetown Nord"; };
case Station_shop_27: { _shopname = "Georgetown Sud"; };
case Station_shop_28: { _shopname = "Tanouka Nord"; };
};
_chance = random(100);
if(_chance >= 10) then {[1,format["ALARM! - Tankstelle: %1 wird ausgeraubt!", _shopname]] remoteExec ["life_fnc_broadcast",west]; };
if(_chance <= 10) then {hint format ["Der Alarm wurde nicht ausgelöst!"]; };
_cops = (west countSide playableUnits);
if(_cops < 2) exitWith{[_vault,-1] remoteExec ["disableSerialization;",2]; hint "Es sind zu wenig Polizisten im Staat";};
disableSerialization;
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["Renn nicht weg! (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["Renn nicht weg! (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 "ALARM";
"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 "Ich muss in der Nähe des Kassierers bleiben! (10m) - Jetzt ist die Kasse verschlossen!"; 5 cutText ["","PLAIN"]; _rip = false; };
5 cutText ["","PLAIN"];
titleText[format["Du hast $%1, erbeutet , jetzt schnell weg hier!",[_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 {};
};
sleep 300;
_action = _shop addAction["Kassierer bedrohen",life_fnc_robstore];
_shop switchMove "";
Alles anzeigen