Quote:
Originally Posted by Mofforg
Is that correct?
PHP Code:
static shortname[25]; format(shortname, 24, "Short name!%d", random_num(1,999999)) set_user_info(id, "name", shortname)
|
It's alright, but you should use
formatex for more efficiency. Check that:
http://docs.sourcemod.net/api/
First, check for
Format and then for
FormatEx to see the difference. They'll make you understand better than me. This is for Source Mod, but the documentation seems better and the natives are approximately same.
An example:
PHP Code:
static AString[32];
AString = "claudiuhks";
format(AString, 31, "hattrick_%s", AString);
//result: hattrick_claudiuhks
static BString[32];
BString = "claudiuhks";
formatex(BString, 31, "hattrick_claudiuhks" /* can't use argument BString since you format it */);
//result: hattrick_claudiuhks
__________________