Shop name instead of merchant name for @whosell and @whobuy

Lulupard

New member
Messages
17
Points
0
Hello!

I am using the @whosell and @whobuy plugins from Dastgir's repository.

Currently, these commands show "Seller" and "Buyer" in their respective search results that show the name of the merchant that runs the shop. I was wondering if it was possible to change that to the name of the shop itself.

So this: Amount: 1 | Price: 10000 | Map: prontera[150,150] | Seller: Merchant

would become this: Amount: 1 | Price: 10000 | Map: prontera[150,150] | Shop: Cool stuff

If I understand correctly this is only possible for shops that use @autotrade, while the @whosell command works on every shop? If so, could you please point me to a @whosell command that only works for @autotrading shops, since that is fine with me.

Thank you!

 
Last edited by a moderator:
Whobuy;

snprintf(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);
To
Code:
snprintf(output, CHAT_SIZE_MAX, "Price %d | Amount %d | Shop %s | Map %s[%d,%d]", pl_sd->buyingstore.items[j].price, pl_sd->buyingstore.items[j].amount, pl_sd->message, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y);
Edit:

Whosell, change all

pl_sd->status.name

to

pl_sd->message

 
Last edited by a moderator:
It works! Thank you!

I have another question about this plugin, so I'm just going to ask here and not create another thread.

I have managed to change the output message to display the item's name instead of the ID by replacing:

pl_sd->status.cart[pl_sd->vending[j].index].nameid

with:

item_data->jname

But I'm not able to do the same for the embedded cards. I don't know C, but I'm guessing the itemdb->search_name(item_name) function does not work with card IDs that I'm getting from pl_sd->status.cart[pl_sd->vending[j].index].card[0].

So is it possible to replace the embedded card IDs in the output message with their actual names?

If something like this requires significant amount of work, I'll concider hiring someone later.

Again, thank you for your help with this.

 
sd->status.cart[pl_sd->vending[j].index].card[0]

Till

sd->status.cart[pl_sd->vending[j].index].card[3]

Those variable contains card information.

You should get item name from those, also be sure to check if those values contain 0 or maybe is out of range(named item)

 
Back
Top