Sign in to follow this  
Followers 0
WURSTKETTE

New Column in account

1 post in this topic

Edit: Guess i found the error, it was a missing , in exile.ini

Hey there, 

i'm trying to fiddle around with creating a global var, called "ExileAdmin" linked to a new column (admin, type  INT) within the account table.

I later want to use something like that in my scripts, 

_playerAdmin = player getVariable ["ExileAdmin",0];
    if (_playerAdmin == 1)  then 

 

What i have done so far:

Created the new column called admin within account table, dataype INT.

Added a new setvariable into ExileServer_object_player_database_load.sqf:

_player setVariable ["ExileAdmin", (_data select 47), true];
Spoiler

/**
 * ExileServer_object_player_database_load
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_data", "_oldPlayerObject", "_playerUID", "_sessionID", "_position", "_direction", "_player", "_clanID", "_clanName", "_clanData", "_clanGroup", "_devFriendlyMode", "_devs", "_headgear", "_goggles", "_binocular", "_primaryWeapon", "_handgunWeapon", "_secondaryWeapon", "_currentWeapon", "_uniform", "_vest", "_backpack", "_uniformContainer", "_vestContainer", "_backpackContainer", "_assignedItems"];
_data = _this select 0;
_oldPlayerObject = _this select 1;
_playerUID = _this select 2;
_sessionID = _this select 3;
_name = name _oldPlayerObject;
_position = [_data select 11, _data select 12, _data select 13];
_direction = _data select 10;
_player = (createGroup independent) createUnit ["Exile_Unit_Player", _position, [], 0, "CAN_COLLIDE"];
_player setDir _direction;
_player setPosATL _position;
_player disableAI "FSM";
_player disableAI "MOVE";
_player disableAI "AUTOTARGET";
_player disableAI "TARGET";
_player disableAI "CHECKVISIBLE";
_clanID = (_data select 42);
_clanName = (_data select 43);
if !((typeName _clanID) isEqualTo "SCALAR") then
{
    _clanID = -1;
    _clanData = [];
}
else
{
    _clanData = missionnamespace getVariable [format ["ExileServer_clan_%1",_clanID],[]];
    if(isNull (_clanData select 5))then
    {
        _clanGroup = createGroup independent;
        _clanData set [5,_clanGroup];
        _clanGroup setGroupIdGlobal [_clanData select 0];
        missionNameSpace setVariable [format ["ExileServer_clan_%1",_clanID],_clanData];
    }
    else
    {
        _clanGroup = (_clanData select 5);
    };
    [_player] joinSilent _clanGroup;
};
_player setDamage (_data select 3);
_player setName _name;
_player setVariable ["ExileMoney", (_data select 38), true];
_player setVariable ["ExileScore", (_data select 39)];
_player setVariable ["ExileKills", (_data select 40)];
_player setVariable ["ExileDeaths", (_data select 41)];
_player setVariable ["ExileClanID", _clanID];
_player setVariable ["ExileClanData", _clanData];
_player setVariable ["ExileName", _name]; 
_player setVariable ["ExileOwnerUID", _playerUID]; 
_player setVariable ["ExileDatabaseID", _data select 0];
_player setVariable ["ExileHunger", _data select 4];
_player setVariable ["ExileThirst", _data select 5];
_player setVariable ["ExileAlcohol", _data select 6]; 
_player setVariable ["ExileTemperature", _data select 44]; 
_player setVariable ["ExileWetness", _data select 45]; 
_player setVariable ["ExileIsBambi", false];
_player setVariable ["ExileXM8IsOnline", false, true];
_player setOxygenRemaining (_data select 7);
_player setBleedingRemaining (_data select 8);
_player setVariable ["ExileLocker", (_data select 46), true];
_player setVariable ["ExileAdmin", (_data select 47), true];
[_player, _data select 9] call ExileClient_util_player_applyHitPointMap;
_devFriendlyMode = getNumber (configFile >> "CfgSettings" >> "ServerSettings" >> "devFriendyMode");
if (_devFriendlyMode isEqualTo 1) then 
{
    _devs = getArray (configFile >> "CfgSettings" >> "ServerSettings" >> "devs");
    {
        if (_playerUID isEqualTo (_x select 0)) exitWith 
        {
            if (_name isEqualTo (_x select 1)) then
            {
                _player setVariable ["ExileMoney", 500000, true];
                _player setVariable ["ExileScore", 100000];
            };
        };
    }
    forEach _devs;
};
_player call ExileClient_util_playerCargo_clear;
_headgear = _data select 23;
if (_headgear != "") then
{
    _player addHeadgear _headgear;
};
_goggles = _data select 20;
if (_goggles != "") then
{
    _player addGoggles _goggles;
};
_binocular = _data select 24;
if (_binocular != "") then
{
    _player addWeaponGlobal _binocular;
};
_primaryWeapon = _data select 26;
if (_primaryWeapon != "") then 
{
    _player addWeaponGlobal _primaryWeapon;
    removeAllPrimaryWeaponItems _player;
    { 
        if (_x != "") then
        {
            _player addPrimaryWeaponItem _x; 
        };
    } 
    forEach (_data select 27);
};
_handgunWeapon = _data select 22;
if (_handgunWeapon != "") then
{
    _player addWeaponGlobal _handgunWeapon;
    removeAllHandgunItems _player;
    { 
        if (_x != "") then
        {
            _player addHandgunItem _x; 
        };
    } 
    forEach (_data select 21);
};
_secondaryWeapon = _data select 28;
if (_secondaryWeapon != "") then
{
    _player addWeaponGlobal _secondaryWeapon;
    { 
        if (_x != "") then
        {
            _player addSecondaryWeaponItem _x; 
        };
    } 
    forEach (_data select 29);
};
 _currentWeapon = _data select 19;
if (_currentWeapon != "") then
{
     _player selectWeapon _currentWeapon;
};

    _player addWeaponItem [_x select 0, [_x select 1, _x select 2, _x select 3]];

forEach (_data select 25);
_uniform = _data select 30;
_vest = _data select 34;
_backpack = _data select 15;
if (_uniform != "") then 
{
    _player forceAddUniform _uniform;
};
if (_vest != "") then
{
    _player addVest _vest;
};
if (_backpack != "") then
{
    _player addBackpackGlobal _backpack;
};
_uniformContainer = uniformContainer _player;
if !(isNil "_uniformContainer") then
{
    { 
        _uniformContainer addWeaponCargoGlobal _x; 
    } 
    forEach (_data select 33);
    { 
        _uniformContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1]; 
    } 
    forEach (_data select 32);
    { 
        _uniformContainer addItemCargoGlobal _x; 
    } 
    forEach (_data select 31);
};
_vestContainer = vestContainer _player;
if !(isNil "_vestContainer") then
{
    { 
        _vestContainer addWeaponCargoGlobal _x; 
    } 
    forEach (_data select 37);
    { 
        _vestContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1]; 
    } 
    forEach (_data select 36);
    { 
        _vestContainer addItemCargoGlobal _x; 
    } 
    forEach (_data select 35);
};
_backpackContainer = backpackContainer _player;
if !(isNil "_backpackContainer") then
{
    { 
        _backpackContainer addWeaponCargoGlobal _x; 
    } 
    forEach (_data select 18);
    { 
        _backpackContainer addMagazineAmmoCargo [_x select 0, 1, _x select 1]; 
    } 
    forEach (_data select 17);
    { 
        _backpackContainer addItemCargoGlobal _x; 
    } 
    forEach (_data select 16);
};
_assignedItems = _data select 14;
if !(_assignedItems isEqualTo []) then
{
    {
        _player linkItem _x;
    }
    forEach _assignedItems;
};
_player addMPEventHandler ["MPKilled", {_this call ExileServer_object_player_event_onMpKilled}];
if (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "thermalVision") isEqualTo 0) then 
{
    _player addEventHandler ["WeaponAssembled", {(_this select 1) disableTIEquipment true;}];
};
[
    _sessionID, 
    "loadPlayerResponse", 
    [
        (netId _player),
        str (_player getVariable ["ExileScore", 0]),
        (_player getVariable ["ExileKills", 0]),
        (_player getVariable ["ExileDeaths", 0]),
        (_player getVariable ["ExileHunger", 100]),
        (_player getVariable ["ExileThirst", 100]),
        (_player getVariable ["ExileAlcohol", 0]),
        (_player getVariable ["ExileClanData", []]),
        (_player getVariable ["ExileTemperature", 0]),
        (_player getVariable ["ExileWetness", 0])
    ]

call ExileServer_system_network_send_to;
[_sessionID, _player] call ExileServer_system_session_update;
true

 

Added a new line into [loadPlayer] in exile.ini and added it on the output.

SQL1_48 = a.admin
Spoiler

[loadPlayer]
SQL1_1 = SELECT p.id,
SQL1_2 = p.name,
SQL1_3 = p.account_uid,
SQL1_4 = p.damage,
SQL1_5 = p.hunger,
SQL1_6 = p.thirst,
SQL1_7 = p.alcohol,
SQL1_8 = p.oxygen_remaining,
SQL1_9 = p.bleeding_remaining,
SQL1_10 = p.hitpoints,
SQL1_11 = p.direction,
SQL1_12 = p.position_x,
SQL1_13 = p.position_y,
SQL1_14 = p.position_z,
SQL1_15 = p.assigned_items,
SQL1_16 = p.backpack,
SQL1_17 = p.backpack_items,
SQL1_18 = p.backpack_magazines,
SQL1_19 = p.backpack_weapons,
SQL1_20 = p.current_weapon,
SQL1_21 = p.goggles,
SQL1_22 = p.handgun_items,
SQL1_23 = p.handgun_weapon,
SQL1_24 = p.headgear,
SQL1_25 = p.binocular,
SQL1_26 = p.loaded_magazines,
SQL1_27 = p.primary_weapon,
SQL1_28 = p.primary_weapon_items,
SQL1_29 = p.secondary_weapon,
SQL1_30 = p.secondary_weapon_items,
SQL1_31 = p.uniform,
SQL1_32 = p.uniform_items,
SQL1_33 = p.uniform_magazines,
SQL1_34 = p.uniform_weapons,
SQL1_35 = p.vest,
SQL1_36 = p.vest_items,
SQL1_37 = p.vest_magazines,
SQL1_38 = p.vest_weapons,
SQL1_39 = p.money,
SQL1_40 = a.score,
SQL1_41 = a.kills,
SQL1_42 = a.deaths,
SQL1_43 = c.id,
SQL1_44 = c.name,
SQL1_45 = p.temperature,
SQL1_46 = p.wetness,
SQL1_47 = a.locker
SQL1_48 = a.admin
SQL1_49 = FROM player p
SQL1_50 = INNER JOIN account a
SQL1_51 = ON a.uid = p.account_uid 
SQL1_52 = LEFT JOIN clan c 
SQL1_53 = ON c.id = a.clan_id
SQL1_54 = WHERE p.account_uid = ?
Number of Inputs = 1
SQL1_INPUTS = 1
OUTPUT = 1,2-STRING,3-STRING,4,5,6,7,8,9,10,11,12,13,14,15,16-STRING,17,18,19,20-STRING,21-STRING,22,23-STRING,24-STRING,25-STRING,26,27-STRING,28,29-STRING,30,31-STRING,32,33,34,35-STRING,36,37,38,39,40,41,42,43,44-STRING,45,46,47,48
 

 

I thought that's it, but now players won't load anymore cuz there seems to be an error. I guess the problem are the sql statements SQL_49 to 54, cuz i had to move those numbers one up to fit the new a.admin into it, i guess that screwed the database loads completely.

Error in expression <ase_handleBig;
};
};
(_result select 1) select 0>
16:00:16   Error position: <select 0>
16:00:16   Error Generic error in expression
16:00:16 File exile_server\code\ExileServer_system_database_query_selectSingle.sqf, line 27

if someone could give me a little hint towards the right direction, would be great :)

 

THanks in advance.

Edited by WURSTKETTE

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.