I'm trying to create a script were the top 3 MvP players get 3x Old card album. Everything seems to go well, the table truncates fine but the issue is that the reward isn't put in the players inventory.
What did I do wrong?
MvPRank:
mes "This will clear the current MvP ranking.";
menu "Do it!",-;
next;
mes "[Rank Controller]";
mes "Inserting prize for Top 3 Player...";
query_sql( "SELECT `char_id`, `key`, `value` FROM `char_reg_num` ORDER BY `value` DESC LIMIT 3",.@char_idmvp, .@key, .@Count );
query_sql( "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify`) VALUES ("+.@char_idmvp+", "+617+", "+3+", 0, 1)");
sleep2 500;
mes "Truncating MvP ranking tables....";
query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'MVP_Rank'");
sleep2 1000;
mes "All done~";
close;
Question
HristDead
Hi rAthena!
I'm trying to create a script were the top 3 MvP players get 3x Old card album. Everything seems to go well, the table truncates fine but the issue is that the reward isn't put in the players inventory.
What did I do wrong?
MvPRank: mes "This will clear the current MvP ranking."; menu "Do it!",-; next; mes "[Rank Controller]"; mes "Inserting prize for Top 3 Player..."; query_sql( "SELECT `char_id`, `key`, `value` FROM `char_reg_num` ORDER BY `value` DESC LIMIT 3",.@char_idmvp, .@key, .@Count ); query_sql( "INSERT INTO `inventory` (`char_id`, `nameid`, `amount`, `equip`, `identify`) VALUES ("+.@char_idmvp+", "+617+", "+3+", 0, 1)"); sleep2 500; mes "Truncating MvP ranking tables...."; query_sql("DELETE FROM `char_reg_num` WHERE `key` = 'MVP_Rank'"); sleep2 1000; mes "All done~"; close;
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.