06.08.2011, 12:32
Nice tutorial!
native strformat(dest[], size=sizeof dest, bool: pack=false, const format[], . . . )
The reason for using "23 + MAX_PLAYER_NAME" and not 128 is because the smaller array sizes, the better. 128 is way too much for our small message in this tutorial. Allways make arrays as small as possible.
|
True, using a 128 array size is over than you need.
@ krogsgaard20, To be honest, that tutorial taught me alot. Good tutorial and good job! |
new str[64];
GetPlayerName(playerid,str,MAX_PLAYER_NAME);
format(str,sizeof(str),"Hello %s",str);
You can quite easily count the characters you need by looking at the 'Col' value in the bottom-right-corner of Pawno (or any other editor for that matter) for the start and end of the string and subtracting them from each other.
As for point 3 that Y_Less stated, I assume that will pad the string with dots, in some way. |
format(string,sizeof(string),"(( %s %s: %s ))",atext,RemoveUnderScore(playerid),result); |
I've got a problem idk its reason,
error 012: invalid function call, not a valid address warning 215: expression has no effect error 001: expected token: ";", but found ")" error 029: invalid expression, assumed zero fatal error 107: too many error messages on one line Line : |
format(string,sizeof(string),"%s %s %s",atext,RemoveUnderScore(playerid),result);