[Pomoc]Register

Započeo JusT, Septembar 06, 2011, 21:40:29 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

JusT

Skripta koju koristim:Columbus (moja od 0)
Detaljan opis problema:Kako da napravim register sistem netreba mi FS nego u mod da ubacim
Dio skripte:///////////////
Neke slike/video za lakse dobivanje pomoci(neobavezno)://////

Evo ti moj register/Login sistem nista koplicirano jednostavan je.(nema bagova).

//--------------------------------------Login/Register Sistem--------------------------------------------------------
public OnPlayerConnect(playerid)
{
IsLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), "users/%s.ini", name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registracija", "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), "users/%s.ini", name);
if(!response) return Kick(playerid);
if(!strlen(inputtext)) return
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registracija","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, "Uspjesno si se Registrirao Ime: %s lozinka: %s, automatski si prijavljen!", name, inputtext);
SendClientMessage(playerid, 0xFF00CC, string);
IsLogged[playerid] = 1;
}

if (dialogid == 2)
{
      new name[MAX_PLAYER_NAME];
      GetPlayerName(playerid, name, sizeof(name));
      format(file, sizeof(file), "users/%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),"users/%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;
}


Skype: juky6661

Server ip: 193.104.68.47:7785
Forum:http://lc-samp.mojkgb.com/forum

nisi mu reko da mora napraviti mapu "users" da bi radilo
I jure bas i nevjerujem da je tvoje jer ovakav sistem sam vidio na forum-samp
Mozda si samo preveo ?!?
Datum registracije:    Listopad 21, 2009, 15:56:43
|Rick Dunn| NaNx |Soldier |
|Maper | Web Developer [HTML+CSS] | C++ beginner |

Respect: Karike, Chris, ///Masic, Stormer, Walter, NeNo, Pacino, NaNek

JusT