26.02.2013, 12:05
1. Set your database and tables encoding to utf8_general_ci - this will spare you problems later
2. Use [ pawn] tag, not quotes
3. Missing quote in checkacc
4. Use mysql_format, not normal format (sql injection and stuff)
5. Wrong index in cache_get_row (2 instead of 1)
2. Use [ pawn] tag, not quotes
3. Missing quote in checkacc
4. Use mysql_format, not normal format (sql injection and stuff)
5. Wrong index in cache_get_row (2 instead of 1)
pawn Код:
stock CheckAccount(playerid)
{
mysql_format(data, query, "SELECT SQLID, Password FROM `profiles` WHERE `Name` = '%e' LIMIT 0,1", PlayerName(playerid));
mysql_function_query(data, query, true, "checkacc", "i", playerid);
return 1;
}
forward checkacc(playerid);
public checkacc(playerid)
{
if(playerid != INVALID_PLAYER_ID)// if the player is still connected
{
new rows, fields;
cache_get_data(rows, fields, data);
if(rows)
{
new id[30];
cache_get_row(0, 0, id, data);
usrDB[playerid][SQLID] = strval(id);
cache_get_row(0, 1, usrDB[playerid][password], data);
ShowPlayerDialog(playerid,3,DIALOG_STYLE_PASSWORD, "{2981FC}RPG {FFFFFF}• {F82222}Login","{FFFFFF}Please login:{FFFFFF}","Resume","Quit");
}
else
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD, "{2981FC}RPG {FFFFFF}• {F82222}Register","{FFFFFF}Please register","Register","quit");
}
}
return 1;
}