[OtraAyudita]No se puede iniciar sesiуn
#1

Bueno tengo otro error :/ resulta que al entrar al server me registro (/register ****) y despues me logeo (/login ****) y me dice "Error"... luego voy a la carpeta donde se guardan los usuarios y me meto a mi nombre y no tiene nada dentro. Me podrian ayudar porfavor
Reply
#2

pega aqui el login y el register ( los codigos )
Reply
#3

Код:
	if (strcmp(cmd, "/register", true) == 0)
	{
	if (logged[playerid] != 1 && !udb_Exists(PlayerName(playerid)))
			{
			new dir[256];
			dir = strtok(cmdtext, idx);
			if (strlen(dir))
		{
			new fname[MAX_STRING];
			format(fname,sizeof(fname),"users/%s.ini",udb_encode(PlayerName(playerid)));
			dini_Create(fname);
			dUserSet(PlayerName(playerid)).("password", dir);
			dUserSet(PlayerName(playerid)).("admin", "0");
			dUserSet(PlayerName(playerid)).("banned", "0");
			dUserSet(PlayerName(playerid)).("owngoals", "0");
			dUserSet(PlayerName(playerid)).("goalsscored", "0");
			dUserSet(PlayerName(playerid)).("gamesplayed", "0");
			SendClientMessage(playerid, COLOR_RED, "Registrado, porfavor logeate con /login");
		}
	}
	else SendClientMessage(playerid, COLOR_RED, "Error al registrarse!");
	return 1;
	}
	if (logged[playerid] == 0) {
	SendClientMessage(playerid, COLOR_YELLOW, "[SERVER] Tienes que estar logeado para usar estos comandos!");
 	return 1;
	}
Код:
	if (strcmp(cmd, "/login", true) == 0)
	{
	   	if (dUserINT(PlayerName(playerid)).("banned") == 1)
		{
    	new pName[MAX_PLAYER_NAME];
    	new string1[128];
    	GetPlayerName(playerid, pName, sizeof(pName));
    	format(string1, sizeof(string1), "%s a sido kickeado del servidor, Rasуn: CUENTA BANEADA.", pName);
    	SendClientMessageToAll(COLOR_RED, string1);
		Kick(playerid);
  		}
		else if (logged[playerid] != 1 && udb_Exists(PlayerName(playerid)))
		{
			new dir[256];
			dir = strtok(cmdtext, idx);
			if (strlen(dir) && strcmp(dir, dUser(PlayerName(playerid)).("password"), true) == 0)
		{
			logged[playerid] = 1;
			new score = dUserINT(PlayerName(playerid)).("goalsscored");
			SetPlayerScore(playerid,score);

			SendClientMessage(playerid, COLOR_RED, "Logeado con excito!");
		}
	}
		else SendClientMessage(playerid, COLOR_RED, "Error al logearse!");
		return 1;
	}
Reply
#4

todo lo que yo veo hay esta un poco confuso asta esto.

pawn Код:
SendClientMessage(playerid, COLOR_RED, "Logeado con excito");
Reply
#5

Un simple error ortografico :$ XD

Bueno creo que tengo el problema mas dificil del mundo :C
Reply
#6

La indentaciуn estб horrible. No se entiende nada en tu cуdigo.
Reply
#7

pawn Код:
dUserSet(fname).("password", dir);
            dUserSet(fname).("admin", "0");
            dUserSet(fname).("banned", "0");
            dUserSet(fname).("owngoals", "0");
            dUserSet(fname).("goalsscored", "0");
            dUserSet(fname).("gamesplayed", "0");
Probб con eso. Igual nunca usй DINI asн que no te aseguro que funcione.
Reply
#8

The Phenix dame tu skype para que hablemos mejor y tal vez me puedas ayudar pliz
Reply
#9

pawn Код:
if (strcmp(cmd, "/register", true) == 0)
{
    if (logged[playerid] != 1 && !udb_Exists(PlayerName(playerid)))
    {
    new tmp4[256];
    tmp4 = strtok(cmdtext, idx);
    if (strlen(tmp4) || strval(tmp4))
    {
    new Str[MAX_STRING];
    format(Str,sizeof(Str),"users/%s.ini",udb_encode(PlayerName(playerid)));
    dini_Create(fname);
    dUserSet(PlayerName(playerid)).("password", udb_hash(tmp4));
    dUserSet(PlayerName(playerid)).("admin", "0");
    dUserSet(PlayerName(playerid)).("banned", "0");
    dUserSet(PlayerName(playerid)).("owngoals", "0");
    dUserSet(PlayerName(playerid)).("goalsscored", "0");
    dUserSet(PlayerName(playerid)).("gamesplayed", "0");
    SendClientMessage(playerid, COLOR_RED, "Registrado, porfavor logeate con /login");
    }else return SendClientMessage(playerid, COLOR_RED, "Error al registrarse!");
    }else return SendClientMessage(playerid, COLOR_RED, "Ya estas registrado!");

    return 1;
}


if (strcmp(cmd, "/login", true) == 0)
{
    new tmp5[256];
    tmp5 = strtok(cmdtext, idx);
    if (dUserINT(PlayerName(playerid)).("banned") == 1) {
    new string4[128];
    format(string4, sizeof(string4), "%s a sido kickeado del servidor, Rasуn: CUENTA BANEADA.", PlayerName(playerid));
    SendClientMessageToAll(COLOR_RED, string4);Kick(playerid); }

    if (logged[playerid] != 1 && udb_Exists(PlayerName(playerid))) {
    if ( udb_hash(tmp5) && strcmp(udb_hash(tmp5), dUser(PlayerName(playerid)).("password"), true) == 0)
    {
    logged[playerid] = 1;
    new score = dUserINT(PlayerName(playerid)).("goalsscored");
    SetPlayerScore(playerid,score);
    SendClientMessage(playerid, COLOR_RED, "Logeado con excito!");
    } else return SendClientMessage(playerid, COLOR_RED, "Error al logearse!");
    } else return SendClientMessage(playerid, COLOR_RED, "Esta cuenta no existe!");
       
    return 1;
}

PD: si no te sirve ps me doy
Reply
#10

Код:
gamemodes\football.pwn(570) : error 035: argument type mismatch (argument 3)
En esta linea:
Код:
    dUserSet(PlayerName(playerid)).("password", udb_hash(tmp4));
-------------------------------------------------------------------------------

Код:
gamemodes\football.pwn(594) : error 035: argument type mismatch (argument 1)
En esta linea:
Код:
    if ( udb_hash(tmp5) && strcmp(udb_hash(tmp5), dUser(PlayerName(playerid)).("password"), true) == 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)