03.12.2012, 11:13
Hey guys!
^ I've got the code above but sometimes the variable isn't set correctly. Is the code wrong?
Please help me!
pawn Код:
new qstr[200];
format(qstr,200,"SELECT * FROM `players` WHERE `username`='%s';",plname);
mysql_function_query(g_Handle, qstr, true, "OnPlayerCheckAccount", "i", playerid);
pawn Код:
forward OnPlayerCheckAccount(playerid);
public OnPlayerCheckAccount(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
gPlayerAccount[playerid] = 1;
cache_get_row(0, 2, PlayerInfo[playerid][pKey], g_Handle);
}
else
{
gPlayerAccount[playerid] = 0;
}
}