Bringer Posted October 22, 2019 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: April 16 Share Posted October 22, 2019 /*========================================== * @whobuy - List who is buying the item (amount, price, and location). * remake by VoidLess, original by zephyrus_cr * re-edit by deathscythe to work in rAthena *------------------------------------------*/ ACMD_FUNC(whobuy) { char item_name[100]; int item_id, j, count = 0, sat_num = 0; bool flag = 0; // place dot on the minimap? struct map_session_data* pl_sd; struct s_mapiterator* iter; unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; struct item_data *item_data; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); if (!message || !*message || sscanf(message, "%99[^\n]", item_name) < 1) { clif_displaymessage(fd, "Input item name or ID (use: @whobuy <name or ID>)."); return -1; } if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd, 19)); // Invalid item ID or name. return -1; } item_id = item_data->nameid; iter = mapit_getallusers(); for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) { if (pl_sd->state.buyingstore) //check if player is autobuying { for (j = 0; j < pl_sd->buyingstore.slots; j) { if (pl_sd->buyingstore.items[j].nameid == item_id) { snprintf(atcmd_output, CHAT_SIZE_MAX, "Price %d | Amount %d | Buyer %s | Map %s[%d,%d]", pl_sd->buyingstore.items[j].price, pl_sd->buyingstore.items[j].amount, pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); if (pl_sd->buyingstore.items[j].price < MinPrice) MinPrice = pl_sd->buyingstore.items[j].price; if (pl_sd->buyingstore.items[j].price > MaxPrice) MaxPrice = pl_sd->buyingstore.items[j].price; clif_displaymessage(fd, atcmd_output); count; flag = 1; } } if (flag && pl_sd->mapindex == sd->mapindex) { clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, sat_num, 0xFFFFFF); flag = 0; } } } mapit_free(iter); if (count > 0) { snprintf(atcmd_output, CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice); clif_displaymessage(fd, atcmd_output); } else clif_displaymessage(fd, "Nobody buying it now."); return 0; } when use @whobuy 607 error popoout Quote Link to comment Share on other sites More sharing options...
0 Osus Posted December 17, 2019 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 14 Reputation: 0 Joined: 12/03/19 Last Seen: December 23, 2019 Share Posted December 17, 2019 On 10/22/2019 at 4:26 PM, Bringer said: /*========================================== * @whobuy - List who is buying the item (amount, price, and location). * remake by VoidLess, original by zephyrus_cr * re-edit by deathscythe to work in rAthena *------------------------------------------*/ ACMD_FUNC(whobuy) { char item_name[100]; int item_id, j, count = 0, sat_num = 0; bool flag = 0; // place dot on the minimap? struct map_session_data* pl_sd; struct s_mapiterator* iter; unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; struct item_data *item_data; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); if (!message || !*message || sscanf(message, "%99[^\n]", item_name) < 1) { clif_displaymessage(fd, "Input item name or ID (use: @whobuy <name or ID>)."); return -1; } if ((item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd, 19)); // Invalid item ID or name. return -1; } item_id = item_data->nameid; iter = mapit_getallusers(); for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) { if (pl_sd->state.buyingstore) //check if player is autobuying { for (j = 0; j < pl_sd->buyingstore.slots; j) { if (pl_sd->buyingstore.items[j].nameid == item_id) { snprintf(atcmd_output, CHAT_SIZE_MAX, "Price %d | Amount %d | Buyer %s | Map %s[%d,%d]", pl_sd->buyingstore.items[j].price, pl_sd->buyingstore.items[j].amount, pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); if (pl_sd->buyingstore.items[j].price < MinPrice) MinPrice = pl_sd->buyingstore.items[j].price; if (pl_sd->buyingstore.items[j].price > MaxPrice) MaxPrice = pl_sd->buyingstore.items[j].price; clif_displaymessage(fd, atcmd_output); count; flag = 1; } } if (flag && pl_sd->mapindex == sd->mapindex) { clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, sat_num, 0xFFFFFF); flag = 0; } } } mapit_free(iter); if (count > 0) { snprintf(atcmd_output, CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice); clif_displaymessage(fd, atcmd_output); } else clif_displaymessage(fd, "Nobody buying it now."); return 0; } when use @whobuy 607 error popoout you already fixed this? *can you share with us?* Quote Link to comment Share on other sites More sharing options...
0 kalabasa Posted March 5, 2021 Group: Members Topic Count: 123 Topics Per Day: 0.05 Content Count: 478 Reputation: 14 Joined: 11/30/17 Last Seen: January 23 Share Posted March 5, 2021 i want to know also Quote Link to comment Share on other sites More sharing options...
Question
Bringer
when use @whobuy 607 error popoout
Link to comment
Share on other sites
2 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.