Also 5 Leute 5 Tanken das schon etwas doof.
Ich hab mal auf einem Server gesehen das 7 Leute die gleiche Tankstelle überfallen konnten =D
- Das gab echt viel Kies
[Tutorial]Tankstellen Ausrauben
-
- Altis Life
-
AmaZiinG -
30. August 2016 um 12:41
-
-
Moin,
ich habe es gestern leider nicht mehr geschafft mir das genauer anzuschauen, allerdings werde ich da was bauen bevor ich das auf unseren Server übernehmen. Ich höre jetzt schon das "Mimimi" der Cops, wenn ich das so Live setze. Sollte irgendwer schon was fertig haben würde ich mich freuen, wenn er es teilt ansonsten poste ich mal meine Lösung sobald sie implementiert ist.
Gruß,
moeck
-
Moin,
bin leider immer noch nicht dazu gekommen mir das anzuschauen. Falls wer schon eine Lösung hat würde ich mich über eine Antwort freuen
Gruß,
moeck
-
keine Lösung, aber eine Idee. Poste ich wenn ich nachher am Rechner bin
-
Ne Globale Variable setzen und die dann abfragen ob true oder false. Bei false nen Hint mit "Es wird bereits ne Tanke uberfallen" und sonst Überfall durchziehen.
-
ja, soweit so gut ich will noch einen Timer bauen. Plan ist das man nur alle 10 min eine Tanke überfallen kann damit die Cops auch noch eine Chance haben den Verbrecher zu fangen.
-
Im Life Server die Variable dann alle 10min auf false setzen.
Also das wäre jetzt so der erste Einfall halt. Kann man sicher sauberer machen.
-
moment das könnte doch eventuell funktionieren
C: fn_robshops.sqf
Alles anzeigen//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 (community.bistudio.com/wiki/addAction). Give it a try and post below _action = [_this,2] call BIS_fnc_param;//Action name _timer = 300; if (servertime < life_nextrob) exitWith {hintSilent format ["You can not rob this station! Because there was a robbery already and all stations are warned! Please wait %1 seconds", (life_nextrob - servertime)] }; if(side _robber != civilian) exitWith { hintSilent "You can not rob this station!" }; if(_robber distance _shop > 5) exitWith { hintSilent "You need to be within 5m of the cashier to rob him!" }; if !(_kassa) then { _kassa = 1000; }; if (_rip) exitWith { hintSilent "Robbery already in progress!" }; if (vehicle player != _robber) exitWith { hintSilent "Get out of your vehicle!" }; if !(alive _robber) exitWith {}; if (currentWeapon _robber == "") exitWith { hintSilent "HaHa, you do not threaten me! Get out of here you hobo!" }; if (_kassa == 0) exitWith { hintSilent "There is no cash in the register!" }; _rip = true; _kassa = 10000 + round(random 10000); _shop removeAction _action; _shop switchMove "AmovPercMstpSsurWnonDnon"; _chance = random(100); if(_chance >= 1) then {[1,format["ALARM! - Gasstation: %1 is being robbed!", _shop]] remoteExec ["life_fnc_broadcast",west]; }; _cops = (west countSide playableUnits); if(_cops < 1) exitWith{[_vault,-1] remoteExec ["disableSerialization;",2]; hintSilent "There isnt enough Police to rob gas station!";}; disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["Robbery in Progress, stay close (10m) (1%1)...","%"]; _progress progressSetPosition 0.01; _cP = 0.01; if(_rip) then { life_nextrob = servertime + _timer; while{true} do { uiSleep 0.85; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["Robbery in Progress, stay close (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 "!ATTENTION! robbery !ATTENTION!"; "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 ""; hintSilent "You need to stay within 10m to Rob registry! - Now the registry is locked."; 5 cutText ["","PLAIN"]; _rip = false; }; 5 cutText ["","PLAIN"]; titleText[format["You have stolen $%1, now get away before the cops arrive!",[_kassa] call life_fnc_numberText],"PLAIN"]; deleteMarker "Marker200"; // by ehno delete maker life_cash = life_cash + _kassa; _rip = false; life_use_atm = false; uiSleep (30 + random(180)); life_use_atm = true; if!(alive _robber) exitWith {}; }; //uiSleep _timer; _action = _shop addAction["Rob the Gas Station",life_fnc_robShops]; _shop switchMove "";
guckt mal aber das könnte schon die lösung sein
Edit: natürlich muss die life_nextrob im life Server initialisiert werden.
-
moeck könnte, wird's aber net keine publicVariable :p
Code
Alles anzeigen//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 (community.bistudio.com/wiki/addAction). Give it a try and post below _action = [_this,2] call BIS_fnc_param;//Action name _timer = 300; // 5*60=300 == 5min if (servertime < life_nextrob) exitWith {hintSilent format ["You can not rob this station! Because there was a robbery already and all stations are warned! Please wait %1 seconds", (life_nextrob - servertime)] }; if(side _robber != civilian) exitWith { hintSilent "You can not rob this station!" }; if(_robber distance _shop > 5) exitWith { hintSilent "You need to be within 5m of the cashier to rob him!" }; if !(_kassa) then { _kassa = 1000; }; if (_rip) exitWith { hintSilent "Robbery already in progress!" }; if (vehicle player != _robber) exitWith { hintSilent "Get out of your vehicle!" }; if !(alive _robber) exitWith {}; if (currentWeapon _robber == "") exitWith { hintSilent "HaHa, you do not threaten me! Get out of here you hobo!" }; if (_kassa == 0) exitWith { hintSilent "There is no cash in the register!" }; _rip = true; _kassa = 10000 + round(random 10000); _shop removeAction _action; _shop switchMove "AmovPercMstpSsurWnonDnon"; _chance = random(100); if(_chance >= 1) then {[1,format["ALARM! - Gasstation: %1 is being robbed!", _shop]] remoteExec ["life_fnc_broadcast",west]; }; _cops = (west countSide playableUnits); if(_cops < 1) exitWith{[_vault,-1] remoteExec ["disableSerialization;",2]; hintSilent "There isnt enough Police to rob gas station!";}; disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["Robbery in Progress, stay close (10m) (1%1)...","%"]; _progress progressSetPosition 0.01; _cP = 0.01; if(_rip) then { life_nextrob = servertime + _timer; publicVariable "life_nextrob"; while{true} do { uiSleep 0.85; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["Robbery in Progress, stay close (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 "!ATTENTION! robbery !ATTENTION!"; "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 ""; hintSilent "You need to stay within 10m to Rob registry! - Now the registry is locked."; 5 cutText ["","PLAIN"]; _rip = false; }; 5 cutText ["","PLAIN"]; titleText[format["You have stolen $%1, now get away before the cops arrive!",[_kassa] call life_fnc_numberText],"PLAIN"]; deleteMarker "Marker200"; // by ehno delete maker life_cash = life_cash + _kassa; _rip = false; life_use_atm = false; uiSleep (30 + random(180)); life_use_atm = true; if!(alive _robber) exitWith {}; }; //uiSleep _timer; _action = _shop addAction["Rob the Gas Station",life_fnc_robShops]; _shop switchMove "";
sowie folgendes in die initServer.sqf:
Soll ja für alle gelten, also bitte per publicVariable :p
-
blackfisch na dann lag ich ja gar nicht soweit daneben, ok das mit der Public Variable hat gefehlt
und bei Start des Servers würde ich das auch eher so machen, damit man nicht gleich in den ersten 5 min das ding ausrauben kann.
-
blackfisch na dann lag ich ja gar nicht soweit daneben, ok das mit der Public Variable hat gefehlt
und bei Start des Servers würde ich das auch eher so machen, damit man nicht gleich in den ersten 5 min das ding ausrauben kann.
kann man machen, muss jeder für mich selbst wissen Für mich persönlich macht das generell keinen Sinn, weil warum sollte man nicht mehrere überfallen können? :p
-
wie gesagt das Trollpotenzial ist dabei extrem hoch und wir hatten das schon mal ohne drin und danach gab es ganz viel mimimi von den Cops
-
wie gesagt das Trollpotenzial ist dabei extrem hoch und wir hatten das schon mal ohne drin und danach gab es ganz viel mimimi von den Cops
Ich würde es anders machen. Wie wäre es mit abfrage wieviele Cops online sind. Dann Anzahl der Cops z.B. geteilt durch 3 ist die maximale Anzahl an Überfälle gleichzeitig oder so. Keine Cops, garnicht möglich, 3 Cops 1 Überfall möglich usw.
-
Bin zublöd dafür.. er fidet bei mir die rob.sqf aus irgend einen Grund nicht Logs können per wunsch kommen,
Ich denke aber das ich die sachen nicht richtig eingefügt haben und nicht ganz verstehe wie jetzt was kommst...
-
Bin zublöd dafür.. er fidet bei mir die rob.sqf aus irgend einen Grund nicht Logs können per wunsch kommen,
Ich denke aber das ich die sachen nicht richtig eingefügt haben und nicht ganz verstehe wie jetzt was kommst...
Logs troztdem mal bitte dankesschön
-
Hallo und zwar habe ich folgendes Problem: Ich habe diese Statusbar bei mir auf dem Server.
Wenn ich nun beginne die Tankstelle auszurauben bricht oben die Zeile ab da sich ja die Statusbar aktualisiert.
Die Tankstelle ist noch im "Wird ausgeraubt" Modus aber man sieht die Zeit nicht mehr wann man das Geld bekommt und es wird einem dann auch kein Geld mehr zugeschrieben. Wenn man sich entfernt bricht jedoch der Tankstellenraub ab... Jemand eine Idee Wie die Statusbar und das Script parallel laufen können?
-
Hallo und zwar habe ich folgendes Problem: Ich habe diese Statusbar bei mir auf dem Server.
Wenn ich nun beginne die Tankstelle auszurauben bricht oben die Zeile ab da sich ja die Statusbar aktualisiert.
Die Tankstelle ist noch im "Wird ausgeraubt" Modus aber man sieht die Zeit nicht mehr wann man das Geld bekommt und es wird einem dann auch kein Geld mehr zugeschrieben. Wenn man sich entfernt bricht jedoch der Tankstellenraub ab... Jemand eine Idee Wie die Statusbar und das Script parallel laufen können?
Sende mir bitte einmal die logs habe auch beide scripts drinne
-
Hier ich sende mal die Logs
-
Moin,
wie kommt man an den Namen von dem Shop?
_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 brokenbei mir kommt da was mir .pda in der Nachricht
-
Hier ich sende mal die Logs
1. Fehler:
Code
Alles anzeigen18:53:31 Error in expression <2 ]; 0 cutText ["","BLACK IN"]; [] call life_fnc_hudSetup; LIFE_ID_PlayerTags > 18:53:31 Error position: <life_fnc_hudSetup; LIFE_ID_PlayerTags > 18:53:31 Error Nicht definierte Variable in Ausdruck: life_fnc_hudsetup 18:53:31 File mpmissions\__CUR_MP.Altis\core\init.sqf, line 110
2. Fehler:
Code
Alles anzeigen18:53:31 Error in expression <2 ]; 0 cutText ["","BLACK IN"]; [] call life_fnc_hudSetup; LIFE_ID_PlayerTags > 18:53:31 Error position: <life_fnc_hudSetup; LIFE_ID_PlayerTags > 18:53:31 Error Nicht definierte Variable in Ausdruck: life_fnc_hudsetup 18:53:31 File mpmissions\__CUR_MP.Altis\core\init.sqf, line 110
3. Fehler:Code19:02:50 Error in expression <10m of the cashier to rob him!" }; if !(_kassa) then { _kassa = 1000; }; if (_ri> 19:02:50 Error position: <_kassa) then { _kassa = 1000; }; if (_ri> 19:02:50 Error Nicht definierte Variable in Ausdruck: _kassa 19:02:50 File core\functions\fn_robstore.sqf [life_fnc_robstore], line 14
-