SA-MP Forums Archive
[HELP] Cant fix this, 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: [HELP] Cant fix this, help... (/showthread.php?tid=86635)



[HELP] Cant fix this, help... - FreddeN - 15.07.2009

I get thise errors...

1,
Код:
undefined symbol "playrname"
2,
Код:
undefined symbol "playrname"
3,
Код:
invalid expression, assumed zero
4,
Код:
too many error messages on one line
All errors are from Line 77.

Here is my script, http://pastebin.com/f70fe40c0

Thanks so mutch for the help




Re: [HELP] Cant fix this, help... - yom - 15.07.2009

Declare it.


Re: [HELP] Cant fix this, help... - Correlli - 15.07.2009

You should learn some basics first.

And like 0rb said, declare it:
new playrname[MAX_PLAYER_NAME];


Re: [HELP] Cant fix this, help... - Vince - 15.07.2009

Probably you just misspelled it. Try playername.


Re: [HELP] Cant fix this, help... - FreddeN - 15.07.2009

Quote:
Originally Posted by Don Correlli
You should learn some basics first.

And like 0rb said, declare it:
new playrname[MAX_PLAYER_NAME];
I did, but it didnt work


Re: [HELP] Cant fix this, help... - FreddeN - 15.07.2009

Well, it works with
Код:
new playrname[MAX_PLAYER_NAME];
But when I putted that in, it want
Код:
new connect[128];
When I put it right under playrname, it gives me 20 errors...


Re: [HELP] Cant fix this, help... - Correlli - 15.07.2009

Oh, i see you're formatting player's account with 'connect'.
Try:
pawn Код:
new connect[64];
MAX_PLAYER_NAME has size of 24 cells, i think that is too small for formatting in your case.


Re: [HELP] Cant fix this, help... - FreddeN - 15.07.2009

Here is the full script where the 4 errors comes from.

Код:
public OnPlayerConnect(playerid)
{
  new playrname[MAX_PLAYER_NAME];
  new connect[128];
	GetPlayerName(playerid, playrname, sizeof(playrname));
	format(connect, sizeof(connect), "%s.ini", playrname);
	if(fexist(connect))
	{
		gPlayerAccount[playerid] = 1;
		SendClientMessage(playerid, COLOR_YELLOW, "You are registered, please login with /login password");
		return 1;
	}
	else
	{
		gPlayerAccount[playerid] = 0;
		SendClientMessage(playerid, COLOR_YELLOW, "You are new here or not registered, please register with /register password");
	}

	return 1;
}
It dont want the line
Код:
new connect[128];
to be there, the full script goes nuts if I keep new connect[128]; there