Jump to content
  • 0

Database to Permanent/Temporary Character Variable


Nitrate

Question


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  12/10/13
  • Last Seen:  

Hello, I would just like to ask if this is possible, and if it is, how to do it.

 

My idea would be getting a variable from a certain database table and turning it into a character variable.

 

For example:

 

I have a table named `table_a`, and in that table there would be the following : `char_id`, `account_id`, `char`, `variable_a`. Let's say variable_a is a number not less than 0.

 

Now lets say I would like to attach into a OnPcLoginEvent that when a player logs in, the variable_a would, lets say become a permanent character variable (ex: VariableA). How would I be able to do it? set VariableA,???;

 

I hope some can guide me with this. Thank you

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

With getd and setd you can make this, see on doc

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   0
  • Joined:  12/10/13
  • Last Seen:  

With getd and setd you can make this, see on doc

 

Oh cool, i'll try to read and learn about it then. Thank you very much.

 

Edit:

 

Tho I do not really understand how I could fetch the information from a sql table with the command.

Edited by Nitrate
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

oh, I think I understood you wrong. you wanna pick the value of the table?

just use query_sql

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   21
  • Joined:  01/31/12
  • Last Seen:  

Yes, use query_sql.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...