[POMOC] Reg/Log sistem

Započeo xXxlumpiexXx, Septembar 17, 2011, 10:16:13 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Radim mod od 0


Detaljan opis problema: Napravio sam register/login sistem. Pa sad neznam kako da napravim da nakon registracije da mu se pokaze dialog za logiranje


Dio skripte: Evo Reg/Log sistema: //--------------------------------------Login/Register Sistem--------------------------------------------------------
public OnPlayerConnect(playerid)
{
IsLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), "Racuni/%s.ini", name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registracija", "Dobrodosli na {4CB816}test {54DAFF}server\n\n\n{FFFFFF}Molimo registrirajte se kako bi se vasi podaci spremili.", "Registracija", "Odustani");
    }
    if(fexist(file))
    {
       ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Prijava", "Molimo upisite svoju lozinku kako bi se logirali.", "Prijava", "Odustani");
    }
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new name[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "Racuni/%s.ini", name);
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registracija", "Dobrodosli na {4CB816}test {54DAFF}server\n\n\n{FFFFFF}Molimo registrirajte se kako bi se vasi podaci spremili.", "Registracija", "Odustani");
dini_Create(file);
dini_IntSet(file, "Password", udb_hash(inputtext));
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][AdminLevel] = 0);
dini_IntSet(file, "Cash",PlayerInfo[playerid][Cash] = 500);
dini_IntSet(file, "Score",PlayerInfo[playerid][Score] = 0);
dini_IntSet(file, "Job",PlayerInfo[playerid][Job] = 0);
dini_IntSet(file, "Color",PlayerInfo[playerid][Color] = 0);
dini_IntSet(file, "Vw",PlayerInfo[playerid][Vw] = 0);
dini_IntSet(file, "Int",PlayerInfo[playerid][Int] = 0);
dini_IntSet(file, "Warns",PlayerInfo[playerid][Warns] = 0);
dini_IntSet(file, "Fleader",PlayerInfo[playerid][Fleader] = 0);
dini_IntSet(file, "Fmember",PlayerInfo[playerid][Fmember] = 0);
format(string, 128, "{54DAFF}Uspjesno ste se registirali. {FF0000}Podaci: Ime: %s {FF00CC}| {FF0000}Lozinka: %s {54DAFF}. ", name, inputtext);
SendClientMessage(playerid, 0xFF00CC, string);
IsLogged[playerid] = 0;
}

if (dialogid == 2)
{
      new name[MAX_PLAYER_NAME];
      GetPlayerName(playerid, name, sizeof(name));
      format(file, sizeof(file), "Racuni/%s.ini", name);
      if(!response) return Kick(playerid);
      if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Prijava", "Molimo upisite svoju lozinku kako bi se logirali.", "Prijava", "Odustani");
      new tmp;
      tmp = dini_Int(file, "Password");
      if(udb_hash(inputtext) != tmp) {
      SendClientMessage(playerid, 0xFF0000FF, "Pogresna Lozinka.");
      ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Prijava", "Molimo upisite svoju lozinku kako bi se logirali.", "Prijava", "Odustani");
      }
      else
      {
IsLogged[playerid] = 1;
      SetPlayerMoney(playerid, dini_Int(file, "Cash"));
      SetPlayerScore(playerid, dini_Int(file, "Score"));
      SetPlayerColor(playerid, dini_Int(file, "Color"));
      SetPlayerVirtualWorld(playerid, dini_Int(file, "Vw"));
      SetPlayerInterior(playerid, dini_Int(file, "Int"));
      PlayerInfo[playerid][Job] = dini_Int(file, "Job");
      PlayerInfo[playerid][Warns] = dini_Int(file, "Warns");
      PlayerInfo[playerid][Fleader] = dini_Int(file, "Fleader");
      PlayerInfo[playerid][Fmember] = dini_Int(file, "Fmember");
      PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
SendClientMessage(playerid,0xFF00CC, "Dobrodosao ljepo te je opet vidjeti na serveru.");
}
}
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new name[24];
    GetPlayerName(playerid,name,24);
    format(file,sizeof(file),"Racuni/%s.ini",name);
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Cash",GetPlayerMoney(playerid));
        dini_IntSet(file,"Score",GetPlayerScore(playerid));
        dini_IntSet(file,"Color",GetPlayerColor(playerid));
        dini_IntSet(file,"AdminLevel",PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file,"Job",PlayerInfo[playerid][Job]);
        dini_IntSet(file,"Vw",GetPlayerVirtualWorld(playerid));
        dini_IntSet(file,"Int",GetPlayerInterior(playerid));
        dini_IntSet(file,"Warns",PlayerInfo[playerid][Warns]);
        dini_IntSet(file,"Fleader",PlayerInfo[playerid][Fleader]);
        dini_IntSet(file,"Fmember",PlayerInfo[playerid][Fmember]);
        IsLogged[playerid] = 0;
    return 1;
    }
    return 1;
}



Neke slike/video za lakse dobivanje pomoci(neobavezno):