Jump to content
  • 0

Database Querying


Mr.GAM3R

Question

Hi everyone,

I have a question I can't seem to find the answer to, any help at all would be great.
I am trying to query data fields from the player_data table in my servers database, I have setup an additional data column in the table as a simple int just for testing, so I can see how changing data in game works. But that's where I get stuck, I understand how to change data like humanity using get and set variables, but I cant find a place where all of the variables are defined or initially instantiated when the player character loads in. How do i go about querying the database so I can use stored data in my scripts. Thanks in advance.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

First thing, you want to check out the Bohemia Interactive Wiki website for script questions. Random wiki page: community (dot) bistudio.com/wiki/forEach

What you are asking about are SetVariable, and GetVariable. Some of these values you can manipulate, others you cant.

 

You will not be able to "query" the database ingame the way you are thinking, at least not in an easy way... From my experience (500 some hours scripting in A2). 

Secondarily, you should really ask this question in the Dayz Epoch Discord. People like bombardierz has helped me out a lot in the past. Lots of oldies are still around for fun and will most of the time answer your questions if you ask nice.

Ask yourself if you really need to query the database for the information you are requesting. Perhaps some of the things can be defined client side without such heavy operations , like player user ID ,etc. Thats really easy and nothing you'll need an external query for.

 

For example : 

local _playerPUID = getPlayerUID player;'

This one line of code defines the variable and gets the information in one go,s o you dont need to declare it. Its pretty cool.

Best of luck to you. 

Link to comment
Share on other sites

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...