[Ayuda] Comando
#4

El cуdigo esta muy desordenado.
Te dejo un cуdigo simple y funcional ^^;

pawn Код:
dcmd_login(playerid, params[])
{
    new Nombre[24];
    GetPlayerName(playerid, Nombre, sizeof(Nombre));
    format(File, sizeof(File), PlayerFile, Nombre);

    if(!dini_Exists(File)) SendClientMessage(playerid, COLOR_ROJO, "Error: Cuenta sin registrar");
    if(isnull(params)) return SendClientMessage(playerid, COLOR_ROJO, "Uso: /login <password>");

    if(IsLogged[playerid] == 1) SendClientMessage(playerid, COLOR_ROJO, "Error: Ya has iniciado sesion");
    if(udb_hash(params) != dini_Int(File, "hashPW")) return SendClientMessage(playerid, COLOR_ROJO, "La contraseсa que ingresaste es incorrecta!");
   
    IsLogged[playerid] = 1;
    pInfo[playerid][Nivel] = dini_Int(File, "Nivel");
    SetPlayerScore(playerid, pInfo[playerid][Score]);
    GivePlayerMoney(playerid, dini_Int(File, "Dinero")-GetPlayerMoney(playerid));
    format(string, sizeof(string), "|- %s Has iniciado sesion correctamente -|", Nombre);
    SendClientMessage(playerid, COLOR_VERDE, string);

    return 1;
}
No lo probe, pero va a funcionar :B

PD: yo use el udb_hash de Dudb, tu usa el que quieras xD.
Reply


Messages In This Thread
[Ayuda] Comando - by [00]Luis - 29.09.2011, 21:28
Re: [Ayuda] Comando - by Xyrex - 29.09.2011, 21:42
Respuesta: [Ayuda] Comando - by [00]Luis - 30.09.2011, 18:51
Respuesta: [Ayuda] Comando - by leaNN! - 30.09.2011, 20:33
Respuesta: [Ayuda] Comando - by [00]Luis - 30.09.2011, 20:47
Respuesta: [Ayuda] Comando - by leaNN! - 30.09.2011, 23:40

Forum Jump:


Users browsing this thread: 1 Guest(s)