yuhsing

Untitled

Jan 11th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2.  
  3. - script ItemCount -1,{
  4. OnWhisperGlobal:
  5. if( getitemname( atoi( @whispervar0$ ) ) != "null" ){
  6.  
  7. set .@item_id,atoi( @whispervar0$ );
  8.  
  9. if( .@item_id ){
  10. query_sql("SELECT SUM(`amount`) FROM `inventory` WHERE `nameid`='"+.@item_id+"'",.@inventory);
  11. query_sql("SELECT SUM(`amount`) FROM `cart_inventory` WHERE `nameid`='"+.@item_id+"'",.@cart);
  12. query_sql("SELECT SUM(`amount`) FROM `guild_storage` WHERE `nameid`='"+.@item_id+"'",.@gstore);
  13. query_sql("SELECT SUM(`amount`) FROM `storage` WHERE `nameid`='"+.@item_id+"'",.@storage);
  14. query_sql("SELECT SUM(`amount`) FROM `mail` WHERE `nameid`='"+.@item_id+"'",.@mail);
  15.  
  16. set .@total,( .@inventory + .@cart + .@gstore + .@storage + .@mail );
  17. dispbottom "Found "+.@total+" x "+getitemname( .@item_id );
  18. }
  19.  
  20. }else{
  21. dispbottom "Invalid Item ID";
  22. }
  23. end;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment