Jump to content
Kuchenplatte

[Tutorial] Altis Life 5.0 | Insert Opfor Fraction | by Kuchenplatte

Recommended Posts

Cheers,

I came from Native-Network and want to share this Tutorial for ya. I ever read time by time that there is some trouble with inserting the 4th Fraction.
Well this Tutorial worked for 100%. If there will be a post with "...dont run at 5.0" or " Player sending Request UID to Server " then please repeat the steps or
stop your addiction to Crystal Meth. Well lets begin:

 

Script : Insert 4th Fraction of Altis Life
Version: Altis Life 5.0
Diffyculty : Harder then my Cock - Please look where you must insert the Codes.

 

Open your Config_Master.hpp and insert :

bank_adac = 3000; //Bank Opfor
paycheck_adac = 300; //Paycheck Opfor

 

Open your core/init.sqf and complete :

case east: { 
 life_paycheck = LIFE_SETTINGS(getNumber,"paycheck_adac"); 
 };
case east: { 
 //Initialize Adac and blah 
 _handle = [] spawn life_fnc_initAdac; 
 waitUntil {scriptDone _handle}; 
 };

 

Open /core/shops/fn_atmmenu.sqf

case east: {_type = "Adac"};

Open /core/session/fn_updaterequest.sqf

_flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};

Open /core/session/fn_requestreceived.sqf

case east: { 
 CONST(life_adacLevel,(_this select 7));
 CONST(life_coplevel,0); 
 if (LIFE_SETTINGS(getNumber,"save_playerStats") isEqualTo 1) then {
 life_hunger = ((_this select 9) select 0);
 life_thirst = ((_this select 9) select 1);
 }; 
 };

Open /core/session/fn_updatePartial.sqf

_flag = switch(playerSide) do {case west: {"cop"}; case civilian: {"civ"}; case independent: {"med"}; case east: {"adac"};};

Open /core/medical/fn_respawned.sqf

//Load gear for a 'new life'
case east: { 
 _handle = [] spawn life_fnc_adacLoadout; 
 }

Open your /Functions.hpp

Under Class Master Directory 

class initAdac {};

and complete the class with:

class Adac { 
 file = "core\adac"; 
 class adacLoadout {}; 
 class adacMarkers {}; 
 };

Open /dialog/function/fn_spawnpointcfg.sqf

case east: {"Adac"};

Open Config_Spawnpoints.hpp

class adac {
 class Kavala {
 displayName = "Adac HQ";
 spawnMarker = "adac_spawn_1";
 icon = "\a3\ui_f\data\map\MapControl\watertower_ca.paa";
 conditions = "";
 };

Open /core/pmenu/fn_p_updatemenu.sqf

_side = switch (playerSide) do {case west:{"cop"}; case civilian:{"civ"}; case independent:{"med"};case east:{"adac"};};

Open /core/functions/fn_playerskins.sqf

case east: {
 if (uniform player isEqualTo "U_Rangemaster") then {
 player setObjectTextureGlobal [0, "textures\medic_uniform.jpg"];
 };
 };

Open /Core/pmenu/fn_cellphone.sqf

case east: {"adac"};

Create a file named "fn_initadac.sqf" and place in in your core

#include "..\script_macros.hpp"
/*
 File: fn_initAdac.sqf
 Author: Bryan "Tonic" Boardwine
 Description:
 Initializes the adac..
*/
private["_end"];
player addRating 99999999;
waitUntil {!(isNull (findDisplay 46))};
//Hier wird geblacklisted
if ((FETCH_CONST(life_adacLevel)) < 1 && (FETCH_CONST(life_adminlevel) isEqualTo 0)) exitWith {
 ["Notwhitelisted",FALSE,TRUE] call BIS_fnc_endMission;
 sleep 35;
};
[] call life_fnc_spawnMenu;
waitUntil{!isNull (findDisplay 38500)}; //Wait for the spawn selection to be open.
waitUntil{isNull (findDisplay 38500)}; //Wait for the spawn selection to be done.

Create a path and folder like : /core/adac

Create a File named "fn_adacloadout.sqf"

#include "..\..\script_macros.hpp"
/*
 File: fn_adacLoadout.sqf
 Author: Bryan "Tonic" Boardwine
 Edited by: Kuchenplatte
 Description:
 Loads the medic out with the default gear.
*/
private ["_handle"];
_handle = [] spawn life_fnc_stripDownPlayer;
waitUntil {scriptDone _handle};
player addUniform "U_Rangemaster";
player addItem "FirstAidKit";
player addItem "Toolkit";
player linkItem "ItemMap";
player linkItem "ItemCompass";
player linkItem "ItemWatch";
[] call life_fnc_playerSkins;
[] call life_fnc_saveGear;

Create a file named "fn_adacmarkers.sqf"

/* 
 File: fn_adacMarkers.sqf 
 Author: - 
 Description: 
 Marks adac on the map for other adac. Only initializes when the actual map is open. 
*/ 
private["_markers","_adac"]; 
_markers = []; 
_adac = []; 
sleep 0.5; 
if(visibleMap) then { 
 {if(side _x == east) then {_adac pushBack _x;}} foreach playableUnits; //Fetch list of adac / opfor 
 //Create markers 
 { 
 if(_x != player) then { 
 _marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x]; 
 _marker setMarkerColorLocal "ColorOPFOR"; 
 _marker setMarkerTypeLocal "Mil_dot"; 
 _marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]]; 
 _markers pushBack [_marker,_x]; 
 }; 
 } foreach _adac; 
 while {visibleMap} do { 
 { 
 private["_marker","_unit"]; 
 _marker = _x select 0; 
 _unit = _x select 1; 
 if(!isNil "_unit" && !isNull _unit) then { 
 _marker setMarkerPosLocal (visiblePosition _unit); 
 }; 
 } foreach _markers; 
 if(!visibleMap) exitWith {}; 
 sleep 0.02; 
 }; 
 {deleteMarkerLocal (_x select 0);} foreach _markers; 
 _markers = []; 
 _adac = []; 
};

 

Whooop! This was the Mission Step...your balls are sweating? No? Okay letz go to @Life_Server

 

Open your Life_Server/init.sqf and complete the following:

life_adacLevel = 0;
life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "Side Channel", "%UNIT_NAME", []];

Open your "fn_insertRequest.sqf"

//Prepare the query statement..
_query = format ["INSERT INTO players (pid, name, cash, bankacc, aliases, cop_licenses, med_licenses, civ_licenses, civ_gear, cop_gear, med_gear, adac_gear, adac_licenses) VALUES('%1', '%2', '%3', '%4', '%5','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""','""[]""')",
 _uid,
 _name,
 _money,
 _bank,
 _alias
];

Open your "fn_queryRequest.sqf" and complete it with:

//East
 case east: {format["SELECT pid, name, cash, bankacc, adminlevel, donorlevel, adac_licenses, adaclevel, adac_gear, adac_stats, playtime FROM players WHERE pid='%1'",_uid];};
case east: {
 //Pa* * e Stats
 _new = [(_queryResult select 9)] call DB_fnc_mresToArray;
 if (_new isEqualType "") then {_new = call compile format["%1", _new];};
 _queryResult set[9,_new];
 
 //Playtime
 _new = [(_queryResult select 10)] call DB_fnc_mresToArray;
 if (_new isEqualType "") then {_new = call compile format["%1", _new];};
 _index = TON_fnc_playtime_values_request find [_uid, _new];
 if (_index != -1) then {
 TON_fnc_playtime_values_request set[_index,-1];
 TON_fnc_playtime_values_request = TON_fnc_playtime_values_request - [-1];
 TON_fnc_playtime_values_request pushBack [_uid, _new];
 } else {
 TON_fnc_playtime_values_request pushBack [_uid, _new];
 };
 [_uid,_new select 1] call TON_fnc_setPlayTime;
 };

Open your "fn_updateRequest.sqf" and complete it with :

case east: {_playtime_update set[1,_playtime];};
case east: {_query = format["UPDATE players SET name='%1', cash='%2', bankacc='%3', adac_licenses='%4', adac_gear='%5', adac_stats='%6', playtime='%7' WHERE pid='%8'",_name,_cash,_bank,_licenses,_gear,_stats,_playtime_update,_uid];};

Open your "fn_updatePartial.sqf" and complete it with :

case east: {_query = format["UPDATE players SET adac_licenses='%1' WHERE pid='%2'",_value,_uid];};
case east: {_query = format["UPDATE players SET adac_gear='%1' WHERE pid='%2'",_value,_uid];};

Open your "fn_getVehicles.sqf"

case east: {"adac"};

Open your "fn_vehiclecreate.sqf"

case east: {"adac"};

Open your "fn_spawn_vehicle.sqf"

if ((_vInfo select 1) isEqualTo "adac" && (_vInfo select 2) isEqualTo "C_Offroad_01_F") then {
 [_vehicle,"adac_offroad",true] remoteExecCall ["life_fnc_vehicleAnimate",_unit];
 
};

Wooohooo , i think we are done...eh..no wait..we need the part of mission.sqm :

 

Spawn : 

adac_spawn_1

 

Variable:

adac1

ADAC Whitelist 1

 

MYSQL

ALTER TABLE `players` ADD (`adac_licenses` TEXT NOT NULL); 
ALTER TABLE `players` ADD (`adac_gear` TEXT NOT NULL); 
ALTER TABLE `players` ADD (`adaclevel` enum('0','1','2','3','4','5') NOT NULL DEFAULT '0'); 
ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100]"');

 

Enjoy it!

Best Regards 

Kuchenplatte

Share this post


Link to post
Share on other sites

in fn_queryRequest.sqf it should be

[_uid,_new select 3] call TON_fnc_setPlayTime;

 

and in fn_updateRequest.sqf

case east: {_playtime_update set[3,_playtime];};

or it will count your playtime as adac to the playtime of the medics...

to make this work you will need to edit your db entries a bit

ALTER TABLE `players` MODIFY `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0,0]"';
UPDATE `players` SET `playtime` = replace(`playtime`, "]",",0]");

so the table gets a new layout with 4 entries instead of 3 and adds a ,0 to the existing entries

 

and last but not least your line

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100]"');

is also not complete

it misses the health part completely

change it to

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(32) NOT NULL DEFAULT '"[100,100,0]"');

 

Edited by Gagi2
  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Gagi2 said:

in fn_queryRequest.sqf it should be

[_uid,_new select 3] call TON_fnc_setPlayTime;

 

and in fn_updateRequest.sqf

case east: {_playtime_update set[3,_playtime];};

or it will count your playtime as adac to the playtime of the medics...

to make this work you will need to edit your db entries a bit

ALTER TABLE `players` MODIFY `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0,0]"';
UPDATE `players` SET `playtime` = replace(`playtime`, "]",",0]");

so the table gets a new layout with 4 entries instead of 3 and adds a ,0 to the existing entries

 

and last but not least your line

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100]"');

is also not complete

it misses the health part completely

change it to

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100,0]"');

 

https://gyazo.com/b114b3494f411c462387ff6fc40c726f

Share this post


Link to post
Share on other sites
11 hours ago, Gagi2 said:

in fn_queryRequest.sqf it should be

[_uid,_new select 3] call TON_fnc_setPlayTime;

 

and in fn_updateRequest.sqf

case east: {_playtime_update set[3,_playtime];};

or it will count your playtime as adac to the playtime of the medics...

to make this work you will need to edit your db entries a bit

ALTER TABLE `players` MODIFY `playtime` varchar(32) NOT NULL DEFAULT '"[0,0,0,0]"';
UPDATE `players` SET `playtime` = replace(`playtime`, "]",",0]");

so the table gets a new layout with 4 entries instead of 3 and adds a ,0 to the existing entries

 

and last but not least your line

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100]"');

is also not complete

it misses the health part completely

change it to

ALTER TABLE `players` ADD (`adac_stats` VARCHAR(11) NOT NULL DEFAULT '"[100,100,0]"');

 

Thanks man, works fine with 5.0 :)

Share this post


Link to post
Share on other sites
ALTER TABLE `players` ADD (`adac_stats` VARCHAR(32) NOT NULL DEFAULT '"[100,100,0]"');

should work...

11 is a bit too less ^^ and 32 is standard for the other stats too

Share this post


Link to post
Share on other sites

I would suggest anyone who adds this to their server to download Visual Studio Code for example and search your mission file for the following "case west" and then add a case east for the ones that doesn't have one. And also you should probably add CONST(life_adacLevel, 0); under case west, civilian and independent in fn_requestReceived and add CONST(life_medicLevel, 0); under case east. And the tutorial provided above is definitely not all you have to do for the faction to work perfectly.

Edited by Hyper4u
  • Like 1

Share this post


Link to post
Share on other sites
On 6/14/2018 at 8:30 PM, Hyper4u said:

I would suggest anyone who adds this to their server to download Visual Studio Code for example and search your mission file for the following "case west" and then add a case east for the ones that doesn't have one. And also you should probably add CONST(life_adacLevel, 0); under case west, civilian and independent in fn_requestReceived and add CONST(life_medicLevel, 0); under case east. And the tutorial provided above is definitely not all you have to do for the faction to work perfectly.

I think you mean adacLevel not medicLevel?

Share this post


Link to post
Share on other sites
1 hour ago, Deadlesszombie said:

I think you mean adacLevel not medicLevel?

No, adacLevel under case west, independent and civilian and medicLevel under case east

Share this post


Link to post
Share on other sites
1 hour ago, ToxicFFS said:

i get this error after i done everything -----------> Scripts core/fn_initadac.sqf not found 

here is my core Folder

core folder.png

i fixed this problem but now i have a new

Share this post


Link to post
Share on other sites

This is what i see in my log file on my server but i don't see where it is missing  a ;  please help

20:12:56 File life_server\init.sqf, line 141
20:12:56 Error in expression < Channel", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0,>
20:12:56   Error position: <_east = radioChannelCreate [[0,>
20:12:56   Error Missing ;

Share this post


Link to post
Share on other sites
5 minutes ago, ToxicFFS said:

This is what i see in my log file on my server but i don't see where it is missing  a ;  please help

20:12:56 File life_server\init.sqf, line 141
20:12:56 Error in expression < Channel", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0,>
20:12:56   Error position: <_east = radioChannelCreate [[0,>
20:12:56   Error Missing ;

Clearly says the problem right there

Share this post


Link to post
Share on other sites
9 minutes ago, ToxicFFS said:

This is what i see in my log file on my server but i don't see where it is missing  a ;  please help

20:12:56 File life_server\init.sqf, line 141
20:12:56 Error in expression < Channel", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0,>
20:12:56   Error position: <_east = radioChannelCreate [[0,>
20:12:56   Error Missing ;

pastebin the init file then.

Share this post


Link to post
Share on other sites
9 minutes ago, Hyper4u.'<3 said:

Clearly says the problem right there

here is the line and where is it missing a ;???

 

life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];                         (THIS LINE IS  139)

 

 

#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","_extDBNotLoaded"];
DB_Async_Active = false;
DB_Async_ExtraLock = false;
life_server_isReady = false;
_extDBNotLoaded = "";
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 "extDB3: Error with Database Connection"};
        _result = EXTDB format ["9:ADD_DATABASE_PROTOCOL:%2:SQL:%1:TEXT2",FETCH_CONST(life_sql_id),EXTDB_SETTING(getText,"DatabaseName")];
        if (!(_result isEqualTo "[1]")) then {throw "extDB3: Error with Database Connection"};
    } catch {
        diag_log _exception;
        _extDBNotLoaded = [true, _exception];
    };
    if (_extDBNotLoaded isEqualType []) exitWith {};
    EXTDB "9:LOCK";
    diag_log "extDB3: Connected to Database";
} else {
    life_sql_id = uiNamespace getVariable "life_sql_id";
    CONSTVAR(life_sql_id);
    diag_log "extDB3: Still Connected to Database";
};


if (_extDBNotLoaded isEqualType []) exitWith {
    life_server_extDB_notLoaded = true;
    publicVariable "life_server_extDB_notLoaded";
};
life_server_extDB_notLoaded = false;
publicVariable "life_server_extDB_notLoaded";

/* 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 5.0.0 -------------------------------------------";
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;
    if (worldName isEqualTo "Tanoa") then {
        if (_forEachIndex isEqualTo 0) then {
            atm_hospital_2 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            vendor_hospital_2 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            "medic_spawn_3" setMarkerPos (_var modelToWorld [8.01172,-5.47852,-8.20022]);
            "med_car_2" setMarkerPos (_var modelToWorld [8.01172,-5.47852,-8.20022]);
            hospital_assis_2 setPos (_hs modelToWorld [0.0175781,0.0234375,-0.231956]);
        } else {
            atm_hospital_3 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            vendor_hospital_3 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            "medic_spawn_1" setMarkerPos (_var modelToWorld [-1.85181,-6.07715,-8.24944]);
            "med_car_1" setMarkerPos (_var modelToWorld [5.9624,11.8799,-8.28493]);
            hospital_assis_2 setPos (_hs modelToWorld [0.0175781,0.0234375,-0.231956]);
        };
    };
} 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;
life_adacLevel = 0;
CONST(JxMxE_PublishVehicle,"false");

/* Setup radio channels for west/independent/civilian/opfor */
life_radio_west = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];                       <------------------------------- HERE
life_radio_civ = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];
life_radio_indep = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%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 {
    for "_i" from 0 to 1 step 0 do {
        uiSleep (30 * 60);
        {
            _x setVariable ["sellers",[],true];
        } forEach [Dealer_1,Dealer_2,Dealer_3];
    };
};

