register problem code
#1

Код:
	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 :/
Reply
#2

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?
Reply
#3

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

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

srry, where i do put ?
Reply
#6

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

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

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

Thanks, i did now, look at attachement

[attachment deleted by admin]
Reply
#10

I SOLVED IT!

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


Forum Jump:


Users browsing this thread: 1 Guest(s)