01.12.2012, 02:26
(
Последний раз редактировалось Claude_StreeT; 20.06.2016 в 23:39.
)
@Delete
stock Login(playerid)
{
print("0000000000000");
new query[128], string[64], money, score;
format(query, sizeof(query), "SELECT * FROM accounts WHERE user = '%s'", Name(playerid));
print("11111111111");
mysql_query(query);
print("2222222222222222");
mysql_store_result();
print("33333333333333333");
while(mysql_fetch_row_format(query))
{
mysql_fetch_field_row(string, "admin"); PlayerInfo[playerid][pAdmin] = strval(string);
print("4444444444444");
mysql_fetch_field_row(string, "VIP"); PlayerInfo[playerid][pVIP] = strval(string);
print("55555555555555");
mysql_fetch_field_row(string, "warnings"); PlayerInfo[playerid][pWarnings] = strval(string);
print("6666666666666");
mysql_fetch_field_row(string, "score"); score = strval(string);
print("77777777777777777");
mysql_fetch_field_row(string, "money"); money = strval(string);
print("8888888888888");
mysql_fetch_field_row(string, "kills"); PlayerInfo[playerid][pKills] = strval(string);
print("999999999999999");
mysql_fetch_field_row(string, "deaths"); PlayerInfo[playerid][pDeaths] = strval(string);
print("aaaaaaaaaaaaaaaaaa");
mysql_fetch_field_row(string, "points"); PlayerInfo[playerid][pPoints] = strval(string);
}
print("bbbbbbbbbbbbbbbbb");
mysql_free_result();
GivePlayerMoney(playerid, money);
print("ccccccccccccc");
SetPlayerScore(playerid, score);
print("dddddddddddddddddd");
PlayerInfo[playerid][pLogged] = 1;
print("eeeeeeeeeeee");
UpdateStatsTextdraw(playerid);
print("ffffffffffffff");
SendClientMessage(playerid, C_LGREEN, "ACCOUNT: Successfully logged in.");
print("ggggggggggggggggggggg");
return 1;
}
stock Login(playerid)
{
print("0000000000000");
new query[128], string[64], money, score;
format(query, sizeof(query), "SELECT * FROM accounts WHERE user = '%s'", Name(playerid));
print("11111111111");
mysql_query(query);
print("2222222222222222");
mysql_store_result();
print("33333333333333333");
while(mysql_fetch_row_format(query))
{
mysql_fetch_field_row(string, "admin"); PlayerInfo[playerid][pAdmin] = strval(string);
print("4444444444444");
mysql_fetch_field_row(string, "VIP"); PlayerInfo[playerid][pVIP] = strval(string);
print("55555555555555");
mysql_fetch_field_row(string, "warnings"); PlayerInfo[playerid][pWarnings] = strval(string);
print("6666666666666");
mysql_fetch_field_row(string, "score"); score = strval(string);
print("77777777777777777");
mysql_fetch_field_row(string, "money"); money = strval(string);
print("8888888888888");
mysql_fetch_field_row(string, "kills"); PlayerInfo[playerid][pKills] = strval(string);
print("999999999999999");
mysql_fetch_field_row(string, "deaths"); PlayerInfo[playerid][pDeaths] = strval(string);
print("aaaaaaaaaaaaaaaaaa");
mysql_fetch_field_row(string, "points"); PlayerInfo[playerid][pPoints] = strval(string);
}
print("bbbbbbbbbbbbbbbbb");
mysql_free_result();
GivePlayerMoney(playerid, money);
print("ccccccccccccc");
SetPlayerScore(playerid, score);
print("dddddddddddddddddd");
PlayerInfo[playerid][pLogged] = 1;
print("eeeeeeeeeeee");
UpdateStatsTextdraw(playerid);
print("ffffffffffffff");
SendClientMessage(playerid, C_LGREEN, "ACCOUNT: Successfully logged in.");
print("ggggggggggggggggggggg");
return 1;
}
Exemplo para fazer um Debug
Procure pela stock Login e coloque os print se algum falhar vc encontrara o bug! pawn Код:
|
if(rows == 1)
{
Login(playerid);
}
if(!rows)
{
new string[150];
format(string, sizeof(string), "{FFFFFF}Olб {00AAFF}%s{FFFFFF}! Este nome ja esta registrado.\n{FF0000}Por favor insira sua senha:", Name(playerid));
ShowPlayerDialog(playerid, D_LOGIN, DIALOG_STYLE_PASSWORD, "Logar", string, "Logar", "Sair");
}