Jump to content
  • 0

Variables not resetting unless log off


Question

Posted

Hi everyone,

 

i seem to be having an issue, as we store permanent character variables in char_reg_num, i have a script that deletes this on a timed basis.

 

	query_sql( "DELETE FROM `char_reg_num` WHERE `key`='variable' " );

However, the problem i find out is that the variables only saves once the person logs out, thus if the person interacts with the NPC and for example gets an additional ranking, it'll be the old value + new value together.

 

For example

Value before Scripts deletes the variables

  • Variable = 100

 

If the person interacts with the NPC and let's say the variable adds 10 without logging off,

  • Variable = 110

If the person interacts with the NPC and let's say the variable adds 10 after logging off

  • Variable = 10

 

Is there any way to force it to clear the values? This is because i'm using a SQL based ranking for this and players are able to add that variable by themselves. Similar to Rachel's donation quest to open the gateway but instead with a ranking.

 

 

2 answers to this question

Recommended Posts

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...