Jump to content
  • 0
Lulupard

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

Question

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!

Edited by Lulupard

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

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

Share this post


Link to post
Share on other sites
  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

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)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.