[] 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) */
private _vaultHouse = [[["Altis", "Land_Research_house_V1_F"], ["Tanoa", "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 _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;

_dome = nearestObject [_pos,"Land_Dome_Big_F"];
_rsb = nearestObject [_pos,_vaultHouse];

for "_i" from 1 to 3 do {_dome setVariable [format ["bis_disabled_Door_%1",_i],1,true]; _dome animateSource [format ["Door_%1_source", _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";

diag_log "----------------------------------------------------------------------------------------------------";
diag_log format ["               End of Altis Life Server Init :: Total Execution Time %1 seconds ",(diag_tickTime) - _timeStamp];
diag_log "----------------------------------------------------------------------------------------------------";

Edited by ToxicFFS

Share this post


Link to post
Share on other sites
20 hours ago, ToxicFFS said:

here is the line and where is it missing a ;???

 

life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];                         (THIS LINE IS  139)

 

 

#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","_extDBNotLoaded"];
DB_Async_Active = false;
DB_Async_ExtraLock = false;
life_server_isReady = false;
_extDBNotLoaded = "";
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 "extDB3: Error with Database Connection"};
        _result = EXTDB format ["9:ADD_DATABASE_PROTOCOL:%2:SQL:%1:TEXT2",FETCH_CONST(life_sql_id),EXTDB_SETTING(getText,"DatabaseName")];
        if (!(_result isEqualTo "[1]")) then {throw "extDB3: Error with Database Connection"};
    } catch {
        diag_log _exception;
        _extDBNotLoaded = [true, _exception];
    };
    if (_extDBNotLoaded isEqualType []) exitWith {};
    EXTDB "9:LOCK";
    diag_log "extDB3: Connected to Database";
} else {
    life_sql_id = uiNamespace getVariable "life_sql_id";
    CONSTVAR(life_sql_id);
    diag_log "extDB3: Still Connected to Database";
};


if (_extDBNotLoaded isEqualType []) exitWith {
    life_server_extDB_notLoaded = true;
    publicVariable "life_server_extDB_notLoaded";
};
life_server_extDB_notLoaded = false;
publicVariable "life_server_extDB_notLoaded";

/* 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 5.0.0 -------------------------------------------";
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;
    if (worldName isEqualTo "Tanoa") then {
        if (_forEachIndex isEqualTo 0) then {
            atm_hospital_2 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            vendor_hospital_2 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            "medic_spawn_3" setMarkerPos (_var modelToWorld [8.01172,-5.47852,-8.20022]);
            "med_car_2" setMarkerPos (_var modelToWorld [8.01172,-5.47852,-8.20022]);
            hospital_assis_2 setPos (_hs modelToWorld [0.0175781,0.0234375,-0.231956]);
        } else {
            atm_hospital_3 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            vendor_hospital_3 setPos (_var modelToWorld [4.48633,0.438477,-8.25683]);
            "medic_spawn_1" setMarkerPos (_var modelToWorld [-1.85181,-6.07715,-8.24944]);
            "med_car_1" setMarkerPos (_var modelToWorld [5.9624,11.8799,-8.28493]);
            hospital_assis_2 setPos (_hs modelToWorld [0.0175781,0.0234375,-0.231956]);
        };
    };
} 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;
life_adacLevel = 0;
CONST(JxMxE_PublishVehicle,"false");

/* Setup radio channels for west/independent/civilian/opfor */
life_radio_west = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];
life_radio_east = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];                       <------------------------------- HERE
life_radio_civ = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%UNIT_NAME", []];
life_radio_indep = radioChannelCreate [[0, 0.95, 1, 0.8], "OOC", "%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 {
    for "_i" from 0 to 1 step 0 do {
        uiSleep (30 * 60);
        {
            _x setVariable ["sellers",[],true];
        } forEach [Dealer_1,Dealer_2,Dealer_3];
    };
};

