Error [Help]
#1

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.
Reply
#2

No. * Mike Garber thinks of the avatar even if he's not jew
Reply
#3

Bump. Can anyone figure this shit out?
Reply
#4

Pretty old thread but, I would like to know answer to that aswell^
Reply
#5

Try this.

pawn Код:
strmid(PlayerInfo[playerid][pCodename], string, 0, strlen(string), 255);
Reply
#6

Works! Thanks man.
Reply
#7

Yeah now I got it "working", but this might sound stupid but... What is it supposed to do ingame?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)