steve1two

What is wrong with this code (updating player respect/money)

17 posts in this topic

I am trying to update a couple mods that were using this - 

format["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;

Which I tried changing to this - 

format['setAccountScore:%1:%2', _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;
format['setPlayerMoney:%1:%2', _playerMoney, _playerUID] call ExileServer_system_database_query_fireAndForget;

It seems to work perfectly for updating the respect but I cannot get it to update the money.

Share this post


Link to post
Share on other sites

They changed it. You now use

 setVariable ["ExileMoney",MONEYVALUELIKEMAYBE500ORWHATEVER];

 

Share this post


Link to post
Share on other sites
Advertisement
format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;

 

Share this post


Link to post
Share on other sites
19 hours ago, eraser1 said:

format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;

 

Does this? 

format["setAccountMoneyAndRespect:%1:%2:%3", _playerMoney, _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;

Translate directly to this?

format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;

Thanks guys,

Terd

Share this post


Link to post
Share on other sites

@Terd Fergasen There is no database call in the latest version of Exile that sets BOTH money AND respect, so they do NOT translate directly.

You will need to set respect separately using:

format['setAccountScore:%1:%2', _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;

 

and money is set in the format that I gave in my example.

1 person likes this

Share this post


Link to post
Share on other sites

Hello ;)

i have some trouble with the exileZ and exile 0.9.8

 

Server WindowsDS 2012R2

RTP error

11:51:25 "ExileZ 2.0: Selected Zombie Class : RyanZombieSpider7"
11:51:25 "ExileZ 2.0: Spawning 1 Zombie    |    Position : [15925.8,17023.6,0]    |    Class : RyanZombieSpider7 "
11:51:25 Loading movesType CfgGesturesMale
11:51:25 Loading movesType CfgRyanZombiesMovesMaleSdrSpider
11:51:28 Error in expression < then
{

format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["E>
11:51:28   Error position: <_playerMoney, _playerObj getVariable ["E>
11:51:28   Error Undefined variable in expression: _playermoney
11:51:28 Error in expression <then
{

format['setAccountScore:%1:%2', _playerRespect, _playerUID] call ExileSe>
11:51:28   Error position: <_playerRespect, _playerUID] call ExileSe>
11:51:28   Error Undefined variable in expression: _playerrespect
11:51:40 "ExileZ 2.0: Zombie Group Highest Compound Weight : 112"
11:51:40 "ExileZ 2.0: Randomly Selected Value : 106"
11:51:40 "ExileZ 2.0: Selected Zombie Group : [["RyanZombieB_Soldier_02_f"],["RyanZombieB_Soldier_02_f_1"],["RyanZombieB_Soldier_02_f_1_1"],["RyanZombieB_Soldier_03_f"],["RyanZombieB_Soldier_03_f_1"],["RyanZombieB_Soldier_03_f_1_1"],["RyanZombieB_Soldier_04_f"],["RyanZombieB_Soldier_04_f_1"],["RyanZombieB_Soldier_04_f_1_1"],["RyanZombieB_Soldier_05_f"],["RyanZombieB_Soldier_lite_F"],["RyanZombieB_Soldier_lite_F_1"],["RyanZombieB_RangeMaster_Fslow"]]        Compound Weight : 108"
11:51:40 "ExileZ 2.0: Selected Zombie Class : RyanZombieB_RangeMaster_Fslow"
11:51:40 "ExileZ 2.0: Spawning 1 Zombie    |    Position : [15928.6,16925.2,0]    |    Class : RyanZombieB_RangeMaster_Fslow "
11:51:42 Error in expression < then
{

exileZ config

 

// ExileZ 2.0 by Patrix87 of http:\\multi-jeux.quebec //

// Original script by eraser1 and IT07 //

private [

"_unit",

"_killer",

"_playerObj",

"_veh",

"_killMsg",

"_killMsgRoad",

"_roadKilled",

"_respect",

"_respectChange",

"_roadKillBonus",

"_money",

"_zombieMoney",

"_zombieRespect",

"_distanceBonusDivider",

"_minDistance",

"_cqbDistance",

"_cqbBonus",

"_distance",

"_killerRespectPoints",

"_safetoblow",

"_explode"

];

 

_unit                            = _this select 0;

_killer                           = _this select 1;

_playerObj                    = objNull;

_roadKilled                               = false;

_respectChange                        = 0;

_killerRespectPoints      = [];

_safetoblow                                          = true;

_explode                                              = false;

 

//Parameters

_zombieMoney                         = ZombieMoney;                                              //default = 5;     // Money per zombie kill

_zombieRespect                                   = ZombieRespect;                                //default = 10;   // Respect per zombie kill

_roadKillBonus                         = RoadKillBonus;                                  //default = -5;    // Bonus Respect if roadkill

_minDistance                           = MinDistance;                                     //default = 50;   // Minimal distance for range bonus

_cqbDistance                           = CqbDistance;                                    //default = 10;   // Minimal ditance for close quarter bonus

_cqbBonus                                           = CqbBonus;                                                    //default = 40;   // Respect for close quarter bonus at 1 meter

_distanceBonusDivider = DistanceBonusDivider;                       //default = 10;   // Distance divided by that number = respect E.G. 300m / [20] = 15 Respect

//

 

_killMsg = ["ZOMBIE WACKED","ZOMBIE CLIPPED","ZOMBIE DISABLED","ZOMBIE DISQUALIFIED","ZOMBIE WIPED","ZOMBIE WIPED","ZOMBIE ERASED","ZOMBIE LYNCHED","ZOMBIE WRECKED","ZOMBIE NEUTRALIZED","ZOMBIE SNUFFED","ZOMBIE WASTED","ZOMBIE ZAPPED"] call BIS_fnc_selectRandom;

_killMsgRoad = ["ZOMBIE ROADKILL","ZOMBIE SMASHED","ERMAHGERD ROADKILL"] call BIS_fnc_selectRandom;

 

if(ExplosiveZombies) then

{

            if (ExplosiveZombiesRatio > random 100) then

            {          

                        _killerRespectPoints pushBack [(format ["%1",ExplosiveZombieWarning]), ExplosiveRespect];

                        _explode = true;

            };

};

 

 

//Roadkill or not

if (isPlayer _killer) then

{

            _veh = vehicle _killer;

            _playerObj = _killer;

            if (!(_killer isKindOf "Exile_Unit_Player") && {!isNull (gunner _killer)}) then

            {

                                   _playerObj = gunner _killer;

            };

 

            if (!(_veh isEqualTo _killer) && {(driver _veh) isEqualTo _killer}) then

            {

                                   _playerObj = driver _veh;

                                   _roadKilled = true;

            };

};

 

_respect = _playerObj getVariable ["ExileScore", 0];

_money = _playerObj getVariable ["ExileMoney", 0];

 

//Scoring

if ((!isNull _playerObj) && {((getPlayerUID _playerObj) != "") && {_playerObj isKindOf "Exile_Unit_Player"}}) then

{

            //Default

            _killerRespectPoints pushBack [(format ["%1",_killMsg]), _zombieRespect];

            //RoadkillBonus

            if (_roadKilled) then

            {

                        _killerRespectPoints pushBack [(format ["%1",_killMsgRoad]), _roadKillBonus];

            }

            else

            //DistanceBonus

            {

                        _distance = _unit distance _playerObj;

                        if (_distance > _minDistance) then

                        {

                                   _distanceBonus = (floor (_distance / _distanceBonusDivider));

                                   _killerRespectPoints pushBack [(format ["%1m RANGE BONUS", (round _distance)]), _distanceBonus];                                 

                        };

                        if (_distance <= _cqbDistance) then

                        {

                                   _distanceBonus = round((floor ((_cqbDistance + 1) - _distance)) * ( _cqbBonus /_cqbDistance));

                                   _killerRespectPoints pushBack [(format ["%1m CQB BONUS", (round _distance)]), _distanceBonus];

                        };

            };

           

            // Calculate killer's respect and money

            {

                        _respectChange = (_respectChange + (_x select 1));

            }

            forEach _killerRespectPoints;

            _respect = (_respect + _respectChange);

            _money = (_money + _zombieMoney);

           

            if (EnableMoneyOnKill) then

            {

                        [_playerObj, "moneyReceivedRequest", [str _money, "Killing Zombies"]] call ExileServer_system_network_send_to;

                        _playerObj setVariable ["ExileMoney", _money];

            };

           

            if (EnableRespectOnKill) then

            {

                        [_playerObj, "showFragRequest", [_killerRespectPoints]] call ExileServer_system_network_send_to;

                        _playerObj setVariable ["ExileScore", _respect];

                        ExileClientPlayerScore = _respect;

                        (owner _playerObj) publicVariableClient "ExileClientPlayerScore";

                        ExileClientPlayerScore = nil;

            };

           

            if (EnableMoneyOnKill) then

            {

                        // FIX Update client Money database entry

                        format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable ["ExileDatabaseID", 0]] call ExileServer_system_database_query_fireAndForget;

            };

           

            if (EnableRespectOnKill) then

            {

                        // FIX Update client Respect database entry

                        format['setAccountScore:%1:%2', _playerRespect, _playerUID] call ExileServer_system_database_query_fireAndForget;

            };

};

 

if(_explode) then

{

            {

                        if (((_x select 0) distance (position _unit)) < (_x select 1)) exitwith {_safetoblow = false};

            }Foreach SafeZonePositions;

            if (_safetoblow) then

            {

                        sleep ExplosionDelay;

                        ExplosiveType createvehicle position _unit;

            };

};

 

anyone an idea?

 

thanks

 

Share this post


Link to post
Share on other sites

Posted (edited)

what is the right Format ? 

have to remove "ExileDatabaseID" ?

1. with " "

format["setAccountMoneyAndRespect:%1:%2:%3", _money, _respect, (getPlayerUID _playerObj)] call ExileServer_system_database_query_fireAndForget;

or

second with ' '

format['setAccountMoneyAndRespect:%1:%2:%3', _money, _respect, (getPlayerUID _playerObj)] call ExileServer_system_database_query_fireAndForget;

 

mh whats with that?

ExileDatabaseID
Edited by yama

Share this post


Link to post
Share on other sites

what is the right Format ? 

have to remove "ExileDatabaseID" ?

1. with " "

format["setPlayerMoney:%1:%2", _playerMoney, _playerObj getVariable] call ExileServer_system_database_query_fireAndForget;

or

second with ' '

format['setPlayerMoney:%1:%2', _playerMoney, _playerObj getVariable] call ExileServer_system_database_query_fireAndForget;

 

mh whats with that?

ExileDatabaseID

Share this post


Link to post
Share on other sites

I have downloaded and installed the latest version of Defent's Mission System.  I don't receive money for killing AI and the respect I see it on XM8 but it isn't saved to the DB.  This from my DB log [Thread 17372] extDB2: SQL_CUSTOM_V2: Error No Custom Call Not Found: Callname setAccountMoneyAndRespect

Share this post


Link to post
Share on other sites

setAccountMoneyAndRespect

is the old db call

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

  • Recently Browsing   0 members

    No registered users viewing this page.