nasagnilac Posted November 9, 2013 Group: Members Topic Count: 89 Topics Per Day: 0.02 Content Count: 232 Reputation: 15 Joined: 11/02/13 Last Seen: December 19, 2024 Share Posted November 9, 2013 (edited) query_sql "SELECT `accountid`, `reward_id`, `reward_amount` FROM `rewardaccountnpc`", .@show_name$, .@show_item, .@show_amount; for(set @i, 0; @i < getarraysize(.@show_name$); set @i, @i+1){ } getitem .@show_item[@i],.@show_amount[@i]; Hi.. anyone can help me arrange this script.. I just want to make a menu just like this .... The menu will show list of items from query and the query_sql will automaticaly delete the item on menu once it was gathered. Edited November 9, 2013 by gmprestige Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 9, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2370 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted November 9, 2013 query_sql( "SELECT `accountid`, `reward_id`, `reward_amount` FROM `rewardaccountnpc` ",.@acc_id,.@reward_id,.@reward_amount ); .@size = getarraysize( .@acc_id ); for( .@i = 0; .@i < .@size; .@i++ ) set .@menu$,.@menu$ + .@acc_id[.@i] +" - " + .@reward_amount[.@i] + " x "getitemname( .@reward_id[.@i] ) + ":"; .@i = select( .@menu$ ) - 1; mes "Pick : "+.@acc_id[.@i]; mes "Reward : "+.@reward_amount[.@i] + " x "getitemname( .@reward_id[.@i] ); close; Quote Link to comment Share on other sites More sharing options...
nasagnilac Posted November 9, 2013 Group: Members Topic Count: 89 Topics Per Day: 0.02 Content Count: 232 Reputation: 15 Joined: 11/02/13 Last Seen: December 19, 2024 Author Share Posted November 9, 2013 thanks emistry its not working on me because of .@acc_id I just edit it and works fine... here... query_sql( "SELECT `accountid`, `reward_id`, `reward_amount` FROM `rewardaccountnpc` ",.@acc_id$,.@reward_id,.@reward_amount ); .@size = getarraysize( .@acc_id$ ); for( .@i = 0; .@i < .@size; .@i++ ) set .@menu$,.@menu$ +" "+getitemname( .@reward_id[.@i] ) + " x " + .@reward_amount[.@i] + ":"; .@i = select( .@menu$ ) - 1; getitem .@reward_id[.@i],.@reward_amount[.@i]; query_sql "DELETE FROM `rewardaccountnpc` WHERE `accountid`='"+.@acc_id$+"',`reward_amount`=`"+.@reward_id[.@i]+"`,`reward_id`=`"+.@reward_amount[.@i]+"`"; my problem now is... it doesn't delete the item in the sql.. here is the sql DROP TABLE IF EXISTS `ragnarok`.`rewardaccountnpc`; CREATE TABLE `ragnarok`.`rewardaccountnpc` ( `accountid` tinytext NOT NULL, `reward_id` int(11) NOT NULL, `reward_amount` int(11) NOT NULL, KEY `accountid` (`accountid`(32)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Quote Link to comment Share on other sites More sharing options...
Patskie Posted November 9, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 18 hours ago Share Posted November 9, 2013 prontera,150,150,0 script Sample 100,{ query_sql( "SELECT `accountid`, `reward_id`, `reward_amount` FROM `rewardaccountnpc` ",.@acc_id,.@reward_id,.@reward_amount ); .@size = getarraysize( .@acc_id ); for( .@i = 0; .@i < .@size; .@i++ ) set .@menu$,.@menu$ + .@acc_id[.@i] +" - " + .@reward_amount[.@i] + " x "+getitemname( .@reward_id[.@i] ) + ":"; .@i = select( .@menu$ ) - 1; mes "Pick : "+.@acc_id[.@i]; mes "Reward : "+.@reward_amount[.@i] + " x "+getitemname( .@reward_id[.@i] ); getitem .@reward_id[.@i], .@reward_amount[.@i]; query_sql "DELETE FROM `rewardaccountnpc` WHERE (`accountid` = '"+getcharid(3)+"' AND `reward_id` = '"+.@reward_id[.@i]+ "') AND `reward_amount` = '"+.@reward_amount[.@i]+"'"; close; } Quote Link to comment Share on other sites More sharing options...
Capuche Posted November 9, 2013 Group: Developer Topic Count: 10 Topics Per Day: 0.00 Content Count: 2407 Reputation: 616 Joined: 07/05/12 Last Seen: March 20 Share Posted November 9, 2013 Drop your table, use this one instead : CREATE TABLE IF NOT EXISTS `rewardaccountnpc` ( `account_id` int(11) unsigned NOT NULL, `reward_id` int(11) unsigned NOT NULL, `reward_amount` int(11) unsigned NOT NULL, KEY `account_id` (`account_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; prontera,150,150,0 script Sample 100,{ query_sql( "SELECT `accountid`, `reward_id`, `reward_amount` FROM `rewardaccountnpc` ",.@acc_id,.@reward_id,.@reward_amount ); .@size = getarraysize( .@acc_id ); for( .@i = 0; .@i < .@size; .@i++ ) set .@menu$,.@menu$ + .@acc_id[.@i] +" - " + .@reward_amount[.@i] + " x "+getitemname( .@reward_id[.@i] ) + ":"; .@i = select( .@menu$ ) - 1; mes "Pick : "+.@acc_id[.@i]; mes "Reward : "+.@reward_amount[.@i] + " x "+getitemname( .@reward_id[.@i] ); getitem .@reward_id[.@i], .@reward_amount[.@i], .@acc_id[.@i]; query_sql "DELETE FROM `rewardaccountnpc` WHERE (`accountid` = '"+ .@acc_id[.@i]+"' AND `reward_id` = '"+.@reward_id[.@i]+ "') AND `reward_amount` = '"+.@reward_amount[.@i]+"' limit 1"; close; } Quote Link to comment Share on other sites More sharing options...
nasagnilac Posted November 9, 2013 Group: Members Topic Count: 89 Topics Per Day: 0.02 Content Count: 232 Reputation: 15 Joined: 11/02/13 Last Seen: December 19, 2024 Author Share Posted November 9, 2013 SOLVED ... Thanks to all Quote Link to comment Share on other sites More sharing options...
Question
nasagnilac
Hi.. anyone can help me arrange this script.. I just want to make a menu just like this
.... The menu will show list of items from query and the query_sql will automaticaly delete the item on menu once it was gathered.
Edited by gmprestigeLink to comment
Share on other sites
5 answers 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.