[] 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) */
private _vaultHouse = [[["Altis", "Land_Research_house_V1_F"], ["Tanoa", "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 _pos = [[["Altis", _altisArray], ["Tanoa", _tanoaArray]]] call TON_fnc_terrainSort;

_dome = nearestObject [_pos,"Land_Dome_Big_F"];
_rsb = nearestObject [_pos,_vaultHouse];

for "_i" from 1 to 3 do {_dome setVariable [format ["bis_disabled_Door_%1",_i],1,true]; _dome animateSource [format ["Door_%1_source", _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";

diag_log "----------------------------------------------------------------------------------------------------";
diag_log format ["               End of Altis Life Server Init :: Total Execution Time %1 seconds ",(diag_tickTime) - _timeStamp];
diag_log "----------------------------------------------------------------------------------------------------";

pastebin the code and files or your post will be deleted

Share this post


Link to post
Share on other sites
20 ชั่วโมงที่ผ่านมา imthatguyhere กล่าวว่า:

ต้องการเซิร์ฟเวอร์ RPT ด้วย ดูเหมือนแถบสถานะหรือ config เสียจากฝั่งไคลเอ็นต์

19:02:08 InitSound ...
19:02:08 InitSound - complete
19:02:08 PhysX3 SDK Init started ...
19:02:08 PhysX3 SDK Init ended.
19:02:16 Error in expression <nk = [_bank] call DB_fnc_numberSafe;


_query = format ["INSERT INTO players >
19:02:16   Error position: <query = format ["INSERT INTO players >
19:02:16   Error Missing ;
19:02:16 File \life_server\Functions\MySQL\fn_insertRequest.sqf [DB_fnc_insertRequest], line 106
19:02:16 Error in expression <nk = [_bank] call DB_fnc_numberSafe;


_query = format ["INSERT INTO players >
19:02:16   Error position: <query = format ["INSERT INTO players >
19:02:16   Error Missing ;
19:02:16 File \life_server\Functions\MySQL\fn_insertRequest.sqf [DB_fnc_insertRequest], line 106
 19:02:20 [CBA] (settings) INFO: Userconfig: Ignored.
19:02:21 [XEH]: A3L_POLB does not support Extended Event Handlers! Addon: @Tara3LifeRP
19:02:21 [XEH]: PD_black_FLIR_mh9 does not support Extended Event Handlers! Addon: @Tara3LifeRP
19:02:21 [XEH]: PD_sheriff_FLIR_mh9 does not support Extended Event Handlers! Addon: @Tara3LifeRP

20181030090534_1.jpg

Edited by warutsansuk112

Share this post


Link to post
Share on other sites
14 hours ago, warutsansuk112 said:

_query = format ["INSERT INTO players >
19:02:16   Error position: <query = format ["INSERT INTO players >
19:02:16   Error Missing ;
19:02:16 File \life_server\Functions\MySQL\fn_insertRequest.sqf [DB_fnc_insertRequest], line 106

Pastebin your "life_server\Functions\MySQL\fn_insertRequest.sqf".

 

EDIT:

You opened your own thread and I answered you there:

 

Edited by imthatguyhere

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...