Jump to content
  • 0
Skorm

Adding Char[24] to constant String

Question

This might sound like a stupid question but I'm new to source so stay with me!

 

I would like to do something like this.

 

 

mob_once_spawn(BL_CAST(BL_PC, src),src->m,src->x+_x,src->y+_y,"("+sd->status.name+")"+"Monster",1001,1,"",SZ_SMALL,AI_NONE);

 

But "("+sd->status.name+")"+"Monster" doesn't work.

 

I've also tried StringBuf_AppendStr(sd->status.name, "Monster").

 

I'm really not sure how to use it though. :(

Edited by Skorm
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

use sprintf to mix your string

 

It probably would've helped a little more had you shown me an example with the information I provided but I was able to piece everything together.

 

 

char output[128];
sprintf(output, "(%s)Monster", status_get_name(src));
mob_once_spawn(BL_CAST(BL_PC, src),src->m,src->x+_x,src->y+_y,output,1001,1,"",SZ_SMALL,AI_NONE);
Edited by Skorm
Link to comment
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.   Paste as plain text instead

  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.



×
×
  • Create New...

Important Information

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