yuhsing

Untitled

Oct 13th, 2013
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1.  
  2.  
  3. - script ItemCount -1,{
  4. OnWhisperGlobal:
  5. if( getgmlevel() < 90 ) end;
  6. if( getitemname( atoi( @whispervar0$ ) ) != "null" ){
  7.  
  8. set .@item_id,atoi( @whispervar0$ );
  9.  
  10. if( .@item_id ){
  11. for( set .@i,0; .@i < .sql_size; set .@i,.@i + 1 ){
  12. query_sql( "SELECT SUM(`amount`) FROM `"+.sql_table$[.@i]+"` WHERE `nameid`='"+.@item_id+"'",.@amount );
  13. query_sql( "SELECT COUNT(`card0`) FROM `"+.sql_table$[.@i]+"` WHERE `card0`='"+.@item_id+"'",.@card0 );
  14. query_sql( "SELECT COUNT(`card1`) FROM `"+.sql_table$[.@i]+"` WHERE `card1`='"+.@item_id+"'",.@card1 );
  15. query_sql( "SELECT COUNT(`card2`) FROM `"+.sql_table$[.@i]+"` WHERE `card2`='"+.@item_id+"'",.@card2 );
  16. query_sql( "SELECT COUNT(`card3`) FROM `"+.sql_table$[.@i]+"` WHERE `card3`='"+.@item_id+"'",.@card3 );
  17. set .@total,.@total + ( .@amount + .@card0 + .@card1 + .@card2 + .@card3 );
  18. }
  19.  
  20. dispbottom "Found "+.@total+" x "+getitemname( .@item_id );
  21. }
  22. }else{
  23. dispbottom "Invalid Item ID";
  24. }
  25. end;
  26.  
  27. OnInit:
  28. setarray .sql_table$[0],"inventory","cart_inventory","guild_storage","storage","mail";
  29. set .sql_size,getarraysize( .sql_table$ );
  30. end;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment