- 0
O problema ...
-
Similar Content
-
- 9 answers
- 123 views
-
- 6 answers
- 77 views
-
- 0 answers
- 78 views
-
- 0 replies
- 34 views
-
- 3 replies
- 77 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
CrystyaN
Salut am o problema nush exact daca e de la mysql ..
Deci am mutat to serveru pe mysqltotul e ok pana cand intru pe sv si nu apare dialogu de register, adica mia aparut odata dar apoi nu a mai aparut si m-am inregistrat, iar contul sa creat in database. ..
uitati cum am facut la onplayerconnect posibil sa fi gresit ceva?
[pawn]
new
loginstring[ 128 ], loginname[ 128 ], regstring[ 128 ], ip[ 15 ], escip[ 15 ], lastlogin[64] ;
new sqlaccountstatus = MySQLCheckAccount(plname);
if(sqlaccountstatus != 0) { gPlayerAccount[playerid] = 1; PlayerInfo[playerid][pSQLID] = sqlaccountstatus; }
else { gPlayerAccount[playerid] = 0; }
GetPlayerIp(playerid, ip, 15);
MySQL:real_escape_string(ip, escip);
GetPlayerName(playerid,loginname,sizeof(loginname));
if (gPlayerAccount[playerid] != 0)
{
format(string,256,"SELECT * FROM `playerinfo` WHERE `user` = '%s' AND `ip` = '%s'",ReturnName(playerid), escip);
MySQL:query(string);
MySQL:store_result();
if(MySQL:num_rows() != 0)
{
AutoLogin(playerid);
gPlayerLogged[playerid] = 1;
}
else
{
gPlayerAccount[playerid] = 1;
GetPlayerName(playerid,loginname,sizeof(loginname));
lastlogin = PlayerInfo[playerid][pLastLogin];
format(loginstring,sizeof(loginstring),"{BECBFC}Welcome back, {95A3FF}%s{BECBFC}!\n\nPlease enter your password below to login to your account. \n\n{FFFFFF}* Last Login: %s *",loginname,lastlogin);
ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
}
}
else
{
gPlayerAccount[playerid] = 0;
GetPlayerName(playerid,loginname,sizeof(loginname));
format(regstring,sizeof(regstring),"{BECBFC}Welcome, {95A3FF}%s{BECBFC}! \n\nThis name is not registered so please register with entering a password below.\n\n{C11B17}You should choose a strong password, between 3 and 32 characters.",loginname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
}
}[/pawn]
si ondialogre
[pawn]
if(dialogid == 12346 || dialogid == 12347)
{
if(response)
{
if(strlen(inputtext))
{
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
OnPlayerLogin(playerid,tmppass);
}
else
{
GetPlayerName(playerid,loginname,sizeof(loginname));
format(loginstring,sizeof(loginstring),"Password doesn't match your name!\n\nPlease reenter your password below to login to your account.",loginname);
ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",loginstring,"Login","Exit");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1742.83, -1862.27, 13.57);
SetPlayerFacingAngle(playerid, 3.41);
SetPlayerCameraPos(playerid, 1230.90, -1287.72, 254.17);
SetPlayerCameraLookAt(playerid, 1227.04, -1289.05, 251.27);
gPlayerLogTries[playerid] += 1;
if(gPlayerLogTries[playerid] == 4) { SendClientMessage(playerid, COLOR_GRAD3, "Ai gresit parola de mai multe ori si ai fost banat"); Ban(playerid); }
}
}
else
{
Kick(playerid);
}
}
if(dialogid == 12345)
{
if(response)
{
if(strlen(inputtext))
{
strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
OnPlayerRegister(playerid,tmppass);
}
else
{
GetPlayerName(playerid,regname,sizeof(regname));
format(regstring,sizeof(regstring),"{BECBFC}Welcome, {95A3FF}%s{BECBFC}! \n\nThis name is not registered so please register with entering a password below.",regname);
ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1742.83, -1862.27, 13.57);
SetPlayerFacingAngle(playerid, 3.41);
SetPlayerCameraPos(playerid, 1230.90, -1287.72, 254.17);
SetPlayerCameraLookAt(playerid, 1227.04, -1289.05, 251.27);
}
}
else
{
Kick(playerid);
}
}[/pawn]
Va rog un ajutor daca puteti, ma chinuie de ceva vreme problema asta.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts