Advertisement
Guest User

Untitled

a guest
Sep 13th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1.     int item_id_req = 501;  // item id
  2.     int item_qty_req = 5;   // item quantity
  3.     int i = 0, found = 0;
  4.    
  5.     for (; i < MAX_INVENTORY; i++)
  6.     {
  7.         if (sd->status.inventory[i].nameid == item_id_req &&
  8.             sd->status.inventory[i].amount >= item_qty_req &&
  9.             !sd->status.inventory[i].equip &&
  10.             sd->status.inventory[i].identify)
  11.         {
  12.             found = 1;
  13.         }
  14.         else
  15.             continue;
  16.     }
  17.    
  18.     if (!found)
  19.     {
  20.         sprintf(atcmd_output, "You need %dx %s in order to use this command", item_qty_req, itemdb_jname(item_id_req));
  21.         clif_displaymessage(sd->fd, atcmd_output);
  22.         return -1;
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement