Jump to content
  • 0
Sign in to follow this  
Jedzkie

Help on updating account_data through query_sql

Question

hi! as the title says, how can i update my account_data through query_sql? thanks!

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0

 

 

For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

 

 

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it

 

can you make a sample script for that? thanks!

 

you can try this one ,  its binded over a Function to a item .  I use Vip Tickets for it

 

just add this into your item what should give the VIP Status

 

after using the Item you can check your remaining time with  @vip

 

{	Id: YOUR ITEM ID HERE	AegisName: "VIP Ticket 3D"	Name: "VIP Ticket 3D"	Type: 0	Weight: 10	Job: 0x7FFFFFFF	Script: <"		if(#vip_status >0) {			dispbottom "You allready got a Premium Service Running , Use another one after the Time Runs out.!";			getitem YOUR ITEM ID HERE,1;			end;		}		callfunc "getVIP", 3 * 24 * 3600; //VIP Status for 3 Day , change the 3 into 7  for 7 Days.	">},

 

 

 

Code will be readded , changing some stuff
Edited by ossi0110

Share this post


Link to post
Share on other sites
  • 0
CREATE TABLE IF NOT EXISTS `account_data` (`account_id` int(11) unsigned NOT NULL default '0',`bank_vault` int(11) unsigned NOT NULL default '0',`base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '100',PRIMARY KEY (`account_id`)) ENGINE=MyISAM; 

 

For example you want to add 1 zeny from your vault everytime you click this npc :

prontera,150,150,0	script	Sample	123,{	query_sql "UPDATE `account_data` SET `bank_vault` = `bank_vault` + 1 WHERE `account_id` = '" +getcharid(3)+ "'";	end;}

Share this post


Link to post
Share on other sites
  • 0

thanks for your reply, but how can i make it in base_Exp, and base_drop and death>?

Share this post


Link to post
Share on other sites
  • 0

For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

Share this post


Link to post
Share on other sites
  • 0

If you want to make a vip service then you might need to create another table for that to store their names and other basic info

Share this post


Link to post
Share on other sites
  • 0

For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

 

 

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it

Share this post


Link to post
Share on other sites
  • 0

 

For example if i talk to the npc it will give me 7 days vip service. I try a your post but i have a problem, it does not add another column for other accounts, one column only and if other account talked to the npc, it overwrite the first account.

 

 

you can update the VIP System with  set ModExp,150;     it changes the value in sql to 150   what you means you got 50% more exp  ( 100% is basic + 50% = 150) so you dont need a query_sql for it

 

can you make a sample script for that? thanks!

Share this post


Link to post
Share on other sites
  • 0

Main problem with this, is that you need to set the expiration time somewhere else since you can't track that with current `account_data` table...

Share this post


Link to post
Share on other sites
  • 0

 

CREATE TABLE IF NOT EXISTS `account_data` (`account_id` int(11) unsigned NOT NULL default '0',`bank_vault` int(11) unsigned NOT NULL default '0',`base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '100',`base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '100',PRIMARY KEY (`account_id`)) ENGINE=MyISAM; 

 

For example you want to add 1 zeny from your vault everytime you click this npc :

would this affect the account saved in my server?

and can i add this even if my server is running?

Edited by karazu

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.