Jump to content
  • 0

Adding Char[24] to constant String


Question

Posted (edited)

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

2 answers to this question

Recommended Posts

Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...