Haussystem Z Coordinate geht nicht in die Datei und man ist nicht am Ort=

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
  • Hey Com,


    Bei meinem AddHaus stock sind jetzt 2 Fehler:


    ALso erstens: DIe Z Coordinate ist 000.0000 in der Datei immer!
    Zweitens: Wenn man am Haus steht steht da du bist nicht an der richtigen Stelle:


    AddhAus stock
    stock AddHaus(Float:x,Float:y,Float:z,Hauskosten,interior)
    {
    new Data[28], hausedit, owner[128];
    for(new i = 1; i <MaxHaus; i++)
    {
    hausedit = i;
    format(Data,sizeof(Data),"/Haus/%d.ini",i);
    if(!fexist(Data))
    {
    dini_Create(Data);
    PlayerHaus[hausedit][Hausid] = i;
    PlayerHaus[hausedit][Hausx] = x;
    PlayerHaus[hausedit][Hausy] = y;
    PlayerHaus[hausedit][Hausz] = z;
    PlayerHaus[hausedit][Kosten] = Hauskosten;
    PlayerHaus[hausedit][Hauslabel] = 1;

    switch(interior)
    {
    case 1:
    {
    PlayerHaus[hausedit][AHausx] = 444.646911;
    PlayerHaus[hausedit][AHausy] = 508.239044;
    PlayerHaus[hausedit][AHausz] = 1001.419494;
    PlayerHaus[hausedit][Interior] = 12;
    }
    case 2:
    {
    PlayerHaus[hausedit][AHausx] = 1889.953369;
    PlayerHaus[hausedit][AHausy] = 1017.438293;
    PlayerHaus[hausedit][AHausy] = 31.882812;
    PlayerHaus[hausedit][Interior] = 10;
    }
    case 3:
    {
    PlayerHaus[hausedit][AHausx] = 244.411987;
    PlayerHaus[hausedit][AHausy] = 305.032989;
    PlayerHaus[hausedit][AHausy] = 999.1484;
    PlayerHaus[hausedit][Interior] = 1;
    }
    case 4:
    {
    PlayerHaus[hausedit][AHausx] = 271.884979;
    PlayerHaus[hausedit][AHausy] = 306.631988;
    PlayerHaus[hausedit][AHausy] = 999.148437;
    PlayerHaus[hausedit][Interior] = 2;
    }
    case 5:
    {
    PlayerHaus[hausedit][AHausx] = 291.282989;
    PlayerHaus[hausedit][AHausy] = 310.031982;
    PlayerHaus[hausedit][AHausy] = 999.148437;
    PlayerHaus[hausedit][Interior] = 3;
    }
    case 6:
    {
    PlayerHaus[hausedit][AHausx] = 302.180999;
    PlayerHaus[hausedit][AHausy] = 300.722991;
    PlayerHaus[hausedit][AHausy] = 999.148437;
    PlayerHaus[hausedit][Interior] = 4;
    }
    case 7:
    {
    PlayerHaus[hausedit][AHausx] = 346.870025;
    PlayerHaus[hausedit][AHausy] = 309.259033;
    PlayerHaus[hausedit][AHausy] = 999.155700;
    PlayerHaus[hausedit][Interior] = 6;
    }
    case 8:
    {
    PlayerHaus[hausedit][AHausx] = 2496.049804;
    PlayerHaus[hausedit][AHausy] = -1695.238159;
    PlayerHaus[hausedit][AHausy] = 1014.742187;
    PlayerHaus[hausedit][Interior] = 3;
    }
    case 9:
    {
    PlayerHaus[hausedit][AHausx] = 2454.717041;
    PlayerHaus[hausedit][AHausy] = -1700.871582;
    PlayerHaus[hausedit][AHausy] = 1013.515197;
    PlayerHaus[hausedit][Interior] = 2;
    }
    case 10:
    {
    PlayerHaus[hausedit][AHausx] = 318.564971;
    PlayerHaus[hausedit][AHausy] = 1118.209960;
    PlayerHaus[hausedit][AHausy] = 1083.882812;
    PlayerHaus[hausedit][Interior] = 5;
    }
    }


    //Formatierungen
    new striing[64];
    format(owner,sizeof(owner),"Der Staat");
    PlayerHaus[hausedit][Owner] = owner;
    format(striing,sizeof(striing),"|____Pixel Roleplay____|\nBesitzer: %s",PlayerHaus[hausedit][Owner]);


    //In die Datei Speicherung
    dini_IntSet(Data,"Hausid",PlayerHaus[hausedit][Hausid]);
    dini_FloatSet(Data,"Hausx",PlayerHaus[hausedit][Hausx]);
    dini_FloatSet(Data,"Hausy",PlayerHaus[hausedit][Hausy]);
    dini_FloatSet(Data,"Hausz",PlayerHaus[hausedit][Hausz]);
    dini_Set(Data,"Owner",PlayerHaus[hausedit][Owner]);
    dini_IntSet(Data,"Hauskosten",PlayerHaus[hausedit][Kosten]);
    dini_IntSet(Data,"Interior",PlayerHaus[hausedit][Interior]);
    dini_FloatSet(Data,"AHausx",PlayerHaus[hausedit][AHausx]);
    dini_FloatSet(Data,"AHausy",PlayerHaus[hausedit][AHausy]);
    dini_FloatSet(Data,"AHausz",PlayerHaus[hausedit][AHausz]);


    //Create3DTextLabel
    labelhaus = Create3DTextLabel(striing,0x00DD009A,PlayerHaus[hausedit][Hausx],PlayerHaus[hausedit][Hausy],PlayerHaus[hausedit][Hausz],20.0,0,0);
    CreatePickup(1273,1,PlayerHaus[hausedit][Hausx],PlayerHaus[hausedit][Hausy],PlayerHaus[hausedit][Hausz],0);
    return 1;
    }
    }
    return 1;
    }


    Der Enter Befehl:


    if(strcmp(cmd, "/hausenter", true) == 0)
    {
    for(new i = 1; i <MaxHaus; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid,5.0,PlayerHaus[i][Hausx],PlayerHaus[i][Hausy],PlayerHaus[i][Hausz]))
    {
    if(PlayerHaus[i][Hausid] == PlayerInfo[playerid][pHauskey] || PlayerHaus[i][Hausid] == PlayerInfo[playerid][pMietKey])
    {
    SetPlayerPos(playerid,PlayerHaus[i][AHausx],PlayerHaus[i][AHausy],PlayerHaus[i][AHausz]);
    SetPlayerInterior(playerid,PlayerHaus[i][Interior]);
    }
    else{ SendClientMessage(playerid,WHITE,"Das Haus gehört dir nicht!"); }
    }
    else
    {
    SendClientMessage(playerid,WHITE,"Du bist an keinem Haus!");
    return 1;
    }
    }
    }


    Danke für hilfe