Jump to content

Question

Hello there,

 

I would like to ask for a NPC converter from FLUX Credits to an item custom.

 

As you know Flux CP works with their system "credit donation" (cp_credits in SQL data base). I want a npc that allows the user convert their credits to this item custom 7608.

 

Thanks for your help, thanks you

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
prontera,156,187,6	script	dfkjhsdfkjs	100,{	query_sql "select balance from cp_credits where `account_id` = "+ getcharid(3), .@points;	if ( .@points >= 1 ) {		query_sql "update cp_credits set balance = balance -1 where account_id = "+ getcharid(3);		getitem 7608, 1;	}	else		dispbottom "You don't have anymore voting points";	end;}

Share this post


Link to post
Share on other sites
  • 0

AnnieRuru, thanks a lot for your help.

 

I have edited the npc because your npc gives 1 item by one click but thanks though.

 

Here's your scripts with my related edits:

 

prontera,156,187,6	script	dfkjhsdfkjs	100,{	query_sql "select balance from cp_credits where `account_id` = "+ getcharid(3), .@points;	if ( .@points >= 1 ) {		query_sql "update cp_credits set balance = balance -" +.@points+ " where account_id = "+ getcharid(3);		getitem 7608, .@points;	}	else		dispbottom "You don't have anymore voting points";	end;}

 

 Thanks again (:

Share this post


Link to post
Share on other sites
  • 0
prontera,156,187,6	script	dfkjhsdfkjs	100,{	query_sql "select balance from cp_credits where `account_id` = "+ getcharid(3), .@points;	if ( .@points >= 1 ) {		if ( !checkweight( 7608, .@points ) ) {			dispbottom "You can't carry enough "+ getitemname(7608);			end;		}		query_sql "update cp_credits set balance = balance -"+ .@points +" where account_id = "+ getcharid(3);		getitem 7608, .@points;	}	else		dispbottom "You don't have anymore voting points";	end;}
I always forgot the *checkweight command =/

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

×
×
  • Create New...

Important Information

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