DirtySanchez

Player History Log with kill info

2 posts in this topic

Just looking at the mod in relation to my request. its pretty easy to do and I will test this out shortly to add it to my servers.

 

exile.ini has playerhistory as;


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

///////////////////////////////////////////////////////
make it to include the death logs with killer name, killer uid, distance and maybe weapon.


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


/*****************************************************************************************************************/
ExileServer_object_player_event_onMpKilled.sqf sends the data to the db.
Line 20 sends this: 

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;

////////////////////////////////////////////////////////
make it to include the death logs with killer name, killer uid, distance and maybe weapon.
add this to the top to get the variables:
_kName = name _killer;
_kUID = getPlayerUID _killer;
_kDistance = floor(_victim distance _killer);

add this to line 20 to send to the db
format["insertPlayerHistory:%1:%2:%3:%4:%5:%6:%7:%8", getPlayerUID _victim, name _victim, _victimPosition select 0, _victimPosition select 1, _victimPosition select 2, _kName, _kUID, _kDistance] call ExileServer_system_database_query_fireAndForget;

If anyone wants to use this currently be my guest, I merely want the kill logs. I have not tested it yet but in theory it should work just fine to log all kills without needing anything extra, just a3 and exile

Share this post


Link to post
Share on other sites

This is confirmed working. To add the columns to the database use this code

	ALTER TABLE `player_history`
	ADD COLUMN `killer` VARCHAR(64);
	ALTER TABLE `player_history`
	ADD COLUMN `kUID` VARCHAR(32);
	ALTER TABLE `player_history`
	ADD COLUMN `distance` INT(11);

 

Share this post


Link to post
Share on other sites
Advertisement

  • Recently Browsing   0 members

    No registered users viewing this page.