Jump to content

Dayz Epoch Deafult layout by Mysql.


Mehdi

Recommended Posts

Dayz Epoch.

 

Here I will show you how I updated my server for the following player load outs.

 

Important the player needs to log in at least once onto the server so his data is saved.

 

The basic idea is this, You first add new columns to your character_data table.

 

TeamSpawn,     Data field setup same as Worldspace.
TeamModel,      Data field setup same as Model.
Clan,                Data field setup varchar, needs to hold a 0 or 1 data element.

 

First the TeamSpawn location, here you just ask the player to log out in his base or where ever he wants to spawn at when he dies..  Once he has logged off the server copy the worldspace information into the TeamSpawn datafield for the ChracterID that requested it.

 

TeamModel, here you request which skin the player likes on death, or what is his clan uniform and place the classname here.

 

Clan you change the 0 to 1.  This indicates this player is using a default clan loadout for his character.  This does not mean he needs to be part of a clan, it just indicates that this player you have enabled for a different loadout after death.

 

If the clan is set to 0 then the script shown below wont run and that player will then take the default kit from dayz or the default loadout in init.sqf file and spawn at a random place.

 

Next Part.

 

Google mysql Scheduler and Events,,, Knowledge time,.,,

 

Now we need to enable your scheduler in your database.  Log into your database cmd window (Look it up!) and enable the scheduler option.

 

Here are the following commands you would need depending on your database.

 

Once in the cmd window select your database.

 

Command:        Use dayz_epoch;

Now you are on your database, and now enter the following commands.  These work for about all databases,,

 

SET GLOBAL event_scheduler = ON;

SET @@global.event_scheduler = ON;

SET GLOBAL event_scheduler = 1;

SET @@global.event_scheduler = 1;

 

To check an event and remove an event that you will program commands are these.,,

 

SHOW EVENT;

DROP EVENT event_name;

 

I use the Software navicate database tool, you can use what ever you like...

Using this software I then create an event that will run the following script every 10 seconds.  Why 10 secs as this is the death message you get when you get kicked back to the lobby which means the script will run before you can get back into the game.

 

Navitcat builds the event for you so part of the mysql coding is missing, if you are not creating an event by navicat then you need to google the correct commands you need to add before the UPDATE command to create an event.

 

What does this event do.  Every 10 secs it will check the character_data table and check if any Alive field has changed from 1 to 0 indicating that the player just died!  The command is WHERE Alive =0 AND Clan=1, means that both fields in the table have to be equal to Alive = 0 and Clan=1 before it will run the following script.  If you have a normal player on the server and the Clan=0 then the script will not run and the player will take the normal random spawn location and default kit you have in the init.sqf  It will then create a new data field for the character so you have then a history of all his deaths etc..

 

Now if both statements are correct then it will do the following;

The script will overwrite the data fields with new information.  IMPORTANT ! You will not have a history of his deaths as the same data field is always over written, which means stuff like key, and special equipment will be lost and as Admin you can not recover the data.  So let the players know they need to get back to their dead body and grab what they lost !!  If you don't overwrite any of these fields then you will be duping his gear, as he will spawn back at base with all his gear again..,

 

 

My Script.

 

UPDATE character_data
SET 
Medical='[false,false,false,false,false,false,true,6000.57,[],[0,0],0,[486.208,531.887]]',
Alive=1,
Backpack ='["DZ_British_ACU",[],[]]',
Inventory 
='[["glock17_EP1","ItemKnife","ItemCompass","ItemMap","ItemHatchet","ItemMatchbox"],["17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","17Rnd_9x19_glock17","FoodbeefCooked","FoodbeefCooked","ItemSodaCoke","ItemBandage","ItemBandage","ItemMorphine","ItemMorphine","ItemPainKiller","ItemPainKiller"]]',
Worldspace =TeamSpawn,
Model=TeamModel,
Duration =0,
DistanceFoot =0
WHERE Alive =0 AND Clan=1

 

 

Medical=[],        Resets the characters health, but I set the health to 6000 not 12000 death penalty.

Alive=1,            Change the death from 0 back to 1.

Backpack=[]     Give him a new backpack, what ever you like

Inventory=[]       Default loadout what ever you like..

Worldspace =TeamSpawn,        Copy his saved spawn location into Worldspace

Model=TeamModel,                   Copy his saved Skin into Model

Duration =0,                              Reset the field back to 0
DistanceFoot =0                       Reset the field back to 0

WHERE Alive =0 AND Clan=1   Both fields need to be true for the script to run / activate.

 

 

How many kills etc, is not overwritten so you have a history of all your kills,, which I like !

(Days alive I have not done yet, which will reset the time stamp to the day he died to get the counter going)

 

I am able to place you back in to your base I don’t give much gear as by epoch everyone has a safe box with enough gear to start a war, so I don’t want to spawn in more stuff by duping…

 

So the nice thing is now, all your regular players will always spawn at there own base, have the default clothing and stuff and the data base is not full of dead players.

 

Plus you don’t need to play with any dayz scripting ever as this will work for all dayz servers.

 

Now using this concept you are able to do many other things, 

 

Die more than 3 times as a clan player take 2nd spawn location.

Setup death match in a city, so when you die you can jump back into a game and carry on fighting,

 

I am new at mysql, so if anyone can improve on the event info then would be great!

 

 

Hope this works for you, as I have already gained alot from this forum, if you have any questions feel free to contact me :)

 

Link to comment
Share on other sites

Nice idea, just curious though....how will the above script 'find' the latest entry? You dont have any 'descending sorting' based on datestamp.

I think a better fail safe would be to sort the query (ORDER BY Datestamp DESC), in case something goes wrong and the player has 1+ entries of Alive = 0

Link to comment
Share on other sites

The Script is always running in the background every 10 seconds and checks all columns for an entry of Alive=0 and Clan=1, if both are true then the script runs.

I don't need to sort anything as it check all in the character_data table Alive Colum continuously every 10 seconds.

 

if the data changes to anything other than Alive=0 the script wont run, as it needs a 0 to kick start the script.  If the data is not correct here then admin did a change or

a mistake.

 

If a player was playing a lot and then later the Admin added him to clan status he would first need to go through the table and remove all Alive=0 for his CharacterID

So the player wound start off with a Alive=1 data field and only 1 entry.  Then the script will always run clean, we only will have issues if the admin starts playing with the character_data table.

 

I have this on my test server and live server with set friends so if you want to test it message me and I give you the details.., so you can see how it works,,  I did this as they kept dying so much and was frustrating to hear them moan all the time when they random spawned back in.  Plus I found all the scripting which needs to be redone with each new release of dayz to much like hard work for me so wanted something that worked for all servers, as its database related and not dayz related. 

 

:)

Link to comment
Share on other sites

  • 4 weeks later...

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
  • Advertisement
  • Discord

×
×
  • Create New...