I wanted to script a way to get the credits of the donation shop with some ingame items. The NPC I made has his own sql table but my problem is, if I try to insert the accountid of the user he don't add it.
Here is the script :
mes "[Coin Manager]";
mes "========= Credits Info ===========";
query_sql ("select account_id,balance from `cp_credits`", .@acid,.@bala);
mes "Account: ^FF0000"+.@acid+"^000000";
mes "Credits: ^00FF00"+.@bala+"^000000";
mes "==============================";
next;
mes "[Coin Manager]";
mes "Okay.";
mes "For every ^00FF00Mithril Coin^000000 you will become ^FF00005x Cash Points^000000!";
mes "How many ^00FF00Mithril Coins^000000 you want to exchange?";
if (countitem(674) >= 1){
next;
input .@nummer;
if (countitem(674) >= .@nummer) {
set .@bala,.@bala+.@nummer*5;
query_sql "UPDATE `cp_credits` SET `balance` = '"+.@bala+"' WHERE account_id = '"+getcharid(3)+"'";
delitem 674,.@nummer;
dispbottom "The exchange was succesfull. You gained ["+.@nummer*5+" Cash Punkte] and you have now ["+.@bala+"].";
close;
I tried many other ways to add the accountid. With insert he became an error or don't made anything.
I don't know how to fix it. All ways I find on google don't solved the problem. Hopefully someone of you can help me.
And sry for my bad english.
Greetings Sere
can't anyone help? T_T
Edited by Emistry use [code] tag for script contents.
Question
Sere
Hello everybody.
I wanted to script a way to get the credits of the donation shop with some ingame items. The NPC I made has his own sql table but my problem is, if I try to insert the accountid of the user he don't add it.
Here is the script :
I tried many other ways to add the accountid. With insert he became an error or don't made anything.
I don't know how to fix it. All ways I find on google don't solved the problem. Hopefully someone of you can help me.
And sry for my bad english.
Greetings Sere
can't anyone help? T_T
Edited by Emistryuse [code] tag for script contents.
Link to comment
Share on other sites
1 answer 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.