Edit:
Hi nn ich habe im moment auf dem server das problem das sich meine bank türen nicht verschlissen
meine dateien
fn_blastingcharge.sqf
Code
#include "..\..\script_macros.hpp"
/*
File: fn_blastingCharge.sqf
Author: Bryan "Tonic" Boardwine
Description:
Blasting charge is used for the federal reserve vault and nothing more.. Yet.
*/
private["_vault","_handle"];
_vault = param [0,ObjNull,[ObjNull]];
if (isNull _vault) exitWith {}; //Bad object
if (typeOf _vault != "Land_CargoBox_V1_F") exitWith {hint localize "STR_ISTR_Blast_VaultOnly"};
if (_vault getVariable ["chargeplaced",false]) exitWith {hint localize "STR_ISTR_Blast_AlreadyPlaced"};
if (_vault getVariable ["safe_open",false]) exitWith {hint localize "STR_ISTR_Blast_AlreadyOpen"};
if (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops"))) exitWith {
hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))]
};
if ((nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"]) getVariable ["locked",true]) exitWith {hint localize "STR_ISTR_Blast_Exploit"};
if (!([false,"blastingcharge",1] call life_fnc_handleInv)) exitWith {}; //Error?
_vault setVariable ["chargeplaced",true,true];
[0,"STR_ISTR_Blast_Placed"] remoteExecCall ["life_fnc_broadcast",west];
hint localize "STR_ISTR_Blast_KeepOff";
_handle = [] spawn life_fnc_demoChargeTimer;
[] remoteExec ["life_fnc_demoChargeTimer",west];
waitUntil {scriptDone _handle};
sleep 0.9;
if (!(fed_bank getVariable["chargeplaced",false])) exitWith {hint localize "STR_ISTR_Blast_Disarmed"};
_bomb = "Bo_GBU12_LGB_MI10" createVehicle [getPosATL fed_bank select 0, getPosATL fed_bank select 1, (getPosATL fed_bank select 2)+0.5];
fed_bank setVariable ["chargeplaced",false,true];
fed_bank setVariable ["safe_open",true,true];
hint localize "STR_ISTR_Blast_Opened";
Alles anzeigen
fn_boltcutter.sqf
Code
#include "..\..\script_macros.hpp"
/*
File: fn_boltcutter.sqf
Author: Bryan "Tonic" Boardwine
Description:
Breaks the lock on a single door (Closet door to the player).
*/
private["_building","_door","_doors","_cpRate","_title","_progressBar","_titleText","_cp","_ui"];
_building = param [0,ObjNull,[ObjNull]];
if (isNull _building) exitWith {};
if (!(_building isKindOf "House_F")) exitWith {hint localize "STR_ISTR_Bolt_NotNear";};
if (((nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"]) == _building || (nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"]) == _building) && (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops")))) exitWith {
hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))]
};
if ((typeOf _building) == "Land_Offices_01_V1_F" && (nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"]) getVariable ["locked",true]) exitWith {hint localize "STR_ISTR_Bolt_Exploit"};
if (isNil "life_boltcutter_uses") then {life_boltcutter_uses = 0;};
_doors = FETCH_CONFIG2(getNumber,"CfgVehicles",(typeOf _building),"numberOfDoors");
_door = 0;
//Find the nearest door
for "_i" from 1 to _doors do {
_selPos = _building selectionPosition format["Door_%1_trigger",_i];
_worldSpace = _building modelToWorld _selPos;
if (player distance _worldSpace < 5) exitWith {_door = _i;};
};
if (_door isEqualTo 0) exitWith {hint localize "STR_Cop_NotaDoor"}; //Not near a door to be broken into.
if ((_building getVariable [format["bis_disabled_Door_%1",_door],0]) isEqualTo 0) exitWith {hint localize "STR_House_Raid_DoorUnlocked"};
if ((nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"]) == _building || (nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"]) == _building) then {
[[1,2],"STR_ISTR_Bolt_AlertFed",true,[]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
} else {
[0,"STR_ISTR_Bolt_AlertHouse",true,[profileName]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
};
life_action_inUse = true;
//Setup the progress bar
disableSerialization;
_title = localize "STR_ISTR_Bolt_Process";
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
_titleText ctrlSetText format["%2 (1%1)...","%",_title];
_progressBar progressSetPosition 0.01;
_cP = 0.01;
switch (typeOf _building) do {
case "Land_FuelSatation_01_shop_F": {_cpRate = 0.003;};
case "Land_Offices_01_V1_F": {_cpRate = 0.0015;};
default {_cpRate = 0.08;}
};
for "_i" from 0 to 1 step 0 do {
if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
[player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",RCLIENT];
player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
};
sleep 0.26;
if (isNull _ui) then {
5 cutRsc ["life_progress","PLAIN"];
_ui = uiNamespace getVariable "life_progress";
_progressBar = _ui displayCtrl 38201;
_titleText = _ui displayCtrl 38202;
};
_cP = _cP + _cpRate;
_progressBar progressSetPosition _cP;
_titleText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_title];
if (_cP >= 1 || !alive player) exitWith {};
if (life_istazed) exitWith {}; //Tazed
if (life_isknocked) exitWith {}; //Knocked
if (life_interrupted) exitWith {};
};
//Kill the UI display and check for various states
5 cutText ["","PLAIN"];
player playActionNow "stop";
if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
if (player getVariable["restrained",false]) exitWith {life_action_inUse = false;};
if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
life_boltcutter_uses = life_boltcutter_uses + 1;
life_action_inUse = false;
if (life_boltcutter_uses >= 5) then {
[false,"boltcutter",1] call life_fnc_handleInv;
life_boltcutter_uses = 0;
};
_building setVariable [format["bis_disabled_Door_%1",_door],0,true]; //Unlock the door.
_building setVariable["locked",false,true];
if (life_HC_isActive) then {
[getPlayerUID player,profileName,"459"] remoteExecCall ["HC_fnc_wantedAdd",HC_Life];
} else {
[getPlayerUID player,profileName,"459"] remoteExecCall ["life_fnc_wantedAdd",RSERV];
};
Alles anzeigen
Fn_actionKeyHandler.sqf
Code
Fn_actionKeyHandler.sqf
if (isNull _curObject) exitWith {
if (_isWater) then {
_fish = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_fish")),3]) select 0;
if (!isNil "_fish") then {
if (!alive _fish) then {
[_fish] call life_fnc_catchFish;
};
};
} else {
_animal = (nearestObjects[player,(LIFE_SETTINGS(getArray,"animaltypes_hunting")),3]) select 0;
if (!isNil "_animal") then {
if (!alive _animal) then {
[_animal] call life_fnc_gutAnimal;
};
} else {
private "_handle";
if (playerSide isEqualTo civilian && !life_action_gathering) then {
_whatIsIt = [] call life_fnc_whereAmI;
if (life_action_gathering) exitWith {}; //Action is in use, exit to prevent spamming.
switch (_whatIsIt) do {
case "mine" : { _handle = [] spawn life_fnc_mine };
default { _handle = [] spawn life_fnc_gather };
};
life_action_gathering = true;
waitUntil {scriptDone _handle};
life_action_gathering = false;
};
};
};
};
if ((_curObject isKindOf "B_supplyCrate_F" || _curObject isKindOf "Box_IND_Grenades_F") && {player distance _curObject < 3} ) exitWith {
if (alive _curObject) then {
[_curObject] call life_fnc_containerMenu;
};
};
if (_curObject isKindOf "House_F" && {player distance _curObject < 12} || ((nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"]) == _curObject || (nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"]) == _curObject)) exitWith {
[_curObject] call life_fnc_houseMenu;
};
if (dialog) exitWith {}; //Don't bother when a dialog is open.
if (vehicle player != player) exitWith {}; //He's in a vehicle, cancel!
life_action_inUse = true;
//Temp fail safe.
[] spawn {
sleep 60;
life_action_inUse = false;
};
Alles anzeigen
fn_houseMenu.sqf
Code
#include "..\..\script_macros.hpp"
/*
File: fn_houseMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Building interaction menu
*/
#define Btn1 37450
#define Btn2 37451
#define Btn3 37452
#define Btn4 37453
#define Btn5 37454
#define Btn6 37455
#define Btn7 37456
#define Btn8 37457
#define Title 37401
private["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8"];
disableSerialization;
_curTarget = param [0,ObjNull,[ObjNull]];
if (isNull _curTarget) exitWith {}; //Bad target
_houseCfg = [(typeOf _curTarget)] call life_fnc_houseConfig;
if (count _houseCfg isEqualTo 0 && playerSide isEqualTo civilian) exitWith {};
if (!dialog) then {
createDialog "pInteraction_Menu";
};
_Btn1 = CONTROL(37400,Btn1);
_Btn2 = CONTROL(37400,Btn2);
_Btn3 = CONTROL(37400,Btn3);
_Btn4 = CONTROL(37400,Btn4);
_Btn5 = CONTROL(37400,Btn5);
_Btn6 = CONTROL(37400,Btn6);
_Btn7 = CONTROL(37400,Btn7);
_Btn8 = CONTROL(37400,Btn8);
{_x ctrlShow false;} forEach [_Btn1,_Btn2,_Btn3,_Btn4,_Btn5,_Btn6,_Btn7,_Btn8];
life_pInact_curTarget = _curTarget;
if (_curTarget isKindOf "House_F" && playerSide isEqualTo west) exitWith {
if ((nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"]) == _curTarget || (nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"]) == _curTarget) then {
Alles anzeigen
life_server/init
Code
#include "script_macros.hpp"
/*
File: init.sqf
Author: Bryan "Tonic" Boardwine
Edit: Nanou for HeadlessClient optimization.
Please read support for more informations.
Description:
Initialize the server and required systems.
*/
private["_dome","_rsb","_timeStamp"];
DB_Async_Active = false;
DB_Async_ExtraLock = false;
life_server_isReady = false;
life_server_extDB_notLoaded = "";
serv_sv_use = [];
publicVariable "life_server_isReady";
life_save_civilian_position = if (LIFE_SETTINGS(getNumber,"save_civilian_position") isEqualTo 0) then {false} else {true};
fn_whoDoneit = compile preprocessFileLineNumbers "\life_server\Functions\Systems\fn_whoDoneit.sqf";
/*
Prepare the headless client.
*/
life_HC_isActive = false;
publicVariable "life_HC_isActive";
HC_Life = false;
publicVariable "HC_Life";
if (EXTDB_SETTING(getNumber,"HeadlessSupport") isEqualTo 1) then {
[] execVM "\life_server\initHC.sqf";
};
/*
Prepare extDB before starting the initialization process
for the server.
*/
if (isNil {uiNamespace getVariable "life_sql_id"}) then {
life_sql_id = round(random(9999));
CONSTVAR(life_sql_id);
uiNamespace setVariable ["life_sql_id",life_sql_id];
try {
_result = EXTDB format["9:ADD_DATABASE:%1",EXTDB_SETTING(getText,"DatabaseName")];
if (!(_result isEqualTo "[1]")) then {throw "extDB2: Error with Database Connection"};
_result = EXTDB format["9:ADD_DATABASE_PROTOCOL:%2:SQL_RAW_V2:%1:ADD_QUOTES",FETCH_CONST(life_sql_id),EXTDB_SETTING(getText,"DatabaseName")];
if (!(_result isEqualTo "[1]")) then {throw "extDB2: Error with Database Connection"};
} catch {
diag_log _exception;
life_server_extDB_notLoaded = [true, _exception];
};
publicVariable "life_server_extDB_notLoaded";
if (life_server_extDB_notLoaded isEqualType []) exitWith {};
EXTDB "9:LOCK";
diag_log "extDB2: Connected to Database";
} else {
life_sql_id = uiNamespace getVariable "life_sql_id";
CONSTVAR(life_sql_id);
diag_log "extDB2: Still Connected to Database";
};
if (life_server_extDB_notLoaded isEqualType []) exitWith {};
/* Run stored procedures for SQL side cleanup */
["CALL resetLifeVehicles",1] call DB_fnc_asyncCall;
["CALL deleteDeadVehicles",1] call DB_fnc_asyncCall;
["CALL deleteOldHouses",1] call DB_fnc_asyncCall;
["CALL deleteOldGangs",1] call DB_fnc_asyncCall;
_timeStamp = diag_tickTime;
diag_log "----------------------------------------------------------------------------------------------------";
diag_log "---------------------------------- Starting Altis Life Server Init ---------------------------------";
diag_log "------------------------------------------ Version 4.4r4 -------------------------------------------";
diag_log "----------------------------------------------------------------------------------------------------";
if (LIFE_SETTINGS(getNumber,"save_civilian_position_restart") isEqualTo 1) then {
[] spawn {
_query = "UPDATE players SET civ_alive = '0' WHERE civ_alive = '1'";
[_query,1] call DB_fnc_asyncCall;
};
};
/* Map-based server side initialization. */
master_group attachTo[bank_obj,[0,0,0]];
{
_hs = createVehicle ["Land_Hospital_main_F", [0,0,0], [], 0, "NONE"];
_hs setDir (markerDir _x);
_hs setPosATL (getMarkerPos _x);
_var = createVehicle ["Land_Hospital_side1_F", [0,0,0], [], 0, "NONE"];
_var attachTo [_hs, [4.69775,32.6045,-0.1125]];
detach _var;
_var = createVehicle ["Land_Hospital_side2_F", [0,0,0], [], 0, "NONE"];
_var attachTo [_hs, [-28.0336,-10.0317,0.0889387]];
detach _var;
} forEach ["hospital_2","hospital_3"];
{
if (!isPlayer _x) then {
_npc = _x;
{
if (_x != "") then {
_npc removeWeapon _x;
};
} forEach [primaryWeapon _npc,secondaryWeapon _npc,handgunWeapon _npc];
};
} forEach allUnits;
[8,true,12] execFSM "\life_server\FSM\timeModule.fsm";
life_adminLevel = 0;
life_medicLevel = 0;
life_copLevel = 0;
CONST(JxMxE_PublishVehicle,"false");
/* Setup radio channels for west/independent/civilian */
life_radio_west = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_civ = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
life_radio_indep = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];
/* Set the amount of gold in the federal reserve at mission start */
fed_bank setVariable ["safe",count playableUnits,true];
[] spawn TON_fnc_federalUpdate;
/* Event handler for disconnecting players */
addMissionEventHandler ["HandleDisconnect",{_this call TON_fnc_clientDisconnect; false;}];
[] call compile PreProcessFileLineNumbers "\life_server\functions.sqf";
/* Set OwnerID players for Headless Client */
TON_fnc_requestClientID =
{
(_this select 1) setVariable ["life_clientID", owner (_this select 1), true];
};
"life_fnc_RequestClientId" addPublicVariableEventHandler TON_fnc_requestClientID;
/* Event handler for logs */
"money_log" addPublicVariableEventHandler {diag_log (_this select 1)};
"advanced_log" addPublicVariableEventHandler {diag_log (_this select 1)};
/* Miscellaneous mission-required stuff */
life_wanted_list = [];
cleanupFSM = [] execFSM "\life_server\FSM\cleanup.fsm";
[] spawn TON_fnc_initHouses;
cleanup = [] spawn TON_fnc_cleanup;
TON_fnc_playtime_values = [];
TON_fnc_playtime_values_request = [];
//Just incase the Headless Client connects before anyone else
publicVariable "TON_fnc_playtime_values";
publicVariable "TON_fnc_playtime_values_request";
/* Setup the federal reserve building(s) */
_dome = nearestObject [[5887.8,8676.25,0.00143433],"Land_FuelSatation_01_shop_F"];
_rsb = nearestObject [[5887.8,8676.25,0.00143433],"Land_Offices_01_V1_F"];
for "_i" from 1 to 3 do {_dome setVariable[format["bis_disabled_Door_%1",_i],1,true]; _dome animate [format["Door_%1_rot",_i],0];};
_dome setVariable["locked",true,true];
_rsb setVariable["locked",true,true];
_rsb setVariable["bis_disabled_Door_1",1,true];
_dome allowDamage false;
_rsb allowDamage false;
/* Tell clients that the server is ready and is accepting queries */
life_server_isReady = true;
publicVariable "life_server_isReady";
/* Initialize hunting zone(s) */
aiSpawn = ["hunting_zone",30] spawn TON_fnc_huntingZone;
// We create the attachment point to be used for objects to attachTo load virtually in vehicles.
life_attachment_point = "Land_HelipadEmpty_F" createVehicle [0,0,0];
life_attachment_point setPosASL [0,0,0];
life_attachment_point setVectorDirAndUp [[0,1,0], [0,0,1]];
// Sharing the point of attachment with all players.
publicVariable "life_attachment_point";
life_cop_calls = [];
publicVariable "life_cop_calls";
life_med_calls = [];
publicVariable "life_med_calls";
diag_log "----------------------------------------------------------------------------------------------------";
diag_log format[" End of Altis Life Server Init :: Total Execution Time %1 seconds ",(diag_tickTime) - _timeStamp];
diag_log "----------------------------------------------------------------------------------------------------";
Alles anzeigen
Ich wollte es so machen das man erst durch haus x muss um zu haus y zu kommen wo den der tresor steht aber jetzt sind einfach keine türen abgeschlossen