[Help] Array Problem
#1

Alright so I'm trying to save the player's name into an enum, the problem is.

When I do this:
pawn Код:
PlayerInfo[playerid][pName] = ReturnPlayerName(playerid);
It gives me this error:
Код:
error 047: array sizes do not match, or destination array is too small
But if I do this:
pawn Код:
name = ReturnPlayerName(playerid);
PlayerInfo[playerid][pName] = name;
It compiles perfectly...


What I want to do is to get "PlayerInfo[playerid][pName] = ReturnPlayerName(playerid);" working perfectly.


Notes:
PlayerInfo[playerid][pName]'s array is [32], and it's in a public enum.
name's array is [32], and it's inside the command I'm using.
Reply
#2

I though name arrays should be sized 24. Am I right?
Reply
#3

Let me test
Edit: You're the man.
Reply
#4

dont use a number ... use MAX_PLAYERNAME ... will be auto updated in futur version ...
Reply
#5

Код:
format(PlayerInfo[playerid][pName],24,"%s",ReturnPlayerName(playerid));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)