29.12.2017, 15:20
So saving my SQL works perfectly fine. But when I load it in it adds the number 48 to each var (except the password, username and money vars). For the money, it makes it some random number, most noticeably 57. I don't understand what I did wrong. They're all integers.
Code:
stock LoginPlayer( playerid )
{
new query[128], pName[MAX_PLAYER_NAME];
GetPlayerName( playerid, pName, sizeof( pName ) );
format( query, sizeof( query ), "SELECT * FROM accounts WHERE Name = '%s'", pName );
mysql_query( query );
mysql_store_result();
while( mysql_fetch_row_format( query, "|" ) ) {
mysql_fetch_field_row( Player[playerid][Name], "Name" );
mysql_fetch_field_row( Player[playerid][Password], "Password" );
mysql_fetch_field_row( Player[playerid][Kills], "Kills" );
mysql_fetch_field_row( Player[playerid][Deaths], "Deaths" );
mysql_fetch_field_row( Player[playerid][AdminLvl], "AdminLvl" );
mysql_fetch_field_row( Player[playerid][Money], "Money" );
}
GivePlayerMoney( playerid, Player[playerid][Money] );
}


