- 0
Problema register
-
Similar Content
-
- 11 replies
- 358 views
-
Problema turf
By Soryn.,
- 3 answers
- 263 views
-
- 1 reply
- 179 views
-
Problema
By ImJustSlim,
- 3 answers
- 286 views
-
- 2 replies
- 158 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
WiDuAlK
Nick: WiDuAlK
Problema: Is la inceputul unei creari de GM. Am facut registerul si am pus cv pe el dar am o problema. Dupa ce ma inregistrez cu o parola , dupa ce ies si intru din nou din greseala am tastat alta parola dar nu stiu cum mi-a intrat pe cont. Am incercat din nou si merge cu orice parola inafara de spariu liber.
Cand las spatiu liber scrie parola invalida , cand bag orice parola merge
Erori / warnings: -
Lini/script:
[pawn]#define DIALOG_REGISTER1 0
#define DIALOG_REGISTER2 1
#define DIALOG_REGISTER3 2
#define DIALOG_REGISTER4 3
#define DIALOG_REGISTER5 4
#define DIALOG_REGISTER6 5
#define DIALOG_LOGIN1 6
#define DIALOG_NOPW1 7
#define DIALOG_NOPW2 8
#define DIALOG_WRONGPW 9[/pawn]
[pawn]enum Info
{
pSex, //0= baiat 1=fata
pAni, // anii
pEmail,
pLogare,// playerul este conectat
pOrigine,
}[/pawn]
[pawn]public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "Playeri/%s.ini", pname);
AntiFlood_InitPlayer( playerid );
if(!dini_Exists(path))
{
// playerul nu este inregistrat
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_PASSWORD, "Inregistrare", "Parola ta", "OK", "Cancel");
}
else
{
//playerul este inregistrat
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_PASSWORD, "Logare", "Parola ta", "OK", "Cancel");
SpawnPlayer(playerid);
}
return 1;
}[/pawn]
[pawn]public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "Playeri/%s.ini", pname);
dini_IntSet(path, "Sex", pInfo[playerid][pSex]);
dini_IntSet(path, "Ani", pInfo[playerid][pAni]);
dini_IntSet(path, "Email", pInfo[playerid][pEmail]);
pInfo[playerid][pLogare] = 0;
assert( AntiFlood_Check( playerid ) );
return 1;
}[/pawn]
[pawn]public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
#pragma tabsize 0
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "Playeri/%s.ini", pname);
switch(dialogid)
{
case DIALOG_REGISTER1:
{
if(!response) return Kick(playerid);
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
dini_Create(path);
dini_Set(path, "parola", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "Ce esti?", "Baiat\nFata", "OK", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW1, DIALOG_STYLE_MSGBOX, "Inregistrare", "Introdu-ti o parola!", "OK", "Cancel");
}
}
case DIALOG_REGISTER2:
{
if(!response)
return dini_Remove(path), Kick(playerid);
switch( listitem )
{
case 0:
{
pInfo[ playerid ][ pSex ] = 0 ;
dini_IntSet(path, "Sex", listitem);
ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Inregistrare", "Cati ani ai?", "OK", "Cancel");
}
case 1:
{
pInfo[ playerid ][ pSex ] = 1 ;
dini_IntSet(path, "Sex", listitem);
ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Inregistrare", "Cati ani ai?", "OK", "Cancel");
}
}
}
case DIALOG_REGISTER3:
{
if(!response) return dini_Remove(path), Kick(playerid);
dini_Set(path, "Ani", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER5, DIALOG_STYLE_INPUT, "Inregistrare", "Ce email ai?(ex: [email protected])!", "OK", "Cancel");
}
case DIALOG_REGISTER5:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_Set(path, "Email", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER6, DIALOG_STYLE_LIST, "Inregistrare", "LosSantos\nSanFierro", "Bine", "Cancel");
}
}
case DIALOG_REGISTER6:
{
if(!response)
return Kick( playerid ) ;
if ( listitem == 0 )
{
pInfo[ playerid ][ pOrigine ] = 0;
dini_IntSet(path, "Origine", listitem ); // LS
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Inregistrare", "Inregistrare completa!", "OK", "OK");
}
if ( listitem == 1 )
{
pInfo[ playerid ][ pOrigine ] = 1;
dini_IntSet(path, "Origine", listitem ); // LV
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Inregistrare", "Inregistrare completa!", "OK", "OK");
}
}
case DIALOG_REGISTER4:
{
pInfo[playerid][pSex] = dini_Int(path, "Sex");
pInfo[playerid][pAni] = dini_Int(path, "Ani");
pInfo[playerid][pEmail] = dini_Int(path, "Email");
pInfo[playerid][pOrigine] = dini_Int(path, "Origine");
pInfo[playerid][pLogare] = 1;
}
case DIALOG_LOGIN1:
{
if(!response) return Kick(playerid);
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
new pw[200];
format(pw, sizeof(pw), "%s", dini_Get(path, "parola"));
if(strcmp(inputtext, pw) == 0)
{
pInfo[playerid][pSex] = dini_Int(path, "Sex");
pInfo[playerid][pAni] = dini_Int(path, "Ani");
pInfo[playerid][pEmail] = dini_Int(path, "Email");
pInfo[playerid][pOrigine] = dini_Int(path, "Origine");
pInfo[playerid][pLogare] = 1;
SetTimerEx( "SpawnPlayerr", 500, 0, "d", playerid );
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Logare", "Parola invalida!", "OK", "Cancel");
}
}
case DIALOG_NOPW1:
{
if(!response) return Kick(playerid);
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_PASSWORD, "Inregistrare", "Parola ta" , "OK", "Cancel");
}
case DIALOG_NOPW2:
{
if(!response) return Kick(playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_PASSWORD, "Logare", "Parola ta", "OK", "Abbrechen");
}
case DIALOG_WRONGPW:
{
if(!response) return Kick(playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_PASSWORD, "Logare", "Parola ta", "OK", "Cancel");
}
}
return 1;
}[/pawn]
Ai incercat sa rezolvi singur ?: Da cu Massari dar nu stie nici el , deoarece e pe dini.
@WiDuAlK Tutorial`s:
PAWN pentru SA:MP in Notepad++
Tutorial Register-Login MYSQL R39
Tutorial etape de register
Cum sa creezi un PayDay (2 METODE)
Cum sa creezi o factiune de la 0 PART 1
Cum sa creezi o factiune de la 0 PART 2
Cum sa creezi o factiune de la 0 partea a 3-a (ULTIMA)
Functii folositoare din NEW.PWN
Tutorial Engine Vehicle
Optimizare simplitate si stil
Foreach inlocuieste loop-ul
SSCANF si ZCMD
Cum sa creezi o poarta miscatoare
Tutorial cum sa creezi un radio pe server si cum sa iti creezi melodi pentru ascultat pe server
Cum sa tii un server din PC folosind HAMACHI
Documentatie* Despre hack-uri
Servicii:
Servicii Scripting & Mapping
Produse:
Farmer Job Realistic
Drugs Dealer System [SA-MP] UNIQUE
Link to comment
Share on other sites
21 answers to this question
Recommended Posts