Jump to content
  • 0

Adding Char[24] to constant String


Skorm

Question


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   219
  • Joined:  11/22/11
  • Last Seen:  

use sprintf to mix your string

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

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...