Quote:
Originally Posted by $ЂЯĢ
This would be possible fix.
pawn Code:
public FindPlayerSQL(playerid) { CheckSQL(); new query[128], pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); mysql_real_escape_string(pname,pname); format(query,sizeof(query),"SELECT playerid FROM `players` WHERE name='%s' LIMIT 1",pname); mysql_query(query); mysql_store_result(); if(mysql_num_rows()>0) { PlayerInfo[playerid][pSQLId] = mysql_fetch_int(); if(PlayerInfo[playerid][pSQLId] <= INVALID_SQL_ID) { SendClientMessage(playerid,0xFFFFFF,"SERVER: Your data hasn't loaded."); return Kick(playerid); } } mysql_free_result(); return 1; }
|
There's no reason for that because you check the rows, there can't be 3 rows but your sqlid will be 0.. It must be 1 2 or 3. (auto increment)