Hallo liebe Community,
ich habe das Problem das nur die Munition gespeichert wird aber nicht die Waffen ID.
Hier mein Code:
savePlayer(playerid)
{
if(sInfo[playerid][eingeloggt]==0)return 1;
//Speichern (Level,Geld)
new query[128];
format(query,sizeof(query),"UPDATE user SET level='%i',money='%i',adminlevel='%i',fraktion='%i',skin='%i',banned='%i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][adminlevel],sInfo[playerid][fraktion],GetPlayerSkin(playerid),sInfo[playerid][banned],sInfo[playerid][pid]);
format(query,sizeof(query),"UPDATE user SET gun1='%i',gun2='%i',gun3='%i',gun4='%i',gun5='%i',gun6='%i' WHERE id='%i'",sInfo[playerid][gun1],sInfo[playerid][gun2],sInfo[playerid][gun3],sInfo[playerid][gun4],sInfo[playerid][gun5],sInfo[playerid][gun6],sInfo[playerid][pid]);
format(query,sizeof(query),"UPDATE user SET guna1='%i',guna2='%i',guna3='%i',guna4='%i',guna5='%i',guna6='%i' WHERE id='%i'",sInfo[playerid][guna1],sInfo[playerid][guna2],sInfo[playerid][guna3],sInfo[playerid][guna4],sInfo[playerid][guna5],sInfo[playerid][guna6],sInfo[playerid][pid]);
mysql_function_query(dbhandle,query,false,"","");
return 1;
}
forward GetPlayerWeapons(playerid);
public GetPlayerWeapons(playerid)
{
new weaponxD[7][2];
GetPlayerWeaponData(playerid, 1, weaponxD[1][0], weaponxD[1][1]);
GetPlayerWeaponData(playerid, 2, weaponxD[2][0], weaponxD[2][1]);
GetPlayerWeaponData(playerid, 3, weaponxD[3][0], weaponxD[3][1]);
GetPlayerWeaponData(playerid, 4, weaponxD[4][0], weaponxD[4][1]);
GetPlayerWeaponData(playerid, 5, weaponxD[5][0], weaponxD[5][1]);
GetPlayerWeaponData(playerid, 6, weaponxD[6][0], weaponxD[6][1]);
sInfo[playerid][gun1] = weaponxD[1][0]; sInfo[playerid][guna1] = weaponxD[1][1];
sInfo[playerid][gun2] = weaponxD[2][0]; sInfo[playerid][guna2] = weaponxD[2][1];
sInfo[playerid][gun3] = weaponxD[3][0]; sInfo[playerid][guna3] = weaponxD[3][1];
sInfo[playerid][gun4] = weaponxD[4][0]; sInfo[playerid][guna4] = weaponxD[4][1];
sInfo[playerid][gun5] = weaponxD[5][0]; sInfo[playerid][guna5] = weaponxD[5][1];
sInfo[playerid][gun6] = weaponxD[6][0]; sInfo[playerid][guna6] = weaponxD[6][1];
}
Mit freundlichen Grüßen,
DexterA1