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

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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)