[Help] Array Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Array Problem (
/showthread.php?tid=161234)
[Help] Array Problem -
Dudits - 19.07.2010
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.
Re: [Help] Array Problem -
Mystique - 19.07.2010
I though name arrays should be sized 24. Am I right?
Re: [Help] Array Problem -
Dudits - 19.07.2010
Let me test
Edit: You're the man.
Re: [Help] Array Problem -
snoob - 19.07.2010
dont use a number ... use MAX_PLAYERNAME ... will be auto updated in futur version ...
Re: [Help] Array Problem -
Jefff - 20.07.2010
Код:
format(PlayerInfo[playerid][pName],24,"%s",ReturnPlayerName(playerid));