Error Format
#1

Hi guys, can you help me please?
I have a problem, with this string
Код:
(124)new name[MAX_PLAYER_NAME+1];
(125)GetPlayerName(playerid, name,MAX_PLAYER_NAME);
(126)Create3DTextLabel("Cadavere di %s", name,0x008080FF, X, Y, Z, 40.0, 0, 0);
But when I compile my FS, compare an error:
(126) error 035: argument type mismatch (argument 2)
Probably is easy to risolve, but I didn't understand the solution
Reply
#2

You need to have a format() to add the name to the string.
pawn Код:
new name[MAX_PLAYER_NAME+1], string[40];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Cadavere di %s", name);
Create3DTextLabel(string,0x008080FF, X, Y, Z, 40.0, 0, 0);
Reply
#3

Quote:
Originally Posted by you10
Посмотреть сообщение
You need to have a format() to add the name to the string.
pawn Код:
new name[MAX_PLAYER_NAME+1], string[40];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "Cadavere di %s", name);
Create3DTextLabel(string,0x008080FF, X, Y, Z, 40.0, 0, 0);
Oh man, thank you!
Rep +1!
Reply
#4

Quote:
Originally Posted by pepy
Посмотреть сообщение
Oh man, thank you!
Rep +1!
you cant give Rep to other people , if u dont have 50+ post
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)