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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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