willst du den Code für das "Zurückschießen des Tankstellenwärters" ?
[TUTORIAL] MrKraken's Tankstellenraub Script
-
- Altis Life
-
Exodoos -
17. September 2016 um 21:46
Hinweis zur Zukunft von Nodezone
Das neue Nodezone befindet sich in der finalen Entwicklungsphase. Mit dem geplanten Start wird das bisherige Forum auf Read Only umgestellt und künftig als Archiv erhalten bleiben.
Alle Informationen zur neuen Plattform, zur Accountübernahme und zum weiteren Ablauf findest du hier: Zum aktuellen Nodezone Beitrag
Das neue Nodezone befindet sich in der finalen Entwicklungsphase. Mit dem geplanten Start wird das bisherige Forum auf Read Only umgestellt und künftig als Archiv erhalten bleiben.
Alle Informationen zur neuen Plattform, zur Accountübernahme und zum weiteren Ablauf findest du hier: Zum aktuellen Nodezone Beitrag
-
-
brauche ich nicht, wir haben keine NPCs auf der Map und ich mache momentan eine pause vom SQF Scripten
-
Hey Habe eine kleine veränderung zu dem Skript, das man die Cop Anzahl die Online sein muss um die Tankestelle auszurauben über die Config_Master.hpp Verändern kann
Spoiler anzeigen
C: fn_robShops.sqf
Alles anzeigen#include "..\..\script_macros.hpp" private["_robber","_shop","_kassa","_ui","_progress","_pgText","_cP","_rip","_pos", "_robdelay", "_delay","_onWanted"]; _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 in [west, independent]) exitwith { //h/intSilent "Bei Dir hackts wohl, Du kannst doch nix überfallen! Oder seit wann arbeitest Du nicht beim Staat!" ["Bei Dir hackts wohl, Du kannst doch nix überfallen! Oder seit wann arbeitest Du nicht beim Staat!","RED",10] spawn life_fnc_notification_system; }; if (life_firstrob) exitWith { //h/int "Jo man es war gerade Weltuntergang und es ist noch kein Geld in der Kasse!" ["Jo man es war gerade Weltuntergang und es ist noch kein Geld in der Kasse!","RED",10] spawn life_fnc_notification_system; }; if (servertime < life_nextrob) exitWith { //h/intSilent format ["Es wurde gerade schon eine Tankstelle überfallen, komm in %1 Minuten wieder vorbei!", [(life_nextrob - servertime),"MM:SS"] call BIS_fnc_secondsToString] [format ["Es wurde gerade schon eine Tankstelle überfallen, komm in %1 Minuten wieder vorbei!", [(life_nextrob - servertime),"MM:SS"] call BIS_fnc_secondsToString],"RED",10] spawn life_fnc_notification_system; }; _robdelay = 900; // 900 Zeit die zwischen zwei Überfällen vergehen muss. if(side _robber != civilian) exitWith { //h/int "Du kannst hier niemanden Überfallen!" ["Du kannst hier niemanden Überfallen!","RED",10] spawn life_fnc_notification_system; }; if(_robber distance _shop > 5) exitWith { //h/int "Du musst 5m von dem Kassierer entfernt sein, um ihn auszurauben!" ["Du musst 5m von dem Kassierer entfernt sein, um ihn auszurauben!","RED",10] spawn life_fnc_notification_system; }; _ret=[[serverTime,0],"TON_fnc_robshops"] spawn life_fnc_MP; //if !(_kassa) then { _kassa = 1000; }; if (vehicle player != _robber) exitWith { //h/int "Steig aus deinem Fahrzeug!" ["Steig aus deinem Fahrzeug!","RED",10] spawn life_fnc_notification_system; }; if !(alive _robber) exitWith {}; if (currentWeapon _robber isEqualTo "") exitWith { //h/int "HaHa, willst du mich verarschen? Verzieh dich du Idiot!" ["HaHa, willst du mich verarschen? Verzieh dich du Idiot!","RED",10] spawn life_fnc_notification_system; }; ///////Cop Anzahl über die Config_Master Ändern///////////////////////////////////////////////////////////////////////// if (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"robshop_minimum_cops"))) exitWith { // hint format ["Es sind nicht genügend Polizeikräfte im Dienst!",(LIFE_SETTINGS(getNumber,"robshop_minimum_cops"))];// }; // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (_kassa isEqualTo 0) exitWith { //h/int "Es ist kein Geld in der Kasse!" ["Es ist kein Geld in der Kasse!","RED",10] spawn life_fnc_notification_system; }; _rip = true; _onWanted = false; _kassa = 150000 + round(random 150000); _shop removeAction _action; _chance = random(100); if (_chance >= 33 && _chance < 66) then { [[1,format["ALARM! - Tankstelle: %1 wird ausgeraubt!", _shop]],"life_fnc_broadcast",west,false] spawn life_fnc_MP; }; if(_chance >= 66) then { //h/int "Der Kassierer hat den stillen Alarm ausgelöst!"; ["Der Kassierer hat den stillen Alarm ausgelöst!","PINK",5] spawn life_fnc_notification_system; [[1,format["ALARM! - Tankstelle: %1 wird ausgeraubt!", _shop]],"life_fnc_broadcast",west,false] spawn life_fnc_MP; }; disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["Überfall im Gange, halte dich in der Nähe auf (10m) (1%1)...","%"]; _progress progressSetPosition 0.01; _cP = 0.01; if(_rip) then { life_nextrob = servertime + _robdelay; publicVariable "life_nextrob"; while{true} do { sleep 1.5; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["Überfall im Gange, halte dich in der Nähe auf (10m) (%1%2)...",round(_cP * 100),"%"]; _Pos = position player; // by ehno: get player pos if (_chance >= 66) then { _marker = createMarker ["Marker200", _Pos]; //by ehno: Place a Maker on the map "Marker200" setMarkerColor "ColorRed"; "Marker200" setMarkerText "!Achtung! Überfall !Achtung!"; "Marker200" setMarkerType "mil_warning"; }; if(_cP >= 1) exitWith {}; if(_robber distance _shop > 10.5) exitWith { deleteMarker "Marker200"; //h/int "Du musst in 10m Nähe bleiben um zu Überfallen! - Die Kasse ist nun verschlossen."; ["Du musst in 10m Nähe bleiben um zu Überfallen! - Die Kasse ist nun verschlossen.","RED",10] spawn life_fnc_notification_system; 5 cutText ["","PLAIN"]; _rip = false; }; if!(alive _robber) exitWith {deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"];}; if(life_istazed) exitWith {deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"];}; if(player getVariable ["Re-strained",FALSE]) exitWith { deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"];}; if (currentWeapon _robber isEqualTo "") exitWith { //h/int "Hier nen Snickers, du wirst immer zur Diva, wenn du hungrig bist!"; ["Hier nen Snickers, du wirst immer zur Diva, wenn du hungrig bist!","RED",10] spawn life_fnc_notification_system; deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"]; }; }; if!(alive _robber) exitWith { _rip = false; deleteMarker "Marker200"; 5 cutText ["","PLAIN"];}; if(life_istazed) exitWith {deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"];}; if(player getVariable ["Re-strained",FALSE]) exitWith { deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"];}; if (currentWeapon _robber isEqualTo "") exitWith {deleteMarker "Marker200"; _rip = false; 5 cutText ["","PLAIN"]; }; if(_robber distance _shop > 10.5) exitWith { deleteMarker "Marker200"; 5 cutText ["","PLAIN"]; _rip = false; }; 5 cutText ["","PLAIN"]; //t/itleText[format["Du hast $%1 gestohlen, flüchte bevor die Polizei eintrifft!",[_kassa] call life_fnc_numberText],"PLAIN"]; [format["Du hast $%1 gestohlen, flüchte bevor die Polizei eintrifft!",[_kassa] call life_fnc_numberText],"PINK",5] spawn life_fnc_notification_system; deleteMarker "Marker200"; // by ehno delete maker CASH = CASH + _kassa; _rip = false; _run = [] spawn { life_use_atm = false; uisleep (30 + random(180)); life_use_atm = true; }; }; if !(_onWanted) then { if!(_chance < 10) then { _chance = random 100; if(_chance < 40) then { [[getPlayerUID _robber,name _robber,"261A"],"life_fnc_wantedAdd",false,false] spawn life_fnc_MP; }; }; }; _action = _shop addAction["Ausrauben",life_fnc_robShops];In der Config_Master.hpp könnt hier z.b
Spoiler anzeigen
Also ist jetzt nicht Zwingend not wendig aber mann kann es machen.
-
Hey...
zwei sachen...
1. wo kann ich einstellen ab wann die selbe tanke nochmal ausgraubt werden kann..
2. Bei mir werden nicht alle texte angezeigt wie z.b. ("Du hast $%1 gestohlen, flüchte bevor die Polizei eintrifft!")
-
Zeile 19
_robdelay = 900; // 900 Zeit die zwischen zwei Überfällen vergehen muss.
-
2. Bei mir werden nicht alle texte angezeigt wie z.b. ("Du hast $%1 gestohlen, flüchte bevor die Polizei eintrifft!")
Dann hast du was falsch gemacht oder vertippt
-
Dann hast du was falsch gemacht oder vertippt
Wo stellen ich den überhaut ein das man eine nachnicht bekommt und die Polizei alarmiert wird
-
Die Polizei wird Alamiert wehre blöd wenn net
-
Hier von der Zeile 53-58
Spoiler anzeigen
Cif (_chance >= 33 && _chance < 66) then { [[1,format["ALARM! - Tankstelle: %1 wird ausgeraubt!", _shop]],"life_fnc_broadcast",west,false] spawn life_fnc_MP; }; if(_chance >= 66) then { //h/int "Der Kassierer hat den stillen Alarm ausgelöst!"; ["Der Kassierer hat den stillen Alarm ausgelöst!","PINK",5] spawn life_fnc_notification_system; [[1,format["ALARM! - Tankstelle: %1 wird ausgeraubt!", _shop]],"life_fnc_broadcast",west,false] spawn life_fnc_MP; }; -
Eine frage kann man machen das man zb ein Item wie Bohrer Benötigt das im z Inventar ist? und wie stelle ich das um?
-
zb
if(!([false,"wurstwasserglas",1] call life_fnc_handleInv)) exitWith bla bla blubb
-
Kuchenplatte So hab ich das wo muss ich jetzt denn Bohrer einfügen?
Code
Alles anzeigen/* Author : MrKraken edited for StateOfLife */ //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 if(side _robber != civilian) exitWith { hintSilent "Du kannst dieses Depot nicht ausrauben!" }; if(_robber distance _shop > 15) exitWith { hintSilent "Maximal 15 Meter entfernen!" }; if !(_kassa) then { _kassa = 1000; }; if (_rip) exitWith { hintSilent "Golddepot wird schon ausgeraubt!" }; if (vehicle player != _robber) exitWith { hintSilent "Raus aus dem Fahrzeug!" }; if !(alive _robber) exitWith {}; if (currentWeapon _robber == "") exitWith { hintSilent "Ich finde Pranks immer wieder schön..." }; if (_kassa == 0) exitWith { hintSilent "Heute gibt es hier nichts!" }; _rip = true; _kassa = 200000 + round(random 100000); _shop removeAction _action; _shop switchMove "AmovPercMstpSsurWnonDnon"; _chance = random(100); if(_chance >= 1) then {[1,hint parseText format["<img size='10' color='#FFFFFF' image='textures\info.paa'/><br/><br/>" + ("Das Altis Gelddepot wird angegriffen! Verteidigen Sie es bevor die Gangster das Geld haben!")]] remoteExec ["life_fnc_broadcast",west]; }; if(_chance >= 1) then {[1,hint parseText format["<img size='10' color='#FFFFFF' image='textures\info.paa'/><br/><br/>" + ("Das Altis Gelddepot wird angegriffen! Wir bitte Sie sich in einem Umkreis von 1 Kilometer zu entfernen ansonsten muss mit beschuss gerechnet werden. Wenn Sie Verteidigen, schreiben Sie einen Notruf an die Polizei! Ihre Altis Polizei")]] remoteExec ["life_fnc_broadcast",civilian]; }; _cops = (west countSide playableUnits); if(_cops < 0) exitWith{[_vault,-1] remoteExec ["disableSerialization;",2]; hintSilent "Die Polizei hat alle einnahmen abgeholt!";}; disableSerialization; 5 cutRsc ["life_progress","PLAIN"]; _ui = uiNameSpace getVariable "life_progress"; _progress = _ui displayCtrl 38201; _pgText = _ui displayCtrl 38202; _pgText ctrlSetText format["Raub gestartet! Bewege dich maximal 15 Meter weit weg! (1%1)...","%"]; _progress progressSetPosition 0.01; _cP = 0.01; if(_rip) then { while{true} do { uiSleep 6; _cP = _cP + 0.01; _progress progressSetPosition _cP; _pgText ctrlSetText format["Behalte eine Distanz von 15 Metern zum Tresor! (%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 "Sperrgebiet"; "Marker200" setMarkerType "mil_warning"; // "mil_warning" "Marker200" setMarkerShape "ELLIPSE"; //create sperrgebiet by brizi "Marker200" setMarkerSize [350, 350]; //create sperrgebiet by brizi if(_cP >= 1) exitWith {}; if(_robber distance _shop > 15.5) exitWith { }; if!(alive _robber) exitWith {}; }; if!(alive _robber) exitWith { _rip = false; }; if(_robber distance _shop > 15.5) exitWith { deleteMarker "Marker200"; _shop switchMove ""; hintSilent "Du warst zu weit weg vom Depot."; 5 cutText ["","PLAIN"]; _rip = false; }; 5 cutText ["","PLAIN"]; titleText[format["Du hast $%1 gestohlen, jetzt hau ab die Polizei ist unterwegs!!",[_kassa] call life_fnc_numberText],"PLAIN"]; deleteMarker "Marker200"; // by ehno delete maker deleteMarker "Marker900"; // by brizi delete sperrgebiet life_cash = life_cash + _kassa; [getPlayerUID _robber,name _robber,"23"] remoteExecCall ["life_fnc_wantedAdd",2]; _rip = false; life_use_atm = false; uiSleep (30 + random(180)); life_use_atm = true; if!(alive _robber) exitWith {}; }; uiSleep 300; _action = _shop addAction["Bank Ausrauben",life_fnc_robfederal]; _shop switchMove ""; -
Am besten wenn alle Bedingungen erfüllt worden sind also unter Zeile 16. (Das If-Statement muss nicht unbedingt dahin und kann auch wo anders sein)
Hier mal ein kleiner Ausschnitt aus der Datei
Codeif (_kassa == 0) exitWith { hintSilent "Heute gibt es hier nichts!" }; if(!([false,"ITEMNAME",1] call life_fnc_handleInv)) exitWith {hint "Du brauchst einen Bohrer";}; _rip = true;Item dann ggf. in der Config_vItems erstellen und dann durch "ITEMNAME" ersetzen.
-
Teste ich mal

-
-
und noch was. Ahm wie kann ich machen das mindestens 1 Cop da sein muss xD
-
-
stringtable eingefügt ?
-
Das mit dem Skript ist ja jetzt schon eine weile her aber dennoch die Frage: Kann mir jemand sagen was ich machen muss damit die Animation zum Hände Hoch nehmen nicht startet? (Ist in meiner Mission nämlich ohne NPC's)
-
Diese zwei Zeilen rausnehmen:
_shop switchMove "AmovPercMstpSsurWnonDnon";
_shop switchMove "";
-