Hallo Bortfische,
Ich habe folgendes Problem, bei mir wird kein Fraktionscar beim kauf erstellt erstellt.
enum fracVehEnum {
e_modelID,
Float:e_x,
Float:e_y,
Float:e_z,
Float:e_a,
e_color1,
e_color2,
e_fracID,
e_vID
};
fcarcreate(fraktionid,modelid,Float:x,Float:y,Float:z,Float:a,color1,color2)
{
for(new i=0; i<MAX_FRAC_VEHICLES; i++)
{
if(fracVehicle[i][e_vID] == 0)
{
fracVehicle[i][e_modelID] = modelid;
fracVehicle[i][e_x] = x;
fracVehicle[i][e_y] = y;
fracVehicle[i][e_z] = z;
fracVehicle[i][e_a] = a;
fracVehicle[i][e_color1] = color1;
fracVehicle[i][e_color2] = color2;
fracVehicle[i][e_fracID] = fraktionid;
new query[256];
format(query, sizeof(query), "INSERT INTO FracVehicles (ID, ModelID, PosX, PosY, PosZ, PosA, Color1, Color2, FracID) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '%d', '%d', '%d')",
i, fracVehicle[i][e_modelID], fracVehicle[i][e_x], fracVehicle[i][e_y], fracVehicle[i][e_z], fracVehicle[i][e_a], fracVehicle[i][e_color1], fracVehicle[i][e_color2], fracVehicle[i][e_fracID]);
mysql_query(dbhandle, query);
fracVehicle[i][e_vID] = CreateVehicle(fracVehicle[i][e_modelID], fracVehicle[i][e_x], fracVehicle[i][e_y], fracVehicle[i][e_z], fracVehicle[i][e_a], fracVehicle[i][e_color1], fracVehicle[i][e_color2], -1);
return 1;
}
}
return 1;
}
if(dialogid==DIALOG_BUYFRAKCAR)
{
if(response)
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,COLOR_RED,"Du hast nicht genügend Geld.");
RemovePlayerFromVehicle(playerid);
return 1;
}
giveplayermoney(playerid,-ahCars[id][c_preis]);
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_RED,"Herzlichen Glückwunsch zum neuen Auto");
RemovePlayerFromVehicle(playerid);
}
else
{
//Autoverkauf
new id=GetPVarInt(playerid,"buyCarID");
if(GetPlayerMoney(playerid)<ahCars[id][c_preis])
{
SendClientMessage(playerid,COLOR_RED,"Du hast nicht genügend Geld.");
RemovePlayerFromVehicle(playerid);
return 1;
}
giveplayermoney(playerid,-ahCars[id][c_preis]);
//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]);
fcarcreate(sInfo[playerid][fraktion],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],-1,-1);
SendClientMessage(playerid,COLOR_RED,"Herzlichen Glückwunsch zum neuen Auto");
RemovePlayerFromVehicle(playerid);
}
}
Ich hoffe es kan mir jemand helfen
MFG German_ScripterHD