Oder nimm mein überarbeitetes Script ich brauchs ja nicht mehr...
C
/*
Author: ? edited by Joe Barbaro
Description: Tankstellenraub Script
*/
#include "..\..\script_macros.hpp"
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
private _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
private _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
private _action = [_this,2] call BIS_fnc_param;//Action name
private _kassa = 10000 + round(random 10000); //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
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
if(side _robber != civilian) exitWith { hintSilent "Ich melde dich lieber deinem Vorgesetzten" };
if(_robber distance _shop > 5) exitWith { hintSilent "Was willst du denn den aus nem Kilometer bedrohen?" };
if (vehicle player != _robber) exitWith { hintSilent "Was solln das werden Drive-by?" };
if !(alive _robber) exitWith {};
if (currentWeapon _robber == "") exitWith { hintSilent "Was willst du pisser von mir hau ab!" };
if (_kassa == 0) exitWith {hintSilent "Kein Geld keine Beute!"};
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
_rip = true;
_shop removeAction _action;
[_shop,"AmovPercMstpSsurWnonDnon",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
_chance = random(100);
_cops = (west countSide playableUnits);
if(_cops < 1) exitWith {hintSilent "Ohne Polizei macht so ein Überfall doch keinen Spaß :D";};
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
disableSerialization;
250 cutRsc ["life_progress","PLAIN"];
_ui = uiNameSpace getVariable "life_progress";
_progress = _ui displayCtrl 38201;
_pgText = _ui displayCtrl 38202;
_pgText ctrlSetText format["Raub im gange... Behalt den Kassierer im Griff (%1%1)...","%"];
_progress progressSetPosition 0.01;
_cP = 0.01;
if(_rip) then
{
while{true} do
{
uiSleep 0.85;
_cP = _cP + 0.01;
_progress progressSetPosition _cP;
_pgText ctrlSetText format["Raub im gange... Behalt den Kassierer im Griff (%1%2)...",round(_cP * 100),"%"];
_Pos = position player; // by ehno: get player pos
{
_marker = createMarkerlocal ["TankeMarker", _Pos]; //by ehno: Place a Maker on the map
"TankeMarker" setMarkerColorlocal "ColorRed";
"TankeMarker" setMarkerTextlocal "!ATTENTION! robbery !ATTENTION!";
"TankeMarker" setMarkerTypelocal "mil_warning";
} forEach [playerside isEqualTo west];
if(_cP >= 1) exitWith {};
if(_robber distance _shop > 5) exitWith { };
if!(alive _robber) exitWith {};
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
};
if(_robber getVariable "restrained") exitWith {_rip = false; hint "Tja festgenomen scheiße gelaufen..."; 250 cutText ["","PLAIN"];}; //Player got arrested, or restrained by another player!
if(life_istazed) exitWith {_rip = false; hint "Du wurdest getazert RIP!"; 250 cutText ["","PLAIN"];}; //Player was tazed
if!(alive _robber) exitWith {_rip = false; 250 cutText ["","PLAIN"];};
if(_robber distance _shop > 5) exitWith {
deleteMarker "TankeMarker";
[_shop,"",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
hintSilent "Du hast den Kassierer nicht im Auge gehabt";
250 cutText ["","PLAIN"];
_rip = false;
};
250 cutText ["","PLAIN"];
titleText[format["Du hast $%1, geklaut! Hau ab bevor die Cops kommen!",[_kassa] call life_fnc_numberText],"PLAIN"];
deleteMarker "TankeMarker"; // 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 300;
_action = _shop addAction["Tankstelle ausrauben!",life_fnc_robTanke];
[_shop,"",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
Alles anzeigen
Mit freundlichen Grüßen
Joe Barbaro