02.03.2018, 17:58
Could someone help me in this following code
I can not save anything on PlayersWeapons
logs
Код:
public OnPlayerDisconnect(playerid, reason) UpdatePlayerData(playerid, reason); return 1; } UpdatePlayerData(playerid, reason) { if (Player[playerid][IsLoggedIn] == false) return 0; // if the client crashed, it's not possible to get the player's position in OnPlayerDisconnect callback // so we will use the last saved position (in case of a player who registered and crashed/kicked, the position will be the default spawn point) if (reason == 1) { Player[playerid][Weapon] = GetPlayerWeapon(playerid); Player[playerid][Ammo] = GetPlayerAmmo(playerid); } new PlayersWeapons[300]; mysql_format(g_SQL, PlayersWeapons, sizeof PlayersWeapons, "UPDATE `PlayersWeapons` SET `PlayerID` = %e, `WeaponID` = %i, `Ammo` = %i", Player[playerid][Name], Player[playerid][Weapon], Player[playerid][Ammo]); mysql_tquery(g_SQL, PlayersWeapons); return 1; }
logs
Код:
[15:46:17] [DEBUG] mysql_format(1, 0x03C38C98, 300, "UPDATE `PlayersWeapons` SET `PlayerID` = %e, `WeaponID` = %i, `Ammo` = %i") [15:46:17] [DEBUG] CHandle::EscapeString(this=0x995338, src='Jnn_Doug2') [15:46:17] [DEBUG] CConnection::EscapeString(src='Jnn_Doug2', this=0x9a0d30, connection=0x9ae508) [15:46:17] [DEBUG] CHandle::EscapeString - return value: true, escaped string: 'Jnn_Doug2' [15:46:17] [DEBUG] mysql_format: return value: '83' [15:46:17] [DEBUG] mysql_tquery(1, "UPDATE `PlayersWeapons` SET `PlayerID` = Jnn_Doug2, `WeaponID` = 24, `Ammo` = 32756", "", "") [15:46:17] [DEBUG] CCallback::Create(amx=0x8a0f00, name='', format='', params=0x3c38c84, param_offset=5) [15:46:17] [DEBUG] CHandle::Execute(this=0x995338, type=1, query=0x97ddd8) [15:46:17] [DEBUG] CConnection::Execute(query=0x97ddd8, this=0x2a30020, connection=0x97d928) [15:46:17] [DEBUG] CQuery::Execute(this=0x97ddd8, connection=0x97d928) [15:46:17] [ERROR] error #1054 while executing query "UPDATE `PlayersWeapons` SET `PlayerID` = Jnn_Doug2, `WeaponID` = 24, `Ammo` = 32756": Unknown column 'Jnn_Doug2' in 'field list' [15:46:17] [DEBUG] CConnection::GetError(this=0x2a30020, connection=0x97d928) [15:46:17] [DEBUG] CHandle::Execute - return value: true [15:46:17] [DEBUG] mysql_tquery: return value: '1' [15:46:17] [DEBUG] cache_is_valid(0) [15:46:17] [DEBUG] cache_is_valid: return value: 'false' [15:46:17] [DEBUG] CCallback::Create(amx=0x8a0f00, name='OnQueryError', format='dsssd)