SA-MP Forums Archive
How to fix this error? - 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: How to fix this error? (/showthread.php?tid=72370)



How to fix this error? - SEC - 08.04.2009

Hi,
I m trying to make a account system with Rafeldersґs SimpleFiles and i get this error.

Command:
Код:
  new cmd[256], idx;
	cmd = strtok(cmdtext, idx);
	new password[64];

	if(Command("/register"))
	{
		password = strtok(cmdtext, idx); //it says here is the error
		if(!strlen(password)) return SendClientMessage(playerid, COLOR_FALSE, "[USAGE]: \"/register <password>\"");
		if(FileExists(PlayerName(playerid))) return SendClientMessage(playerid, COLOR_FALSE, "[ERROR]: Your account already exists!");
		FileCreate(PlayerName(playerid), password);
		SendClientMessage(playerid, COLOR_TRUE, "[SUCESS]: Account sucessfully created! You can now log in with \"/login <password>\".");
		return 1;
	}
Error:
Код:
C:\Dokumente und Einstellungen\Jasper\Desktop\SimpleFiles\Reg-Log FS\SFReg-LogFS.pwn(45) : error 047: array sizes do not match, or destination array is too small
I hope you can help me.



Re: How to fix this error? - MenaceX^ - 08.04.2009

Make it bigger, the array size doesn't mutch.. Do exactly like it says.
I'd suggest you to change cmd[256] to cmd[128]
and password[64] to [128].


Re: How to fix this error? - Nubotron - 08.04.2009

Or do not use strtok because you dont need it


Re: How to fix this error? - MenaceX^ - 08.04.2009

Maybe he does need it, on other commands. /register was an example.