Das ist der Fehler:
[22:03:29] [ERROR] CMySQLQuery::Execute[carSavedToDB] - (error #1136) Column count doesn't match value count at row 1
Das passiert wennich am autohaus ei car kaufe
Das sind alle Script Teile:
Der KaufDialog:
if(dialogid==DIALOG_AUTOHAUS)
{
if(response)
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID"),query[265];
if(GetPlayerMoneyEx(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,COLOR_RED,"Du hast nicht genügend Geld.");
RemovePlayerFromVehicle(playerid);
return 1;
}
GivePlayerMoneyEx(playerid,-ahCars[id][c_preis]);
format(query,sizeof(query),"INSERT INTO autos (besitzer,model,x,y,z,r) VALUES ('%s','%i','%f','%f','%f','%f','%i')",cInfo[id][besitzer],cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r]);
mysql_pquery(dbhandle,query,"carSavedToDB","i",id);
createPlayerCar(playerid,ahCars[id][model],ahInfo[ahCars[id][ah_id]][s_x],ahInfo[ahCars[id][ah_id]][s_y],ahInfo[ahCars[id][ah_id]][s_z],ahInfo[ahCars[id][ah_id]][s_r]);
SendClientMessage(playerid,COLOR_GREEN,"Du hast das Auto erfolgreich gekauft");
RemovePlayerFromVehicle(playerid);
}
else
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Du hast den Kauf abgebrochen");
}
return 1;
}
Die Funktion createPlayerCar:
stock createPlayerCar(playerid,modelid,Float:x,Float:y,Float:z,Float:r)
{
for(new i=0; i<sizeof(cInfo); i++)
{
if(cInfo[i][id_x]!=0)continue;
strmid(cInfo[i][besitzer],GetName(playerid),0,strlen(GetName(playerid)),24);
cInfo[i][c_x]=x;
cInfo[i][c_y]=y;
cInfo[i][c_z]=z;
cInfo[i][c_r]=r;
cInfo[i][model]=modelid;
cInfo[i][Color_1]=1;
cInfo[i][Color_2]=1;
cInfo[i][id_x] = CreateVehicle(modelid,x,y,z,r,cInfo[i][Color_1],cInfo[i][Color_2],-1);
tank[i] = 100;
return 1;
}
return 1;
}
Die carSavedtoDB
public carSavedToDB(carid)
{
cInfo[carid][db_id]=cache_insert_id();
return 1;
}
stock saveCarToDB(carid)
{
new query[128];
format(query,sizeof(query),"INSERT INTO autos (besitzer,model,x,y,z,r) VALUES ('%s','%i','%f','%f','%f','%f','%i')",cInfo[carid][besitzer],cInfo[carid][model],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r]);
mysql_pquery(dbhandle,query,"carSavedToDB","i",carid);
return 1;
}