08.08.2014, 17:20
how do i do this with old MySQL like R4? I put this on disconnect:
I go to the server, give myself weapons then quit, and nothing appears in the database. and how could i redo, the loading for Queries? Thank you.
pawn Code:
new
weaponid,
MySQLQuery[300],
ammo;
for(new i; i < 13; i++) // looping through all weapon slots (0 - 12)
{
GetPlayerWeaponData(playerid, i, weaponid, ammo); // get weaponid and ammo
if(!weaponid) continue; // don't insert if there's no weapon in this slot
format(MySQLQuery, sizeof(MySQLQuery), "INSERT INTO ginklai VALUES (%d, %d, %d) ON DUPLICATE KEY UPDATE ammo = %d;", GetPVarInt(playerid, "AccID"), weaponid, ammo, ammo);
mysql_query(MySQLQuery);
}