[Tutorial] Beginner to Intermediate guide - String formatting
#8

Quote:
Originally Posted by XXpro
View Post
Wow nice nice nice nice you got my rep
Thanks, glad it helped.

Quote:
Originally Posted by Pottus
View Post
Code:
ew playerName[MAX_PLAYER_NAME], output[128], playerid = 9;

GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(output, sizeof(output), "[Info]: the player with the id of %d is called {FFFF00}%s.", playerid, playerName);SendClientMessageToAll(0, output);
Just going to point out that when defining strings with a size of MAX_PLAYER_NAME it should be MAX_PLAYER_NAME+1 to take in account the null terminator if the player name is indeed the maximum.
Thank you very much, fixed.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)