Hallo Community,
ich habe den ganzen morgen schon gescriptet an meinem autohaussystem. Wenn man auf den Textdraw kaufen drückt wird zwar alles ausgeführt aber kein Auto erstellt...
else if(clickedid == autoskaufen[playerid])
{
if(CInfo[playerid][CarModel] == 0)
{
SCM(playerid,COLOR_GRUN,"1");
UnFreeze(playerid);
CInfo[playerid][CarModel] = autohausmodel[playerid];
CInfo[playerid][Preis] = autohauspreis[playerid];
CInfo[playerid][Carposx] = 1241.1940;
CInfo[playerid][Carposy] = -741.7083;
CInfo[playerid][Carposz] = 95.4138;
CInfo[playerid][Carposa] = 4.0;
CInfo[playerid][CZustand] = 1000;
CInfo[playerid][CarTank] = 20;
SCM(playerid,COLOR_GRUN,"2");
CInfo[playerid][Fahrzeugid] = CreateVehicle(CInfo[playerid][CarModel],CInfo[playerid][Carposx],CInfo[playerid][Carposy],CInfo[playerid][Carposz],CInfo[playerid][Carposa],CInfo[playerid][CarC1],CInfo[playerid][CarC2],-1);
SCM(playerid,COLOR_GRUN,"3");
printf("%d",CInfo[playerid][Fahrzeugid]);
printf("%d",CInfo[playerid][CarModel]);
printf("%.2f",CInfo[playerid][Preis]);
printf("%.2f",CInfo[playerid][Carposx]);
printf("%.2f",CInfo[playerid][Carposy]);
printf("%.2f",CInfo[playerid][Carposz]);
printf("%.2f",CInfo[playerid][Carposa]);
printf("%.2f",CInfo[playerid][CZustand]);
printf("%.2f",CInfo[playerid][CarTank]);
SaveCar(playerid);
}
Ich habe alles geprintet ob es gelesen wird, und es geht alles aber das fahrzeug kommt nicht...
LG
//e komisch ist das es auch nicht gespeichert wird..
stock SaveCar(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
GetPlayerName(playerid, pname, sizeof(pname));
new Float:Zust;
GetVehicleHealth(CInfo[playerid][Fahrzeugid], Zust);
new query[900], stringzusammen[1024];
GetPlayerName(playerid,pname,sizeof(pname));
format(query,sizeof query,"UPDATE `autos` SET `Name`='%s', `CarModel`='%d', `Carposx`='%.f5', `Carposy`='%.f5',`Carposz`='%.f5',`Carposa `='%.f5',´Nitro´='%d',´Hydraulic´='%d',´Reifen´='%d',´Auspuff´='%d',´SideL´='%d',´SideR´='%d',´CarFB´='%d',´CarRB´='%d',´CarSpoiler´='%d',´CarRoof´='%d',´CarHood´='%d',´CarVents´='%d',´CarLamps´='%d',´CarPJ´='%d',",
pname,CInfo[playerid][Carposx],CInfo[playerid][Carposy],CInfo[playerid][Carposz],CInfo[playerid][Carposa],CInfo[playerid][Nitro],CInfo[playerid][Hydraulic],CInfo[playerid][Reifen],CInfo[playerid][Auspuff],CInfo[playerid][SideL],CInfo[playerid][SideR],CInfo[playerid][CarFB],CInfo[playerid][CarRB],CInfo[playerid][CarSpoiler],CInfo[playerid][CarRoof],
CInfo[playerid][CarHood],CInfo[playerid][CarVents],CInfo[playerid][CarLamps],CInfo[playerid][CarPJ]);
strcat(stringzusammen,query);
strdel(query,0,sizeof(query));
format(query,sizeof query,"`CarC1`='%d', `CarC2`='%d', `CarTank`='%.f1', `Preis`='%.f2', `CZustand`='%.f5', `RepPreisA`='%.f2' WHERE `Name`='%s'",
CInfo[playerid][CarC1],CInfo[playerid][CarC2],Tank[CInfo[playerid][Fahrzeugid]],CInfo[playerid][Preis],Zust,CInfo[playerid][RepPreisA],pname);
strcat(stringzusammen,query);
strdel(query,0,sizeof(query));
mysql_query(stringzusammen);
strdel(stringzusammen,0,sizeof(stringzusammen));
mysql_free_result();
}
}
return 1;
}