Wenn jemand mal über das System darüberschauen kann wäre super
Hier sind noch neue Fehler wo ich leider nicht mehr weiter weiß
Code
17:20:09 Error in expression <t localize "STR_ISTR_Box_NotinHouse"};
if(_house getVariable["Secured",false]) >
17:20:09 Error position: <if(_house getVariable["Secured",false]) >
17:20:09 Error if: Typ Zahl, erwartet Bool
17:20:09 File core\housing\fn_houseAlarm.sqf [life_fnc_houseAlarm], line 71
17:20:25 Error in expression <alize "STR_House_Raid_DoorUnlocked"};
if(_building getVariable["Secured",false>
17:20:25 Error position: <if(_building getVariable["Secured",false>
17:20:25 Error if: Typ Zahl, erwartet Bool
17:20:25 File core\items\fn_boltcutter.sqf [life_fnc_boltcutter], line 95
17:20:30 Generating ST on the fly is very slow
Alles anzeigen
Ich schicke jetzt mal alle Dateien die bearbeitet habe.
Code
#include "..\..\script_macros.hpp"
/*
----------------------------------------------|
Author: Backer
Edit by AmaZiinG
Description: Place the Security System in a House!
----------------------------------------------|
*/
private["_house","_uid","_housePos","_houseName"];
_house = nearestBuilding (getPosATL player);
_uid = getPlayerUID player;
_housePos = getPos _house;
_houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
if(!(_house in life_vehicles)) exitWith {hint localize "STR_ISTR_Box_NotinHouse"};
if(_house getVariable["Secured",false]) exitWith {hint "Das Haus ist bereits Gesichert";};
if(([false,"housealarm",1] call life_fnc_handleInv)) then {
_house setVariable["Secured",true,true];
hint "Sicherheitssystem installiert und aktiviert";
closeDialog 0;
[_uid,_house] remoteExec ["TON_fnc_houseAlarm",2];
deleteMarkerLocal format["house_%1",(_house getVariable "uid")];
_marker = createMarkerLocal [format["house_%1",(_house getVariable "uid")],_housePos];
_marker setMarkerTextLocal format["%1 [alarmgesichert]",_houseName];
_marker setMarkerColorLocal "ColorBlue";
_marker setMarkerTypeLocal "loc_Lighthouse"
};
Alles anzeigen
Code
#include "..\..\script_macros.hpp"
/*
----------------------------------------------|
Author: Backer
Description: Turn off the Housealarm and delete the Marker
----------------------------------------------|
*/
private["_building"];
_building = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
_building setVariable["HouseRob",false,true];
deleteMarkerLocal "HouseMarker";
Alles anzeigen
Code
/*
File: fn_initHouses.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initializes the players houses, mainly throwing down markers.
*/
if (life_houses isEqualTo []) exitWith {}; //Nothing to do.
{
_position = call compile format ["%1",_x select 0];
_house = nearestObject [_position, "House"];
_house setVariable ["uid",round(random 99999),true];
_houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
_marker = createMarkerLocal [format ["house_%1",(_house getVariable "uid")],_position];
if(_house getVariable["Secured",false]) then {
_marker setMarkerTextLocal format["%1 [alarmgesichert]",_houseName];
} else {
_marker setMarkerTextLocal _houseName;
};
_marker setMarkerColorLocal "ColorBlue";
_marker setMarkerTypeLocal "loc_Lighthouse";
} forEach life_houses;
Alles anzeigen
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]];
private _vaultHouse = [[["Altis", "Land_Research_house_V1_F"], ["Tanoa", "Land_Medevac_house_V1_F"], ["Jackson_County", "Land_Medevac_house_V1_F"]]] call TON_fnc_terrainSort;
private _altisArray = [16019.5,16952.9,0];
private _tanoaArray = [11074.2,11501.5,0.00137329];
private _Jackson_CountyArray = [11074.2,11501.5,0.00137329];
private _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray], ["Jackson_County", _Jackson_CountyArray]]] call TON_fnc_terrainSort;
if (isNull _building) exitWith {};
if (!(_building isKindOf "House_F")) exitWith {hint localize "STR_ISTR_Bolt_NotNear";};
if(isNil {(_building getVariable "house_owner")}) exitWith {hint "Der Besitzer ist gerade nicht auf der Insel"}; //Eigentümer nicht Online
private _uid = call compile format["%1",(_building getVariable "house_owner")]; // Setzen der Variable _uid
if (((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _building) && (west countSide playableUnits < (LIFE_SETTINGS(getNumber,"minimum_cops")))) exitWith {
hint format [localize "STR_Civ_NotEnoughCops",(LIFE_SETTINGS(getNumber,"minimum_cops"))];
};
if ((typeOf _building) == _vaultHouse && (nearestObject [_pos,"Land_Dome_Big_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 < 2) 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"};
//Alarm System
if(_building getVariable["Secured",false]) then {
if(!(_building getVariable["HouseRob",false])) then {
_house = getPos _building;
[_house,name player,1] remoteExec ["TON_fnc_clientMessage",_uid];
_building setVariable["HouseRob",true,true];
};
};
if ((nearestObject [_pos,"Land_Dome_Big_F"]) == _building || (nearestObject [_pos,_vaultHouse]) == _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";
"progressBar" 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_Dome_Big_F": {_cpRate = 0.003;};
case "Land_Medevac_house_V1_F";
case "Land_Research_house_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 {
"progressBar" 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
"progressBar" 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
Life_Server:
Code
#include "\life_server\script_macros.hpp"
/*
File: fn_addHouse.sqf
Author: Bryan "Tonic" Boardwine
Description:
Inserts the players newly bought house in the database.
*/
private ["_housePos","_query"];
params [
["_uid","",[""]],
["_house",objNull,[objNull]]
];
if (isNull _house || _uid isEqualTo "") exitWith {};
_housePos = getPosATL _house;
_query = format ["INSERT INTO houses (pid, pos, owned, security) VALUES('%1', '%2', '1')",_uid,_housePos];
if (EXTDB_SETTING(getNumber,"DebugMode") isEqualTo 1) then {
diag_log format ["Query: %1",_query];
};
[_query,1] call DB_fnc_asyncCall;
if (typeOf _house == "Land_FuelStation_Build_F") then {
_nextBat = nearestObject [_house, "HeliH"];
_query = format ["UPDATE fuel_stations SET owner='%2', fuel_super ='27',fuel_benzin='22',fiel_diesel='17', tank ='10000' ,money ='0'
WHERE batterie='%1'",_nextBat,_uid];
};
_query = format ["SELECT id FROM houses WHERE pos='%1' AND pid='%2' AND owned='1'",_housePos,_uid];
_queryResult = [_query,2] call DB_fnc_asyncCall;
//systemChat format ["House ID assigned: %1",_queryResult select 0];
_house setVariable ["house_id",(_queryResult select 0),true];
_house setVariable["Secured",false,true];
Alles anzeigen
Code
#include "\life_server\script_macros.hpp"
/*
File : fn_fetchPlayerHouses.sqf
Author: Bryan "Tonic" Boardwine
Modified : NiiRoZz
Description:
1. Fetches all the players houses and sets them up.
2. Fetches all the players containers and sets them up.
*/
private ["_query","_containers","_containerss","_houses","_furnituress"];
params [
["_uid","",[""]]
];
if (_uid isEqualTo "") exitWith {};
_query = format ["SELECT pid, pos, classname, inventory, gear, dir, id, security FROM containers WHERE pid='%1' AND owned='1'",_uid];
_containers = [_query,2,true] call DB_fnc_asyncCall;
_containerss = [];
_furnituress = [];
{
_position = call compile format ["%1",_x select 1];
_house = nearestObject [_position, "House"];
_direction = call compile format ["%1",_x select 5];
_trunk = [_x select 3] call DB_fnc_mresToArray;
if (_trunk isEqualType "") then {_trunk = call compile format ["%1", _trunk];};
_gear = [_x select 4] call DB_fnc_mresToArray;
if (_gear isEqualType "") then {_gear = call compile format ["%1", _gear];};
//furniture and container split
_className = _x select 2;
_type = getText(missionConfigFile >> "CfgDonkeyPunchCustoms" >> _className);
_isFurniture = getNumber(missionConfigFile >> "VirtualItems" >> _type >> "furniture") isEqualTo 1;
_container = createVehicle[_x select 2,[0,0,999],[],0,"NONE"];
waitUntil {!isNil "_container" && {!isNull _container}};
if!(_isFurniture)then{
_containerss pushBack _container;
}else{
_furnituress pushBack _container;
_container enableSimulationGlobal false;
};
_container allowDamage false;
_container setPosATL _position;
_container setVectorDirAndUp _direction;
//Fix position for more accurate positioning
_posX = _position select 0;
_posY = _position select 1;
_posZ = _position select 2;
_currentPos = getPosATL _container;
_fixX = (_currentPos select 0) - _posX;
_fixY = (_currentPos select 1) - _posY;
_fixZ = (_currentPos select 2) - _posZ;
_container setPosATL [(_posX - _fixX), (_posY - _fixY), (_posZ - _fixZ)];
_container setVectorDirAndUp _direction;
_container setVariable ["Trunk",_trunk,true];
_container setVariable ["container_owner",[_x select 0],true];
_container setVariable ["container_id",_x select 6,true];
clearWeaponCargoGlobal _container;
clearItemCargoGlobal _container;
clearMagazineCargoGlobal _container;
clearBackpackCargoGlobal _container;
if (count _gear > 0) then {
_items = _gear select 0;
_mags = _gear select 1;
_weapons = _gear select 2;
_backpacks = _gear select 3;
for "_i" from 0 to ((count (_items select 0)) - 1) do {
_container addItemCargoGlobal [((_items select 0) select _i), ((_items select 1) select _i)];
};
for "_i" from 0 to ((count (_mags select 0)) - 1) do{
_container addMagazineCargoGlobal [((_mags select 0) select _i), ((_mags select 1) select _i)];
};
for "_i" from 0 to ((count (_weapons select 0)) - 1) do{
_container addWeaponCargoGlobal [((_weapons select 0) select _i), ((_weapons select 1) select _i)];
};
for "_i" from 0 to ((count (_backpacks select 0)) - 1) do{
_container addBackpackCargoGlobal [((_backpacks select 0) select _i), ((_backpacks select 1) select _i)];
};
};
_house setVariable ["containers",_containerss,true];
_house setVariable["Secured",_x select 4,true];
} forEach _containers;
_query = format ["SELECT pid, pos FROM houses WHERE pid='%1' AND owned='1'",_uid];
_houses = [_query,2,true] call DB_fnc_asyncCall;
_return = [];
{
_pos = call compile format ["%1",_x select 1];
_house = nearestObject [_pos, "House"];
_house allowDamage false;
_return pushBack [_x select 1,_containerss];
} forEach _houses;
missionNamespace setVariable [format ["houses_%1",_uid],_return];
Alles anzeigen
Code
#include "\life_server\script_macros.hpp"
/*
File: fn_housealarm.sqf
Edit by AmaZiinG
Description:
Updated die Datenbank
*/
private["_house","_uid","_query","_housePos"];
_uid = [_this,0,"",[""]] call BIS_fnc_param;
_house = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_param;
if(isNull _house OR _uid == "") exitWith {hint "Problem bei Update"};
_housePos = getPosATL _house;
_query = format["UPDATE houses SET security='true' WHERE pid='%1' AND pos='%2' AND owned='1'",_uid,_housePos];
diag_log format["HouseAlarm: %1",_query];
[_query,1] call DB_fnc_asyncCall;
Alles anzeigen
Code
/*
File: fn_houseCleanup.sqf
Author: NiiRoZz
Description:
Cleans up containers inside in house of player.
*/
private ["_query","_containers","_container"];
_query = format ["SELECT pid, pos FROM containers WHERE pid='%1' AND owned='1'",_this];
_containers = [_query,2,true] call DB_fnc_asyncCall;
if (count _containers isEqualTo 0) exitWith {};
{
_pos = call compile format ["%1",_x select 1];
_lifeContainers = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "LifeContainers");
_lifeFurniture = getArray(missionConfigFile >> "CfgDonkeyPunchCustoms" >> "BuildableFurniture");
_lifeContainers = _lifeContainers + _lifeFurniture;
{
deleteVehicle _x;
_house setVariable["Secured",nil,true]; //Ka wo das ihn soll
} forEach _container;
} forEach _containers;
Alles anzeigen
Code
/*
File: fn_initHouses.sqf
Author: Bryan "Tonic" Boardwine
Description:
Initalizes house setup when player joins the server.
*/
private ["_queryResult","_query","_count","_blacklistedHouses","_blacklistedGarages"];
_count = (["SELECT COUNT(*) FROM houses WHERE owned='1'",2] call DB_fnc_asyncCall) select 0;
for [{_x=0},{_x<=_count},{_x=_x+10}] do {
_query = format ["SELECT houses.id, houses.pid, houses.pos, players.name, houses.garage FROM houses INNER JOIN players WHERE houses.owned='1' AND houses.pid = players.pid LIMIT %1,10",_x];
_queryResult = [_query,2,true] call DB_fnc_asyncCall;
if (count _queryResult isEqualTo 0) exitWith {};
{
_pos = call compile format ["%1",_x select 2];
_house = nearestObject [_pos, "House"];
_house setVariable ["house_owner",[_x select 1,_x select 3],true];
_house setVariable ["house_id",_x select 0,true];
_house setVariable["Secured",_x select 4,true];
_house setVariable ["locked",true,true]; //Lock up all the stuff.
if (_x select 4 isEqualTo 1) then {
_house setVariable ["garageBought",true,true];
};
_numOfDoors = getNumber(configFile >> "CfgVehicles" >> (typeOf _house) >> "numberOfDoors");
for "_i" from 1 to _numOfDoors do {
_house setVariable [format ["bis_disabled_Door_%1",_i],1,true];
};
} forEach _queryResult;
};
_blacklistedHouses = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Housing" >> worldName);
_blacklistedGarages = "count (getArray (_x >> 'garageBlacklists')) > 0" configClasses (missionconfigFile >> "Garages" >> worldName);
_blacklistedHouses = _blacklistedHouses apply {configName _x};
_blacklistedGarages = _blacklistedGarages apply {configName _x};
for "_i" from 0 to count(_blacklistedHouses)-1 do {
_className = _blacklistedHouses select _i;
_positions = getArray(missionConfigFile >> "Housing" >> worldName >> _className >> "garageBlacklists");
{
_obj = nearestObject [_x,_className];
if (isNull _obj) then {
_obj setVariable ["blacklistedGarage",true,true];
};
} forEach _positions;
};
for "_i" from 0 to count(_blacklistedGarages)-1 do {
_className = _blacklistedGarages select _i;
_positions = getArray(missionConfigFile >> "Garages" >> worldName >> _className >> "garageBlacklists");
{
_obj = nearestObject [_x,_className];
if (isNull _obj) then {
_obj setVariable ["blacklistedGarage",true,true];
};
} forEach _positions;
};
Alles anzeigen