Housecar wird nicht geladen

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo alle zusammen,
    ich habe wider ein Problem mit dem Haus System. Und zwar wird mein Housecar nicht gespawnt an was kann das liegen?

    //HäuserLaden
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    HouseInfo[i][hPickup] = -1;
    HouseInfo[i][hText] = Text3D:-1;
    AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]);
    }
    new query[128];
    format(query,sizeof(query),"SELECT * FROM haus");
    mysql_function_query(dbhandle,query,true,"OnHousesLoad","");


    public OnHousesLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id = getFreeHouseID();
    if(id == -1) return 1;
    HouseInfo[id][h_x] = cache_get_field_content_float(i,"h_x",dbhandle);
    HouseInfo[id][h_y] = cache_get_field_content_float(i,"h_y",dbhandle);
    HouseInfo[id][h_z] = cache_get_field_content_float(i,"h_z",dbhandle);
    HouseInfo[id][ih_x] = cache_get_field_content_float(i,"ih_x",dbhandle);
    HouseInfo[id][ih_y] = cache_get_field_content_float(i,"ih_y",dbhandle);
    HouseInfo[id][ih_z] = cache_get_field_content_float(i,"ih_z",dbhandle);
    HouseInfo[id][hInterior] = cache_get_field_content_int(i,"h_interior",dbhandle);
    HouseInfo[id][ch_x] = cache_get_field_content_float(i,"ch_x",dbhandle);
    HouseInfo[id][ch_y] = cache_get_field_content_float(i,"ch_y",dbhandle);
    HouseInfo[id][ch_z] = cache_get_field_content_float(i,"ch_z",dbhandle);
    HouseInfo[id][ch_r] = cache_get_field_content_float(i,"ch_r",dbhandle);
    HouseInfo[id][hModel] = cache_get_field_content_int(i,"model",dbhandle);
    HouseInfo[id][hFarbe1] = cache_get_field_content_int(i,"farbe1",dbhandle);
    HouseInfo[id][hFarbe2] = cache_get_field_content_int(i,"farbe2",dbhandle);
    HouseInfo[id][hGeschlossen] = cache_get_field_content_int(i,"geschlossen",dbhandle);
    HouseInfo[id][hMiete] = cache_get_field_content_int(i,"miete",dbhandle);
    HouseInfo[id][hPreis] = cache_get_field_content_int(i,"preis",dbhandle);
    HouseInfo[id][hKauflevel] = cache_get_field_content_int(i,"kauflevel",dbhandle);
    new tmp_name[MAX_PLAYER_NAME];
    cache_get_field_content(i,"besitzer",tmp_name,dbhandle);
    strmid(HouseInfo[id][hBesitzer],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    HouseInfo[id][hID] = cache_get_field_content_int(i,"id",dbhandle);
    updateHouse(id);
    }
    return 1;
    }

  • Danke hast recht :D


    //EDIT
    ich habe noch ein Problem -.- iwie speichert er alles nicht in die Datenbank egal ob Miete, geschlossen,...

    ocmd:open(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,HouseInfo[i][h_x],HouseInfo[i][h_y],HouseInfo[i][h_z])) continue;
    if(!strcmp(HouseInfo[i][hBesitzer],name,true))
    {
    if(HouseInfo[i][hGeschlossen] == 0)
    {
    //Offen
    HouseInfo[i][hGeschlossen] = 1;
    GameTextForPlayer(playerid,"~r~Geschlossen",1000,1);
    saveHouse(i);
    break;
    }
    else if(HouseInfo[i][hGeschlossen] == 1)
    {
    //Geschlossen
    HouseInfo[i][hGeschlossen] = 0;
    GameTextForPlayer(playerid,"~g~Offen",1000,1);
    saveHouse(i);
    break;
    }
    }
    return SendClientMessage(playerid,Grau,"Du bist nicht der Besitzer des Hauses!");
    }
    return 1;
    }
    ocmd:setrent(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new name[MAX_PLAYER_NAME],tmp_miete;
    GetPlayerName(playerid,name,sizeof(name));
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,HouseInfo[i][h_x],HouseInfo[i][h_y],HouseInfo[i][h_z])) continue;
    if(!strcmp(HouseInfo[i][hBesitzer],name,true))
    {
    if(sscanf(params,"i",tmp_miete)) return SendClientMessage(playerid,Grau,"Benutze: /setrent [Miete]");
    if(tmp_miete < 1 || tmp_miete > 99999) return SendClientMessage(playerid,Grau,"Bitte nimm eine Summe zwischen 1$ und 99999$!");
    HouseInfo[i][hMiete] = tmp_miete;
    saveHouse(i);
    updateHouse(i);
    }
    return 1;
    }
    return 1;
    }


    updateHouse(id)
    {
    new string[128];
    if(HouseInfo[id][hPickup] != -1)
    {
    DestroyPickup(HouseInfo[id][hPickup]);
    }
    if(HouseInfo[id][hText] != Text3D:-1)
    {
    Delete3DTextLabel(HouseInfo[id][hText]);
    }
    if(!strlen(HouseInfo[id][hBesitzer]))
    {
    HouseInfo[id][hPickup] = CreatePickup(1273,1,HouseInfo[id][h_x],HouseInfo[id][h_y],HouseInfo[id][h_z],-1);
    format(string,sizeof(string),"Zum Verkauf\nPreis: %i$\nKauflevel: %i\n/buyhouse",HouseInfo[id][hPreis],HouseInfo[id][hKauflevel]);
    HouseInfo[id][hText] = Create3DTextLabel(string, Weis, HouseInfo[id][h_x],HouseInfo[id][h_y],HouseInfo[id][h_z], 10, 0, 1);
    }
    else
    {
    HouseInfo[id][hPickup] = CreatePickup(1272,1,HouseInfo[id][h_x],HouseInfo[id][h_y],HouseInfo[id][h_z],-1);
    format(string,sizeof(string),"Besitzer: %s\nWert: %i$\nKauflevel: %i\nMiete: %i$\n/enter",HouseInfo[id][hBesitzer],HouseInfo[id][hPreis],HouseInfo[id][hKauflevel],HouseInfo[id][hMiete]);
    HouseInfo[id][hText] = Create3DTextLabel(string, Weis, HouseInfo[id][h_x],HouseInfo[id][h_y],HouseInfo[id][h_z], 10, 0, 1);
    }
    return 1;
    }


    saveHouse(id)
    {
    new query[128];
    format(query,sizeof(query),"UPDATE haus SET besitzer='%s', preis='%i', kauflevel='%i', model='%i', farbe1='%i', farbe2='%i', geschlossen='%i', miete='%i' WHERE id='%i'",HouseInfo[id][hBesitzer],HouseInfo[id][hPreis],HouseInfo[id][hKauflevel],HouseInfo[id][hModel],HouseInfo[id][hFarbe1],HouseInfo[id][hFarbe2],HouseInfo[id][hGeschlossen],HouseInfo[id][hMiete],HouseInfo[id][hID]);
    mysql_function_query(dbhandle,query,false,"","");
    }

  • Ich habe das im Moment so gemacht geht aber nicht weis nicht an was es liegt.

    ocmd:carupgrade(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid,5,HouseInfo[i][h_x],HouseInfo[i][h_y],HouseInfo[i][h_z])) continue;
    if(!strcmp(HouseInfo[i][hBesitzer],name,true))
    {
    new HouseCar = HouseInfo[i][hModel];
    new upgradekosten = 150000;
    if(GetPlayerVehicleID(playerid) == HouseCar)
    {
    if(GetPlayerMoney(playerid) < upgradekosten) return SendClientMessage(playerid,Grau,"Du hast nicht genug Geld. (150000$)");
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    HouseInfo[i][hCarupgrade] = 1;
    GivePlayerMoney(playerid,-upgradekosten);
    SendClientMessage(playerid,Gruen,"Dein Housecar hat nun Nitro, neue Räder und Hydraulik.");
    }
    saveHouse(i);
    updateHouse(i);
    }
    return 1;
    }
    return 1;
    }


    saveHouse(id)
    {
    new query[512];
    format(query,sizeof(query),"UPDATE haus SET besitzer='%s', preis='%i', kauflevel='%i', model='%i', farbe1='%i', farbe2='%i', carupgrade='%i', geschlossen='%i', miete='%i', kasse='%i' WHERE id='%i'",HouseInfo[id][hBesitzer],HouseInfo[id][hPreis],HouseInfo[id][hKauflevel],HouseInfo[id][hModel],HouseInfo[id][hFarbe1],HouseInfo[id][hFarbe2],HouseInfo[id][hCarupgrade],HouseInfo[id][hGeschlossen],HouseInfo[id][hMiete],HouseInfo[id][hKasse],HouseInfo[id][hID]);
    mysql_function_query(dbhandle,query,false,"","");
    }
    public OnHousesLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id = getFreeHouseID();
    if(id == -1) return 1;
    HouseInfo[id][h_x] = cache_get_field_content_float(i,"h_x",dbhandle);
    HouseInfo[id][h_y] = cache_get_field_content_float(i,"h_y",dbhandle);
    HouseInfo[id][h_z] = cache_get_field_content_float(i,"h_z",dbhandle);
    HouseInfo[id][ih_x] = cache_get_field_content_float(i,"ih_x",dbhandle);
    HouseInfo[id][ih_y] = cache_get_field_content_float(i,"ih_y",dbhandle);
    HouseInfo[id][ih_z] = cache_get_field_content_float(i,"ih_z",dbhandle);
    HouseInfo[id][hInterior] = cache_get_field_content_int(i,"h_interior",dbhandle);
    HouseInfo[id][ch_x] = cache_get_field_content_float(i,"ch_x",dbhandle);
    HouseInfo[id][ch_y] = cache_get_field_content_float(i,"ch_y",dbhandle);
    HouseInfo[id][ch_z] = cache_get_field_content_float(i,"ch_z",dbhandle);
    HouseInfo[id][ch_r] = cache_get_field_content_float(i,"ch_r",dbhandle);
    HouseInfo[id][hModel] = cache_get_field_content_int(i,"model",dbhandle);
    HouseInfo[id][hFarbe1] = cache_get_field_content_int(i,"farbe1",dbhandle);
    HouseInfo[id][hFarbe2] = cache_get_field_content_int(i,"farbe2",dbhandle);
    HouseInfo[id][hCarupgrade] = cache_get_field_content_int(i,"carupgrade",dbhandle);
    HouseInfo[id][hGeschlossen] = cache_get_field_content_int(i,"geschlossen",dbhandle);
    HouseInfo[id][hKasse] = cache_get_field_content_int(i,"kasse",dbhandle);
    HouseInfo[id][hMiete] = cache_get_field_content_int(i,"miete",dbhandle);
    HouseInfo[id][hPreis] = cache_get_field_content_int(i,"preis",dbhandle);
    HouseInfo[id][hKauflevel] = cache_get_field_content_int(i,"kauflevel",dbhandle);
    new tmp_name[MAX_PLAYER_NAME];
    cache_get_field_content(i,"besitzer",tmp_name,dbhandle);
    strmid(HouseInfo[id][hBesitzer],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    HouseInfo[id][hID] = cache_get_field_content_int(i,"id",dbhandle);
    AddStaticVehicle(HouseInfo[id][hModel],HouseInfo[id][ch_x],HouseInfo[id][ch_y],HouseInfo[id][ch_z],HouseInfo[id][ch_r],HouseInfo[id][hFarbe1],HouseInfo[id][hFarbe2]);
    if(HouseInfo[id][hCarupgrade] == 1)
    {
    new HouseCar = HouseInfo[id][hModel];
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    }
    updateHouse(id);
    }
    return 1;
    }

  • Du musst die VehicleID nehmen, nicht die ModelID.
    public OnHousesLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id = getFreeHouseID();
    if(id == -1) return 1;
    HouseInfo[id][h_x] = cache_get_field_content_float(i,"h_x",dbhandle);
    HouseInfo[id][h_y] = cache_get_field_content_float(i,"h_y",dbhandle);
    HouseInfo[id][h_z] = cache_get_field_content_float(i,"h_z",dbhandle);
    HouseInfo[id][ih_x] = cache_get_field_content_float(i,"ih_x",dbhandle);
    HouseInfo[id][ih_y] = cache_get_field_content_float(i,"ih_y",dbhandle);
    HouseInfo[id][ih_z] = cache_get_field_content_float(i,"ih_z",dbhandle);
    HouseInfo[id][hInterior] = cache_get_field_content_int(i,"h_interior",dbhandle);
    HouseInfo[id][ch_x] = cache_get_field_content_float(i,"ch_x",dbhandle);
    HouseInfo[id][ch_y] = cache_get_field_content_float(i,"ch_y",dbhandle);
    HouseInfo[id][ch_z] = cache_get_field_content_float(i,"ch_z",dbhandle);
    HouseInfo[id][ch_r] = cache_get_field_content_float(i,"ch_r",dbhandle);
    HouseInfo[id][hModel] = cache_get_field_content_int(i,"model",dbhandle);
    HouseInfo[id][hFarbe1] = cache_get_field_content_int(i,"farbe1",dbhandle);
    HouseInfo[id][hFarbe2] = cache_get_field_content_int(i,"farbe2",dbhandle);
    HouseInfo[id][hCarupgrade] = cache_get_field_content_int(i,"carupgrade",dbhandle);
    HouseInfo[id][hGeschlossen] = cache_get_field_content_int(i,"geschlossen",dbhandle);
    HouseInfo[id][hKasse] = cache_get_field_content_int(i,"kasse",dbhandle);
    HouseInfo[id][hMiete] = cache_get_field_content_int(i,"miete",dbhandle);
    HouseInfo[id][hPreis] = cache_get_field_content_int(i,"preis",dbhandle);
    HouseInfo[id][hKauflevel] = cache_get_field_content_int(i,"kauflevel",dbhandle);
    new tmp_name[MAX_PLAYER_NAME];
    cache_get_field_content(i,"besitzer",tmp_name,dbhandle);
    strmid(HouseInfo[id][hBesitzer],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    HouseInfo[id][hID] = cache_get_field_content_int(i,"id",dbhandle);
    new HouseCar = AddStaticVehicle(HouseInfo[id][hModel],HouseInfo[id][ch_x],HouseInfo[id][ch_y],HouseInfo[id][ch_z],HouseInfo[id][ch_r],HouseInfo[id][hFarbe1],HouseInfo[id][hFarbe2]);
    if(HouseInfo[id][hCarupgrade] == 1)
    {
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    }
    updateHouse(id);
    }
    return 1;
    }

  • Tut mir leid das es so lange gedauert hat aber ich hatte wenig Zeit.
    Zum Tunen:

    ocmd:carupgrade(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    if(IsPlayerInAnyVehicle(playerid) == HouseInfo[i][hModel])
    if(!strcmp(HouseInfo[i][hBesitzer],name,true))
    {
    new HouseCar = AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]);
    new upgradekosten = 150000;
    if(GetPlayerVehicleID(playerid) == HouseCar)
    {
    if(GetPlayerMoney(playerid) < upgradekosten) return SendClientMessage(playerid,Grau,"Du hast nicht genug Geld. (150000$)");
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    HouseInfo[i][hCarupgrade] = 1;
    GivePlayerMoney(playerid,-upgradekosten);
    SendClientMessage(playerid,Gruen,"Dein Housecar hat nun Nitro, neue Räder und Hydraulik.");
    }
    saveHouse(i);
    updateHouse(i);
    }
    return 1;
    }
    return 1;
    }

    ich weis nicht an was es liegt, aber dieser Befehl wird irgend wie nicht ausgeführt. Wenn ich ihn eingebe passiert gar nichts.


    Zum Housecar ändern:

    if(dialogid == DIALOG_HOUSECAR)
    {
    if(response == 0)
    {
    //Abbrechen
    return 1;
    }
    if(response == 1)
    {
    //Houscar ändern
    if(listitem == 0) //Sultan
    {
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    new kosten = 500000;
    new newmodel = 560;
    if(HouseInfo[i][hModel] == newmodel) return SendClientMessage(playerid,Grau,"Dieses Fahrzeug hast du bereits.");
    if(GetPlayerMoney(playerid) < kosten) return SendClientMessage(playerid,Grau,"Du hast nicht genug Geld.");
    DestroyVehicle(AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]));
    HouseInfo[i][hModel] = newmodel;
    GivePlayerMoney(playerid,-kosten);
    AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]);
    SendClientMessage(playerid,Gruen,"Du hast dein Housecar geändert.");
    saveHouse(i);
    updateHouse(i);
    break;
    }
    return 1;
    }
    if(listitem == 1) //Bullet
    {
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    new kosten = 700000;
    new newmodel = 541;
    if(HouseInfo[i][hModel] == newmodel) return SendClientMessage(playerid,Grau,"Dieses Fahrzeug hast du bereits.");
    if(GetPlayerMoney(playerid) < kosten) return SendClientMessage(playerid,Grau,"Du hast nicht genug Geld.");
    DestroyVehicle(AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]));
    HouseInfo[i][hModel] = newmodel;
    GivePlayerMoney(playerid,-kosten);
    AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]);
    SendClientMessage(playerid,Gruen,"Du hast dein Housecar geändert.");
    saveHouse(i);
    updateHouse(i);
    break;
    }
    return 1;
    }
    return 1;
    }
    }

    Hier wird das alte Housecar nicht sofort gelöscht.

  • Problem 1:

    Spoiler anzeigen
    ocmd:carupgrade(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    for(new i=0; i<sizeof(HouseInfo); i++)
    {
    if(GetPlayerVehicleID(playerid) == HouseInfo[i][hvID])
    {
    if(!strcmp(HouseInfo[i][hBesitzer],name,true))
    {
    new HouseCar = HouseInfo[i][hvID];
    new upgradekosten = 150000;
    if(GetPlayerVehicleID(playerid) == HouseCar)
    {
    if(GetPlayerMoney(playerid) < upgradekosten) return SendClientMessage(playerid,Grau,"Du hast nicht genug Geld. (150000$)");
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    HouseInfo[i][hCarupgrade] = 1;
    GivePlayerMoney(playerid,-upgradekosten);
    SendClientMessage(playerid,Gruen,"Dein Housecar hat nun Nitro, neue Räder und Hydraulik.");
    }
    saveHouse(i);
    updateHouse(i);
    return 1;
    }
    }
    }
    return 1;
    }

    Spoiler anzeigen
    public OnHousesLoad()
    {
    new num_fields,num_rows;
    cache_get_data(num_rows,num_fields,dbhandle);
    if(!num_rows)return 1;
    for(new i=0; i<num_rows; i++)
    {
    new id = getFreeHouseID();
    if(id == -1) return 1;
    HouseInfo[id][h_x] = cache_get_field_content_float(i,"h_x",dbhandle);
    HouseInfo[id][h_y] = cache_get_field_content_float(i,"h_y",dbhandle);
    HouseInfo[id][h_z] = cache_get_field_content_float(i,"h_z",dbhandle);
    HouseInfo[id][ih_x] = cache_get_field_content_float(i,"ih_x",dbhandle);
    HouseInfo[id][ih_y] = cache_get_field_content_float(i,"ih_y",dbhandle);
    HouseInfo[id][ih_z] = cache_get_field_content_float(i,"ih_z",dbhandle);
    HouseInfo[id][hInterior] = cache_get_field_content_int(i,"h_interior",dbhandle);
    HouseInfo[id][ch_x] = cache_get_field_content_float(i,"ch_x",dbhandle);
    HouseInfo[id][ch_y] = cache_get_field_content_float(i,"ch_y",dbhandle);
    HouseInfo[id][ch_z] = cache_get_field_content_float(i,"ch_z",dbhandle);
    HouseInfo[id][ch_r] = cache_get_field_content_float(i,"ch_r",dbhandle);
    HouseInfo[id][hModel] = cache_get_field_content_int(i,"model",dbhandle);
    HouseInfo[id][hFarbe1] = cache_get_field_content_int(i,"farbe1",dbhandle);
    HouseInfo[id][hFarbe2] = cache_get_field_content_int(i,"farbe2",dbhandle);
    HouseInfo[id][hCarupgrade] = cache_get_field_content_int(i,"carupgrade",dbhandle);
    HouseInfo[id][hGeschlossen] = cache_get_field_content_int(i,"geschlossen",dbhandle);
    HouseInfo[id][hKasse] = cache_get_field_content_int(i,"kasse",dbhandle);
    HouseInfo[id][hMiete] = cache_get_field_content_int(i,"miete",dbhandle);
    HouseInfo[id][hPreis] = cache_get_field_content_int(i,"preis",dbhandle);
    HouseInfo[id][hKauflevel] = cache_get_field_content_int(i,"kauflevel",dbhandle);
    new tmp_name[MAX_PLAYER_NAME];
    cache_get_field_content(i,"besitzer",tmp_name,dbhandle);
    strmid(HouseInfo[id][hBesitzer],tmp_name,0,sizeof(tmp_name),sizeof(tmp_name));
    HouseInfo[id][hID] = cache_get_field_content_int(i,"id",dbhandle);
    new HouseCar = AddStaticVehicle(HouseInfo[id][hModel],HouseInfo[id][ch_x],HouseInfo[id][ch_y],HouseInfo[id][ch_z],HouseInfo[id][ch_r],HouseInfo[id][hFarbe1],HouseInfo[id][hFarbe2]);
    HouseInfo[id][hvID] = HouseCar;
    if(HouseInfo[id][hCarupgrade] == 1)
    {
    AddVehicleComponent(HouseCar, 1010); //Nitro
    AddVehicleComponent(HouseCar, 1074); //Räder
    AddVehicleComponent(HouseCar, 1087); //Hydraulik
    }
    updateHouse(id);
    }
    return 1;
    }

    Versuche es so.
    Außerdem musst du im Enum zu HouseInfo noch "hvID" einfügen.



    Problem 2:
    DestroyVehicle(AddStaticVehicle(HouseInfo[i][hModel],HouseInfo[i][ch_x],HouseInfo[i][ch_y],HouseInfo[i][ch_z],HouseInfo[i][ch_r],HouseInfo[i][hFarbe1],HouseInfo[i][hFarbe2]));
    zu:
    DestroyVehicle(HouseInfo[i][hvID]);


    Dort musst du aber noch abfragen, an welchem Haus sich der Spieler befindet, das machst du momentan noch nicht.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen