SA-MP Forums Archive
register problem code - 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: register problem code (/showthread.php?tid=75084)



register problem code - Typhome - 28.04.2009

Код:
	if (strcmp(cmd, "/register", true) == 0) // Registers an account
	{
	  if(IsPlayerConnected(playerid))
	  {
	    if(AccountInfo[playerid][Logged] == 1)
			{
				SendClientMessage(playerid, RED, "You are already logged in.");
				return 1;
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "/sAccounts/%s.ini", sendername);
			new File: hFile = fopen(string, io_read);
			if (hFile)
			{
				SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
				fclose(hFile);
				return 1;
			}
	    new tmppass[128];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /register [password]");
			strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
			OnPlayerRegister(playerid, MD5_Hash(tmppass));
		}
		return 1;
	}
I typed /register password

and the command doenst work :/


Re: register problem code - Weirdosport - 28.04.2009

Quote:
Originally Posted by Matuu
I typed /register password

and the command doenst work :/
Be a little more specific, does it say unknown command? What happens?


Re: register problem code - Typhome - 28.04.2009

I type /register (my password) and didnt says or nothing :/


Re: register problem code - Think - 28.04.2009

Quote:
Originally Posted by Matuu
I type /register (my password) and didnt says or nothing :/
put Print("test - Register"); after each if and than check how many there are printed in server_log.txt tan you can see where the problem is.


Re: register problem code - Typhome - 28.04.2009

srry, where i do put ?


Re: register problem code - Think - 28.04.2009

Quote:
Originally Posted by Matuu
srry, where i do put ?
after each if(


Re: register problem code - Typhome - 29.04.2009

Is that correct ?
Код:
	if (strcmp(cmd, "/register", true) == 0) // Registers an account
	Print("test - Register"); 
	{
	  if(IsPlayerConnected(playerid))
	  {
If yes, then i got errors.
Код:
C:\Documents and Settings\Martin\Desktop\SA-MP server\gamemodes\ESTCNR.pwn(2339) : error 017: undefined symbol "Print"
C:\Documents and Settings\Martin\Desktop\SA-MP server\gamemodes\ESTCNR.pwn(2366) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: register problem code - Diler - 29.04.2009

Код:
if (strcmp(cmd, "/register", true) == 0) // Registers an account
	{
    print("test - Register"); 
	  if(IsPlayerConnected(playerid))
	  {



Re: register problem code - Typhome - 29.04.2009

Thanks, i did now, look at attachement

[attachment deleted by admin]


Re: register problem code - Typhome - 29.04.2009

I SOLVED IT!

I created folder "sAccounts" and worked im idiot
[me=Matuu]locking the topic.[/me]