Jump to content
  • 0
Sign in to follow this  
astralprojection

how to snprintf (new line)

Question

				    snprintf(atcmd_output, CHAT_SIZE_MAX, "Price: %u | Amount: %d | Map: %s (%d,%d) | Shop: %s <how to show the next data in newline?> +%d %d[%d][%d][%d][%d]"
						    ,pl_sd->vending[j].value
						    ,pl_sd->vending[j].amount
						    ,map->list[pl_sd->bl.m].name
						    ,pl_sd->bl.x,pl_sd->bl.y
						    ,pl_sd->message
						    ,pl_sd->status.cart[pl_sd->vending[j].index].refine
						    ,pl_sd->status.cart[pl_sd->vending[j].index].nameid
						    ,pl_sd->status.cart[pl_sd->vending[j].index].card[0]
						    ,pl_sd->status.cart[pl_sd->vending[j].index].card[1]
						    ,pl_sd->status.cart[pl_sd->vending[j].index].card[2]
						    ,pl_sd->status.cart[pl_sd->vending[j].index].card[3]);

I tried to put \n but it keeps displaying in same line.  

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I hope you are not asking dump question

safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Price: %u | Amount: %d | Map: %s (%d,%d)",
	    pl_sd->vending[j].value,
	    pl_sd->vending[j].amount,
	    map->list[pl_sd->bl.m].name,
	    pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Shop: %s +%d %d[%d][%d][%d][%d]",
	    pl_sd->message,
	    pl_sd->status.cart[pl_sd->vending[j].index].refine,
	    pl_sd->status.cart[pl_sd->vending[j].index].nameid,
	    pl_sd->status.cart[pl_sd->vending[j].index].card[0],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[1],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[2],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[3]);
clif->message(fd, atcmd_output);

 

Share this post


Link to post
Share on other sites
  • 0
16 hours ago, AnnieRuru said:

I hope you are not asking dump question


safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Price: %u | Amount: %d | Map: %s (%d,%d)",
	    pl_sd->vending[j].value,
	    pl_sd->vending[j].amount,
	    map->list[pl_sd->bl.m].name,
	    pl_sd->bl.x, pl_sd->bl.y);
clif->message(fd, atcmd_output);
safesnprintf(atcmd_output, CHAT_SIZE_MAX, "Shop: %s +%d %d[%d][%d][%d][%d]",
	    pl_sd->message,
	    pl_sd->status.cart[pl_sd->vending[j].index].refine,
	    pl_sd->status.cart[pl_sd->vending[j].index].nameid,
	    pl_sd->status.cart[pl_sd->vending[j].index].card[0],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[1],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[2],
	    pl_sd->status.cart[pl_sd->vending[j].index].card[3]);
clif->message(fd, atcmd_output);

 

It did good as expected.  Thank you @AnnieRuru

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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