Error [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: Error [Help] (
/showthread.php?tid=113510)
Error [Help] -
Oi! - 14.12.2009
The error is this line: PlayerInfo[playerid][pCodename] = result;
Код:
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;
}
}
Please help me, I just started scripting again, and it's a bit hard haha. Thank you.
Re: Error [Help] -
Mike Garber - 14.12.2009
No.
* Mike Garber thinks of the avatar even if he's not jew
Re: Error [Help] -
Oi! - 22.12.2009
Bump. Can anyone figure this shit out?
Re: Error [Help] -
Chemical - 03.03.2011
Pretty old thread but, I would like to know answer to that aswell^
Re: Error [Help] -
Antonio [G-RP] - 03.03.2011
Try this.
pawn Код:
strmid(PlayerInfo[playerid][pCodename], string, 0, strlen(string), 255);
Re: Error [Help] -
Chemical - 03.03.2011
Works! Thanks man.
Re: Error [Help] -
Chemical - 03.03.2011
Yeah now I got it "working", but this might sound stupid but... What is it supposed to do ingame?