14.12.2009, 06:47
The error is this line: PlayerInfo[playerid][pCodename] = result;
Please help me, I just started scripting again, and it's a bit hard haha. Thank you.
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\Wasted.pwn(11708) : error 006: must be assigned to an array Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Код:
if(strcmp(cmd, "/codename", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 4)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /codename [newname]");
return 1;
}
format(string, sizeof(string), "%s", result);
PlayerInfo[playerid][pCodename] = result; <------- THE ERROR IS HERE.
format(string, sizeof(string), "* Codename changed to %s.", PlayerInfo[playerid][pCodename]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
return 1;
}
}

