SA-MP Forums Archive
A little help.. - 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: A little help.. (/showthread.php?tid=110492)



A little help.. - Danny_Costelo - 26.11.2009

GetPlayerName(playerid, name, 24);
pInfo[playerid][pName] = name;

I get the following error: error 006: must be assigned to an array

what's wrong? D:


Re: A little help.. - miokie - 26.11.2009

What does Your define for pName Look like?


Re: A little help.. - Dujma - 26.11.2009

Use strmid


Re: A little help.. - LarzI - 26.11.2009

'name' is a string, so I would recommend doing :
pawn Код:
format(pInfo[playerid][pName], sizeof(pInfo[playerid][pName]), "%s", name);
Oh and remember to define your pName as a string also:P


Re: A little help.. - Danny_Costelo - 26.11.2009

Quote:
Originally Posted by Dujma
Use strmid
Mind showing an example?
pawn Код:
enum Info
{ // Removed other stuff.
    pName,
    IP
};
new pInfo[MAX_PLAYERS][Info];
This is how the 'pInfo' code looks.


Re: A little help.. - LarzI - 27.11.2009

change pName, to
pawn Код:
pName[24],