format as a non void function
#1

Hello,

I was asking myself, if anyone could recreate the "format" function as a function that returns a string instead of formatting one that already exists, like that:

PHP код:
SendClientMessage(playerid,-1,format("%s is %i years old.",name,age)); 
I don't know how to do that, neither did i find smth like that, i hope someone can help.

greetings Marcel
Reply
#2

This has already been done.

String library by Slice. "strlib"
The function you are looking for in there is "sprintf" and it works exactly as you suggested.
Reply
#3

Thanks for the help ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)