Sign in to follow this  
geekm0nkey

Adding extra fields to database

3 posts in this topic

Need some guidance where to add something..  What file would I need to create an overwrite for that is used to record the entries for Player_history in the database. I want to add a few more fields to it.. I need to add, money on player and or players vehicle , score of player. Having an issue where randomly players loose all respect and or money. This would make it easier to pinpoint a time when they had, then lost.

Share this post


Link to post
Share on other sites

ExileServer_object_player_event_onMpKilled.sqf

1) Define this at the top and in private

_lockerMoney = _victim getVariable ["ExileLocker",0]

2) Modify this line

format["insertPlayerHistory:%1:%2:%3:%4:%5", getPlayerUID _victim, name _victim, _victimPosition select 0, _victimPosition select 1, _victimPosition select 2] call ExileServer_system_database_query_fireAndForget;

to this

format["insertPlayerHistory:%1:%2:%3:%4:%5:%6:%7", getPlayerUID _victim, name _victim, _victimPosition select 0, _victimPosition select 1, _victimPosition select 2, _oldVictimRespect, _lockerMoney] call ExileServer_system_database_query_fireAndForget;

 

ExileServer_system_network_event_onHandleDisconnect.sqf

1) Define these at the top, also define private

_lockerMoney = _unit getVariable ["ExileLocker",0]
_playersRespect = _unit getVariable ["ExileScore",0]

2) Modify this line

format["insertPlayerHistory:%1:%2:%3:%4:%5", _uid, _name, _pos select 0, _pos select 1, _pos select 2] call ExileServer_system_database_query_fireAndForget;

to this

format["insertPlayerHistory:%1:%2:%3:%4:%5:%6:%7", _uid, _name, _pos select 0, _pos select 1, _pos select 2, _playersRespect, _lockerMoney] call ExileServer_system_database_query_fireAndForget;

 

Exile.ini

Modify [insertPlayerHistory] thingie so it looks like this

[insertPlayerHistory]
SQL1_1 = INSERT INTO player_history SET account_uid = ?, name = ?, position_x = ?, position_y = ?, position_z = ?, respect = ?, locker = ?
Number Of Inputs = 7
SQL1_INPUTS = 1,2,3,4,5,6,7

And create extra fields in your player history table called respect and locker

 

However keep in mind that player history is logged only upon death.

Also i haven't tested this myself yet but it should work in theory.

  • Like 3

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  

  • Recently Browsing   0 members

    No registered users viewing this page.