cp credit converter to items custom

Alexandria

New member
Messages
341
Points
0
Location
localhost
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

 
Code:
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;}
 
Last edited by a moderator:
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 (:

 
Code:
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 =/
 
Back
Top