30.08.2010, 19:18
Hello people, I came up with this error today when I was working on my MySQL script. When a player does /login normally they are able to get all their information and so on but when I add it one more line which is:
It shows up as the command doesn't work.
Anyone see what I am doing wrong?
pawn Код:
playerinfo[playerid][uid] = strval(field[13]);
pawn Код:
LoginPlayer(playerid, password[])
{
if(PlayerLogged[playerid])
return SendClientMessage(playerid, COLOR_GREY, "You are already logged in!");
CheckMySQL();
new string[526];
format(string, sizeof(string), "SELECT * FROM users WHERE name = '%s' AND password = '%s'", playerinfo[playerid][playername], password);
mysql_query(string);
mysql_store_result();
if(!mysql_num_rows())
return SendClientMessage(playerid, COLOR_GREY, "You have typed in the incorrect password");
new row[128];
new field[14][256];
mysql_fetch_row_format(row, "|");
explode(row, field, "|");
mysql_free_result();
playerinfo[playerid][ID] = strval(field[1]);
format(playerinfo[playerid][Password], 32, "%s", field[2]);
playerinfo[playerid][Admin] = strval(field[3]);
playerinfo[playerid][Money] = strval(field[4]);
playerinfo[playerid][Bank] = strval(field[5]);
playerinfo[playerid][Faction] = strval(field[6]);
playerinfo[playerid][Rank] = strval(field[7]);
playerinfo[playerid][Skin] = strval(field[8]);
playerinfo[playerid][first] = strval(field[9]);
playerinfo[playerid][ban] = strval(field[10]);
format(playerinfo[playerid][banreason], 256, "%s", field[11]);
playerinfo[playerid][IP] = strval(field[12]);
playerinfo[playerid][uid] = strval(field[13]);
return 1;
}
![Smiley](images/smilies/smile.png)