Hi
means?
<> is the operator for "not equal", the same as !=
Hi! i got problems when updating the cp_credits, i wiped out my server, then i try to vote, when i try to convert my votepoints to credits, it doesnt updating. please help.
Because update only works if there is something in the database to edit...
query_sql "SELECT `account_id` FROM `cp_credits` WHERE `account_id` = "+getcharid(3)+";",.@a;
mes "You have a total of "+#VOTEPOINTS+" Vote Points.";
mes "Would you like to convert it to credits?";
mes "^ff0000Note:^000000 1 Vote Points = 1 Credits.";
next;
switch(select("Let me think first.:Yes, let's continue.")) {
case 1:
mes .npcName$;
mes "Come back if you already want to talk to me.";
close;
case 2:
if(#VOTEPOINTS < 1) {
mes .npcName$;
mes "You don't have enough Vote Points to convert.";
close;
} else {
mes .npcName$;
mes "Put your desired amount to be converted.";
}
input @vote,0,#VOTEPOINTS;
if( @vote < #VOTEPOINTS ) {
next;
mes .npcName$;
mes "Not enough Vote Points.";
close;
} else {
next;
mes .npcName$;
mes "Thank you! and come again.";
if(.@a) query_sql "UPDATE `cp_credits` SET `balance` = `balance` + " + @vote + " WHERE `account_id` = " + getcharid(3) + " AND `balance` <> 0;";
else query_sql "INSERT INTO `cp_credits` (account_id, balance) VALUES ("+getcharid(3)+", "+@vote+")";
set #VOTEPOINTS,#VOTEPOINTS-@vote;
close;
}
}
Thanks! it worked, but i have notice that there is a problem, for example, i have 10 Vote Points, and i only want to convert 8 Points, it says i dont have enough vote points, but if i put the exact amount of my vote points, the npc will accept my input and then it will convert it.