dialog login register

Započeo [OG]Foley, Jun 03, 2010, 22:28:13 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

evo ovako, imam jedan problem...
ja dodam ovaj kod na pravo mjesto
i kada udem u igru da se idem logirat sa postojecim accountom pise vas racun nije registri...
idem ja upisati novi nick  da vidim el radi barem register, kad ono radi znaci meni treba pomoc oko logina,
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return 1;


PlayerPlaySound(playerid, 1187, 0.0, 0.0, 0.0);
new string[128];
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
new loginstring[128];
format(loginstring,sizeof(loginstring),"Dobrodosli! Unesite lozinku kako bi mogli igrati!");
ShowPlayerDialog(playerid,2800,DIALOG_STYLE_INPUT,"Login",loginstring,"Prijava","Izlaz");
return 1;
}
else
{
gPlayerAccount[playerid] = 0;
new regstring[128];

GetPlayerName(playerid,regstring,sizeof(regstring));
format(regstring,sizeof(regstring),"Dobrodosli na server! Registrirajte se kako bi mogli igrati na nasem serveru!");
ShowPlayerDialog(playerid,2801,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Izlaz");
return 1;
}
SetPlayerCameraPos(playerid, 320.0, 50.0, 170.0);
SetPlayerCameraLookAt(playerid, 324.34, 54.122, 173.35);
return 1;
}




public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new sendername[MAX_PLAYER_NAME];
new string[128];
if(response)
{
if(dialogid == 2800 )
{
    if(strlen(inputtext))
    {
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerLogin(playerid,tmppass);
}
else
{
new loginstring[128];
new loginname[64];
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"POGRESNA SIFRA\nUnesena lozinka se ne poklapa sa accountom!",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Prijava","Izlaz");
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 5) { Kick(playerid); }
}
}
if(dialogid == 2801)
{
    if(strlen(inputtext))
    {
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s.ini", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, COLOR_YELLOW, "Ime je vec preuzeto, molimo izaberite neko drugo.");
fclose(hFile);
return 1;
}
new tmppass[64];
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
Encrypt(tmppass);
OnPlayerRegister(playerid,tmppass);
}
else
{
new regstring[128];
new regname[64];
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"Dobrodosli, %s\nVi nemate korisnicki Account/Racun.\nUnesite lozinku za register:",regname);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Izlaz");
}
}
}
        return 1;
}


Trebam pomoc!!!!



u OnDialogResponse promijeni ovo:

format(string, sizeof(string), "%s.ini", sendername);

u ovo:

format(string, sizeof(string), "users\%s.ini", sendername);

neradi
al nije to tog problem on sprema acc u scriptfiles to je dobro neg je kada ja napisem neko ime koje jos nije regano npr : Stojko_Stojic(xD)
kaze da se registriram, i regam se odem relog
i opet mi pise da se regam S:
to je problem



I ja sam imao takav problem, al sam onda koristio ovaj tut : http://balkan-samp.com/forum/index.php?topic=5001.0
I onda mi sve radilo..

ok probat cu
EDIT: fala svima na pomoci, ovaj tut
Citat: ╬Devilni Vilkoâ,,¢â•¬ poslato Jun 04, 2010, 19:07:57 POSLE PODNE
I ja sam imao takav problem, al sam onda koristio ovaj tut : http://balkan-samp.com/forum/index.php?topic=5001.0
I onda mi sve radilo..
mi nije nis pomogo, al svedno fala,
ali sam rijesio pomogo, izvadio sam dialog iz GAmemoda GTA RP
HVALA svima, admini moze lock
Poslednja Izmena: Jun 04, 2010, 21:40:21 POSLE PODNE od [BM]Alen_Sudec