How to fix this error?
#1

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

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].
Reply
#3

Or do not use strtok because you dont need it
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)