Problem with GetName
#1

So I did something like this:
on the top of the mod:
pawn Код:
enum pInfo
{
    pUserName[24],
    //etc ...
};
new pData[MAX_PLAYERS][pInfo];
OnPlayerConnect:
pawn Код:
GetPlayerName(playerid, pData[playerid][pUserName], 24);
stock GetName:
pawn Код:
stock GetName(playerid) return pData[playerid][pUserName];
but when im trying to use this, i get error: argument type mismatch (argument 2)
line:
pawn Код:
NameTD[playerid] = TextDrawCreate(37.000000, 320.000000, GetName(playerid));
Any solutions ?
Reply
#2

Will u show me ur script I mean I'm confused as t where u r using the TD . is it when you log on to game?
Reply
#3

Are you sure that's the error line? Looks fine to me.

Also, you should use MAX_PLAYER_NAME+1 as your length and string size. Max name is 24, but strings require one more cell for a 'null-terminating' character to denote the end of the string. Either that of set it to 25.
Reply
#4

show us the line where the error comes from
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)