joelolopez Posted December 11, 2016 Posted December 11, 2016 (edited) i want to sell all mvp cards price + 25000000.. i need to match up the .@id[.@index] to all mvpcards inside the array, but its not working.. how to make this work setarray .NoMvp_ids[0],4001,4002; for( set .@i,0; .@i<getarraysize(.NoMvp_ids); set .@i,.@i+1 ) { if(.@type == 6 && .@id[.@index] == .NoMvp_ids[.@i] ) { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 25000000); } else { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 1000000); } } Edited December 11, 2016 by Emistry Please use CODEBOX. Quote
0 Emistry Posted December 11, 2016 Posted December 11, 2016 .@total_cost += ( (.@price_buy[.@index] ) + 25000000); change to .@total_cost += 25000000; Quote
0 joelolopez Posted December 11, 2016 Author Posted December 11, 2016 @emistry price is working properly but the array is the problem, when i put it like this its working, but i need to compare .@id[.@index] with a couple of mvp ids and i cant make it work setarray .NoMvp_ids[0],4001,4002; // for( set .@i,0; .@i<getarraysize(.NoMvp_ids); set .@i,.@i+1 ) { if(.@type == 6 && .@id[.@index] == 4001 ) { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 25000000); } else { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 1000000); } // } Quote
0 Emistry Posted December 11, 2016 Posted December 11, 2016 you didnt add the checking condition for the mvp cards... change if(.@type == 6 && .@id[.@index] == 4001 ) change to if(.@type == 6 && .@id[.@index] == .NoMvp_ids[0][.@i] ) Quote
Question
joelolopez
i want to sell all mvp cards price + 25000000..
i need to match up the .@id[.@index] to all mvpcards inside the array, but its not working.. how to make this work
setarray .NoMvp_ids[0],4001,4002; for( set .@i,0; .@i<getarraysize(.NoMvp_ids); set .@i,.@i+1 ) { if(.@type == 6 && .@id[.@index] == .NoMvp_ids[.@i] ) { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 25000000); } else { .@total_cost = 0; .@total_cost += ( (.@price_buy[.@index] ) + 1000000); } }
Please use CODEBOX.
3 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.