Server sagt mir Unknow Command obwohl befehl da ist :X

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 leute ich ich habe problem und zwar gibts mein befehl nur sagt er mir wenn ich admin bin "Unknow Command" und wenn ich kein admin bin sagt er ich bin nicht berechtigt



    if(strcmp(cmd, "/setbizz", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new houseid = -1;


    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X,Y,Z);


    if (PlayerInfo[playerid][pAdmin] >= 1338 || IsPlayerAdmin(playerid))
    {
    for(new ha = 0; ha < sizeof(BizzInfo); ha++)
    {
    if(BizzInfo[ha][bSetted] == 1)
    {
    houseid = ha + 1;
    }
    }


    if(BizzInfo[houseid][bSetted] == 0)
    {
    new string2[256];


    format(string, sizeof(string),"config/Bizzes/%d.ini",houseid);
    dini_Create(string);


    tmp = strtok2(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /setbizz [type]");
    SendClientMessage(playerid, COLOR_GRAD2, "TYPES: 0 (Cluckin Bell) - 1 (Burger Shoot) - 2 (Pizza Stack) - 3 (Donut Shop) - 4 (24-7) - 5 (Strip Club) - 6 (Bar) - 7 (Gym)");
    SendClientMessage(playerid, COLOR_GRAD2, "TYPES: 8 (Sex Shop) - 9 (Binco) - 10 (Ammunation) - 11 (Disco) - 12 (Restaurant) - 13 (ZIP) - 14(Victom) - 15 (Sub Urban)");
    return 1;
    }
    new type;
    type = strval(tmp);


    if(type == 0) // Cluckin
    {
    BizzInfo[houseid][bExitX] = 365.779296;
    BizzInfo[houseid][bExitY] = -9.169898;
    BizzInfo[houseid][bExitZ] = 1001.851623;


    BizzInfo[houseid][bBuyPrice] = 325000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 9;
    BizzInfo[houseid][bInteriorNr] = 20;


    strmid(BizzInfo[houseid][bMessage],"Cluckin' Bell",0,strlen("Cluckin' Bell"),255);
    }
    else if(type == 1) // Burger
    {
    BizzInfo[houseid][bExitX] = 366.032409;
    BizzInfo[houseid][bExitY] = -72.639999;
    BizzInfo[houseid][bExitZ] = 1001.507812;


    BizzInfo[houseid][bBuyPrice] = 325000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 10;
    BizzInfo[houseid][bInteriorNr] = 21;


    strmid(BizzInfo[houseid][bMessage],"Burger Shoot",0,strlen("Burger Shoot"),255);
    }
    else if(type == 2) // Pizza
    {
    BizzInfo[houseid][bExitX] = 372.411712;
    BizzInfo[houseid][bExitY] = -130.457702;
    BizzInfo[houseid][bExitZ] = 1001.492187;


    BizzInfo[houseid][bBuyPrice] = 325000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 5;
    BizzInfo[houseid][bInteriorNr] = 22;


    strmid(BizzInfo[houseid][bMessage],"Pizza Shop",0,strlen("Pizza Shop"),255);
    }
    else if(type == 3) // Donut
    {
    BizzInfo[houseid][bExitX] = 377.172393;
    BizzInfo[houseid][bExitY] = -193.304504;
    BizzInfo[houseid][bExitZ] = 1000.632812;


    BizzInfo[houseid][bBuyPrice] = 350000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 17;
    BizzInfo[houseid][bInteriorNr] = 30;


    strmid(BizzInfo[houseid][bMessage],"Donut Shop",0,strlen("Donut Shop"),255);
    }
    else if(type == 4) // 24-7
    {
    if(nextshop == 1)
    {
    BizzInfo[houseid][bExitX] = -25.132600;
    BizzInfo[houseid][bExitY] = -139.067001;
    BizzInfo[houseid][bExitZ] = 1003.546875;
    BizzInfo[houseid][bInterior] = 16;


    nextshop ++;
    }
    else if(nextshop == 2)
    {
    BizzInfo[houseid][bExitX] = -28.261899;
    BizzInfo[houseid][bExitY] = -31.767400;
    BizzInfo[houseid][bExitZ] = 1003.546875;
    BizzInfo[houseid][bInterior] = 4;


    nextshop ++;
    }
    else if(nextshop == 3)
    {
    BizzInfo[houseid][bExitX] = -27.391899;
    BizzInfo[houseid][bExitY] = -58.252899;
    BizzInfo[houseid][bExitZ] = 1003.546875;
    BizzInfo[houseid][bInterior] = 6;


    nextshop ++;
    }
    else if(nextshop == 4)
    {
    BizzInfo[houseid][bExitX] = -30.929899;
    BizzInfo[houseid][bExitY] = -92.011398;
    BizzInfo[houseid][bExitZ] = 1003.546875;
    BizzInfo[houseid][bInterior] = 18;


    nextshop = 1;
    }



    BizzInfo[houseid][bBuyPrice] = 350000;
    BizzInfo[houseid][bLevelNeeded] = 5;
    BizzInfo[houseid][bInteriorNr] = 12;


    strmid(BizzInfo[houseid][bMessage],"24-7",0,strlen("24-7"),255);
    }
    else if(type == 5) // Pig Pen
    {
    BizzInfo[houseid][bExitX] = 1204.846191;
    BizzInfo[houseid][bExitY] = -13.852100;
    BizzInfo[houseid][bExitZ] = 1000.921875;


    BizzInfo[houseid][bBuyPrice] = 385000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 2;
    BizzInfo[houseid][bInteriorNr] = 17;


    strmid(BizzInfo[houseid][bMessage],"Strip Club",0,strlen("Strip Club"),255);
    }
    else if(type == 6) // Bar
    {
    BizzInfo[houseid][bExitX] = 501.870788;
    BizzInfo[houseid][bExitY] = -67.582000;
    BizzInfo[houseid][bExitZ] = 998.757812;


    BizzInfo[houseid][bBuyPrice] = 350000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 11;
    BizzInfo[houseid][bInteriorNr] = 26;


    strmid(BizzInfo[houseid][bMessage],"Bar",0,strlen("Bar"),255);
    }
    else if(type == 7) // Gym
    {
    BizzInfo[houseid][bExitX] = 772.359375;
    BizzInfo[houseid][bExitY] = -5.515697;
    BizzInfo[houseid][bExitZ] = 1000.728576;


    BizzInfo[houseid][bBuyPrice] = 400000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 5;
    BizzInfo[houseid][bInteriorNr] = 15;


    strmid(BizzInfo[houseid][bMessage],"Gym",0,strlen("Gym"),255);
    }
    else if(type == 8) // Sex Shop
    {
    BizzInfo[houseid][bExitX] = -100.295700;
    BizzInfo[houseid][bExitY] = -24.654399;
    BizzInfo[houseid][bExitZ] = 1000.718811;


    BizzInfo[houseid][bBuyPrice] = 350000;
    BizzInfo[houseid][bLevelNeeded] = 5;
    BizzInfo[houseid][bInterior] = 3;
    BizzInfo[houseid][bInteriorNr] = 34;


    strmid(BizzInfo[houseid][bMessage],"Sex Shop",0,strlen("Sex Shop"),255);
    }
    else if(type == 9) // Binco
    {
    BizzInfo[houseid][bExitX] = 207.766204;
    BizzInfo[houseid][bExitY] = -111.266296;
    BizzInfo[houseid][bExitZ] = 1005.132812;


    BizzInfo[houseid][bBuyPrice] = 600000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 15;
    BizzInfo[houseid][bInteriorNr] = 16;


    strmid(BizzInfo[houseid][bMessage],"Binco",0,strlen("Binco"),255);
    }
    else if(type == 10) // Ammunation
    {
    BizzInfo[houseid][bExitX] = 315.762786;
    BizzInfo[houseid][bExitY] = -143.661193;
    BizzInfo[houseid][bExitZ] = 999.601623;


    BizzInfo[houseid][bBuyPrice] = 750000;
    BizzInfo[houseid][bLevelNeeded] = 10;
    BizzInfo[houseid][bInterior] = 7;
    BizzInfo[houseid][bInteriorNr] = 14;


    strmid(BizzInfo[houseid][bMessage],"Ammunation",0,strlen("Ammunation"),255);
    }
    else if(type == 11) // Disco
    {
    BizzInfo[houseid][bExitX] = 493.439300;
    BizzInfo[houseid][bExitY] = -24.916900;
    BizzInfo[houseid][bExitZ] = 1000.671875;


    BizzInfo[houseid][bBuyPrice] = 350000;
    BizzInfo[houseid][bLevelNeeded] = 6;
    BizzInfo[houseid][bInterior] = 17;
    BizzInfo[houseid][bInteriorNr] = 18;


    strmid(BizzInfo[houseid][bMessage],"Disco",0,strlen("Disco"),255);
    }
    else if(type == 12) // Restaurant
    {
    BizzInfo[houseid][bExitX] = 460.265411;
    BizzInfo[houseid][bExitY] = -88.611503;
    BizzInfo[houseid][bExitZ] = 999.554687;


    BizzInfo[houseid][bBuyPrice] = 300000;
    BizzInfo[houseid][bLevelNeeded] = 5;
    BizzInfo[houseid][bInterior] = 4;
    BizzInfo[houseid][bInteriorNr] = 38;


    strmid(BizzInfo[houseid][bMessage],"Restaurant",0,strlen("Restaurant"),255);
    }
    else if(type == 13) // ZIP
    {
    BizzInfo[houseid][bExitX] = 161.410293;
    BizzInfo[houseid][bExitY] = -96.687202;
    BizzInfo[houseid][bExitZ] = 1001.804687;


    BizzInfo[houseid][bBuyPrice] = 600000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 18;
    BizzInfo[houseid][bInteriorNr] = 36;


    strmid(BizzInfo[houseid][bMessage],"ZIP",0,strlen("ZIP"),255);
    }
    else if(type == 14) // Victim
    {
    BizzInfo[houseid][bExitX] = 227.342803;
    BizzInfo[houseid][bExitY] = -8.243800;
    BizzInfo[houseid][bExitZ] = 1002.210876;


    BizzInfo[houseid][bBuyPrice] = 600000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 5;
    BizzInfo[houseid][bInteriorNr] = 37;


    strmid(BizzInfo[houseid][bMessage],"Victim",0,strlen("Victim"),255);
    }
    else if(type == 15) // Suburban
    {
    BizzInfo[houseid][bExitX] = 203.895294;
    BizzInfo[houseid][bExitY] = -50.656700;
    BizzInfo[houseid][bExitZ] = 1001.804687;


    BizzInfo[houseid][bBuyPrice] = 600000;
    BizzInfo[houseid][bLevelNeeded] = 8;
    BizzInfo[houseid][bInterior] = 1;
    BizzInfo[houseid][bInteriorNr] = 35;


    strmid(BizzInfo[houseid][bMessage],"Sub urban",0,strlen("Sub urban"),255);
    }


    BizzInfo[houseid][bEntranceX] = X;
    BizzInfo[houseid][bEntranceY] = Y;
    BizzInfo[houseid][bEntranceZ] = Z;
    BizzInfo[houseid][bVirWorld] = houseid;
    BizzInfo[houseid][bSetted] = 1;


    EvaluateBizz(houseid);


    strmid(BizzInfo[houseid][bOwner],"Der Staat",0,strlen("Der Staat"),255);
    strmid(BizzInfo[houseid][bExtortion],"No-One",0,strlen("No-One"),255);


    format(string, sizeof(string),"* Created the bizz number %d. The bizz was set automatically, Use /edit to edit it if you want.",houseid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);


    format(string,sizeof(string),"[ADMIN]: %s Has Set Bizz: [%d]'s entrance to [%f - %f - %f].",sendername,houseid,X,Y,Z);
    ABroadCast(COLOR_LIGHTRED,string, 5);


    format(string2,sizeof(string2),"Bizz is Unowned! \n %s \n Bizz ID: %d \n Price: $%d \n Level Needed: %d \n To Buy This, /buybiz",BizzInfo[houseid][bMessage],houseid, BizzInfo[houseid][bBuyPrice],BizzInfo[houseid][bLevelNeeded]);
    BizzLabel[houseid] = Create3DTextLabel(string2 ,0x00FF00AA,X,Y,Z,50, 0, 1);
    BizzPickup[houseid] = CreatePickup(1274,1,X,Y,Z,-1);


    OnPropUpdate(2,houseid);
    OnPropTextdrawUpdate(2, houseid);


    SendClientMessage(playerid, COLOR_GREY,"* The label will appear on next server restart due to limit of labels!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Bizzid already setted!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "** Du darfst diesen Befehl nicht benutzen!");
    }
    }
    return 1;
    }


    if(strcmp(cmd, "/sethouse", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    new houseid = -1;
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X,Y,Z);
    if (PlayerInfo[playerid][pAdmin] >= 1338 || IsPlayerAdmin(playerid))
    {
    new string2[256];


    for(new hs = 0; hs < sizeof(HouseInfo); hs++)
    {
    if(HouseInfo[hs][hSetted] == 1)
    {
    houseid = hs + 1;
    }
    }
    if(HouseInfo[houseid][hSetted] == 0)
    {
    format(string, sizeof(string),"config/Properties/%d.ini",houseid);
    dini_Create(string);


    tmp = strtok2(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /sethouse [type]");
    SendClientMessage(playerid, COLOR_GRAD2, "TYPES: 0 Apartment - 1 Small - 2 Medium - 3 Big");
    return 1;
    }
    new type;
    type = strval(tmp);
    if(type == 0)
    {
    HouseInfo[houseid][hValue] = 45000;
    HouseInfo[houseid][hLevel] = 3;
    strmid(HouseInfo[houseid][hDiscription], "House Apartment", 0, strlen("House Apartment"), 255);
    if(nextapartment == 24)
    {
    nextapartment = 25;
    HouseInfo[houseid][hExitx] = 244.411987; HouseInfo[houseid][hExity] = 305.032990; HouseInfo[houseid][hExitz] = 999.231995;
    HouseInfo[houseid][hInt] = 1;
    }
    else if(nextapartment == 25)
    {
    nextapartment = 27;
    HouseInfo[houseid][hExitx] = 266.4991; HouseInfo[houseid][hExity] = 304.9922; HouseInfo[houseid][hExitz] = 999.1484;
    HouseInfo[houseid][hInt] = 2;
    }
    else if(nextapartment == 27)
    {
    nextapartment = 29;
    HouseInfo[houseid][hExitx] = 302.181000; HouseInfo[houseid][hExity] = 300.722992; HouseInfo[houseid][hExitz] = 999.231995;
    HouseInfo[houseid][hInt] = 4;
    }
    else if(nextapartment == 29)
    {
    nextapartment = 24;
    HouseInfo[houseid][hExitx] = 346.870025; HouseInfo[houseid][hExity] = 309.259033; HouseInfo[houseid][hExitz] = 999.155700;
    HouseInfo[houseid][hInt] = 6;
    }
    }
    else if(type == 1)
    {
    HouseInfo[houseid][hValue] = 50000;
    HouseInfo[houseid][hLevel] = 4;
    strmid(HouseInfo[houseid][hDiscription], "House Small", 0, strlen("House Small"), 255);
    if(nexthouse == 2)
    {
    nexthouse = 3;
    HouseInfo[houseid][hExitx] = 225.756989; HouseInfo[houseid][hExity] = 1240.000000; HouseInfo[houseid][hExitz] = 1082.149902;
    HouseInfo[houseid][hInt] = 2;
    }
    else if(nexthouse == 3)
    {
    nexthouse = 6;
    HouseInfo[houseid][hExitx] = 223.1929; HouseInfo[houseid][hExity] = 1287.0780; HouseInfo[houseid][hExitz] = 1082.1406;
    HouseInfo[houseid][hInt] = 1;
    }
    else if(nexthouse == 6)
    {
    nexthouse = 12;
    HouseInfo[houseid][hExitx] = 328.1066; HouseInfo[houseid][hExity] = 1478.0106; HouseInfo[houseid][hExitz] = 1084.4375;
    HouseInfo[houseid][hInt] = 15;
    }
    else if(nexthouse == 12)
    {
    nexthouse = 41;
    HouseInfo[houseid][hExitx] = 260.983978; HouseInfo[houseid][hExity] = 1286.549927; HouseInfo[houseid][hExitz] = 1080.299927;
    HouseInfo[houseid][hInt] = 4;
    }
    else if(nexthouse == 41)
    {
    nexthouse = 2;
    HouseInfo[houseid][hExitx] = 446.5014; HouseInfo[houseid][hExity] = 507.0295; HouseInfo[houseid][hExitz] = 1001.4195;
    HouseInfo[houseid][hInt] = 12;
    }


    }
    else if(type == 2)
    {
    HouseInfo[houseid][hValue] = 65000;
    HouseInfo[houseid][hLevel] = 6;
    strmid(HouseInfo[houseid][hDiscription], "House Medium", 0, strlen("House Medium"), 255);
    if(nextmedium == 17)
    {
    nextmedium = 19;
    HouseInfo[houseid][hExitx] = 140.2267; HouseInfo[houseid][hExity] = 1365.9246; HouseInfo[houseid][hExitz] = 1083.8594;
    HouseInfo[houseid][hInt] = 5;
    }
    else if(nextmedium == 19)
    {
    nextmedium = 21;
    HouseInfo[houseid][hExitx] = -68.294098; HouseInfo[houseid][hExity] = 1353.469971; HouseInfo[houseid][hExitz] = 1080.279907;
    HouseInfo[houseid][hInt] = 6;
    }
    else if(nextmedium == 21)
    {
    nextmedium = 30;
    HouseInfo[houseid][hExitx] = -42.581997; HouseInfo[houseid][hExity] = 1408.109985; HouseInfo[houseid][hExitz] = 1084.449951;
    HouseInfo[houseid][hInt] = 8;
    }
    else if(nextmedium == 30)
    {
    nextmedium = 32;
    HouseInfo[houseid][hExitx] = 2495.6416; HouseInfo[houseid][hExity] = -1692.2361; HouseInfo[houseid][hExitz] = 1014.7422;
    HouseInfo[houseid][hInt] = 3;
    }
    else if(nextmedium == 32)
    {
    nextmedium = 38;
    HouseInfo[houseid][hExitx] = 2468.4502; HouseInfo[houseid][hExity] = -1698.4801; HouseInfo[houseid][hExitz] = 1013.5078;
    HouseInfo[houseid][hInt] = 2;
    }
    else if(nextmedium == 38)
    {
    nextmedium = 39;
    HouseInfo[houseid][hExitx] = 2807.9172; HouseInfo[houseid][hExity] = -1174.4333; HouseInfo[houseid][hExitz] = 1025.5703;
    HouseInfo[houseid][hInt] = 8;
    }
    else if(nextmedium == 39)
    {
    nextmedium = 17;
    HouseInfo[houseid][hExitx] = 318.7010; HouseInfo[houseid][hExity] = 1114.7716; HouseInfo[houseid][hExitz] = 1083.8828;
    HouseInfo[houseid][hInt] = 5;
    }
    }
    else if(type == 3)
    {
    HouseInfo[houseid][hValue] = 85000;
    HouseInfo[houseid][hLevel] = 9;
    strmid(HouseInfo[houseid][hDiscription], "House Big", 0, strlen("House Big"), 255);
    if(nextbig == 1)
    {
    nextbig = 4;
    HouseInfo[houseid][hExitx] = 235.3054; HouseInfo[houseid][hExity] = 1186.6835; HouseInfo[houseid][hExitz] = 1080.2578;
    HouseInfo[houseid][hInt] = 3;
    }
    else if(nextbig == 4)
    {
    nextbig = 11;
    HouseInfo[houseid][hExitx] = 225.630997; HouseInfo[houseid][hExity] = 1022.479980; HouseInfo[houseid][hExitz] = 1084.069946;
    HouseInfo[houseid][hInt] = 7;
    }
    else if(nextbig == 11)
    {
    nextbig = 13;
    HouseInfo[houseid][hExitx] = 227.722992; HouseInfo[houseid][hExity] = 1114.389893; HouseInfo[houseid][hExitz] = 1081.189941;
    HouseInfo[houseid][hInt] = 5;
    }
    else if(nextbig == 13)
    {
    nextbig = 14;
    HouseInfo[houseid][hExitx] = 221.7330; HouseInfo[houseid][hExity] = 1140.5146; HouseInfo[houseid][hExitz] = 1082.6094;
    HouseInfo[houseid][hInt] = 4;
    }
    else if(nextbig == 14)
    {
    nextbig = 15;
    HouseInfo[houseid][hExitx] = 27.132700; HouseInfo[houseid][hExity] = 1341.149902; HouseInfo[houseid][hExitz] = 1084.449951;
    HouseInfo[houseid][hInt] = 10;
    }
    else if(nextbig == 15)
    {
    nextbig = 40;
    HouseInfo[houseid][hExitx] = -262.601990; HouseInfo[houseid][hExity] = 1456.619995; HouseInfo[houseid][hExitz] = 1084.449951;
    HouseInfo[houseid][hInt] = 4;
    }
    else if(nextbig == 40)
    {
    nextbig = 1;
    HouseInfo[houseid][hExitx] = 2324.3267; HouseInfo[houseid][hExity] = -1149.1440; HouseInfo[houseid][hExitz] = 1050.7101;
    HouseInfo[houseid][hInt] = 12;
    }
    }
    HouseInfo[houseid][hEntrancex] = X;
    HouseInfo[houseid][hEntrancey] = Y;
    HouseInfo[houseid][hEntrancez] = Z;
    HouseInfo[houseid][hWorld] = houseid;
    HouseInfo[houseid][hSetted] = 1;
    strmid(HouseInfo[houseid][hOwner],"Der Staat",0,strlen("Der Staat"),255);
    strmid(HouseInfo[houseid][hMessage],"Zu Verkaufen",0,strlen("Zu Verkaufen"),255);
    EvaluateHouse(houseid);
    format(string, sizeof(string),"* Haus nummer %d wurde erstellt. Das haus kann mit /edit angepasst werden.",houseid);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string,sizeof(string),"[ADMIN]: %s Has Set House: [%d]'s entrance to [%f - %f - %f].",sendername,houseid,X,Y,Z);
    ABroadCast(COLOR_LIGHTRED,string, 5);
    format(string2,sizeof(string2),"Zu Verkaufen!! \n Haus ID: %d \n Preis: $%d \n Beschreibung: %s \n Benoetigtes Level: %d",HouseInfo[houseid][hWorld], HouseInfo[houseid][hValue],HouseInfo[houseid][hDiscription], HouseInfo[houseid][hLevel]);
    HouseLabel[houseid] = Create3DTextLabel(string2 ,0x00FF00AA,X,Y,Z,25, 0, 1);
    HousePickup[houseid] = CreatePickup(1273, 1, HouseInfo[houseid][hEntrancex], HouseInfo[houseid][hEntrancey], HouseInfo[houseid][hEntrancez]);
    OnPropUpdate(1,houseid);
    OnPropTextdrawUpdate(1, houseid);
    OnHousePickupUpdate(houseid);
    SendClientMessage(playerid, COLOR_GREY,"* Das Icon erscheint, fals noch nicht, beim naechsten restart!");
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Houseid already setted!");
    return 1;
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GRAD1, "** Du darfst diesen Befehl nicht benutzen!");
    }
    }
    return 1;
    }


    //edit


    Rechtschreibung

    Einmal editiert, zuletzt von Falke1992 ()

  • Return sind doch über all ich weis nicht wo problem sein soll :X

  • Bei /sethouse oder /setbizz?
    BTW ist deine Rechtschreibung da in den Befehlen grausig :o


    EDIT: Okay, ich hab einen möglichen Fehler gefunden.
    Zuerst musst du mir aber erklären, warum diese for-Schleife jeweils am Anfang alle Geschäfte/Häuser durchgeht. Sinn?

  • b & h setted sind für textdraw da:


    Code vom aus führen:


    or(new h = 0; h < sizeof(HouseInfo); h++)
    {
    if(HouseInfo[h][hSetted] == 1)
    {
    if(HouseInfo[h][hOwned] == 0)
    {
    if(HouseInfo[h][hSetted] == 1)
    {
    format(PropertyString,sizeof(PropertyString),"Das Haus ist zu Verkaufen! \n Haus ID: %d \n Preis: $%d \n Beschreibung: %s \n Level: %d",HouseInfo[h][hWorld], HouseInfo[h][hValue],HouseInfo[h][hDiscription], HouseInfo[h][hLevel]);
    HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00AA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
    HousePickup[h] = CreatePickup(1273, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
    }
    }
    else if(HouseInfo[h][hOwned] == 1)
    {
    format(PropertyString,sizeof(PropertyString),"%s \n Besitzer: %s \n Haus ID: %d \n Mietpreis: $%d \n Beschreibung: %s \n Zum Mieten /rentroom",HouseInfo[h][hMessage],HouseInfo[h][hOwner],HouseInfo[h][hWorld], HouseInfo[h][hRent], HouseInfo[h][hDiscription]);
    HouseLabel[h] = Create3DTextLabel(PropertyString ,0x00FFFFAA,HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez],25, 0, 1);
    HousePickup[h] = CreatePickup(1272, 1, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
    }
    }
    }
    for(new h = 0; h < sizeof(BizzInfo); h++)
    {
    if(BizzInfo[h][bSetted] == 1)
    {
    if(BizzInfo[h][bOwned] == 0)
    {
    format(PropertyString,sizeof(PropertyString),"Biz zu Verkaufen! \n %s \n Biz ID: %d \n Preis: $%d \n Level: %d \n Um es zu kaufen, /buybiz",BizzInfo[h][bMessage], BizzInfo[h][bVirWorld], BizzInfo[h][bBuyPrice], BizzInfo[h][bLevelNeeded]);
    BizzLabel[h] = Create3DTextLabel(PropertyString ,0x00FF00AA,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ],50, 0, 1);
    }
    else if(BizzInfo[h][bOwned] == 1)
    {
    format(PropertyString,sizeof(PropertyString),"%s \n Besitzer: %s \n Biz ID: %d \n Teilhaber: %s \n Eintrittspreis: $%d. \n Um rein zu gehen, /enter.",BizzInfo[h][bMessage],BizzInfo[h][bOwner], BizzInfo[h][bVirWorld], BizzInfo[h][bExtortion], BizzInfo[h][bEntranceCost]);
    BizzLabel[h] = Create3DTextLabel(PropertyString ,0x00FFFFAA,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ],50, 0, 1);
    }
    BizzPickup[h] = CreatePickup(1274,1,BizzInfo[h][bEntranceX], BizzInfo[h][bEntranceY], BizzInfo[h][bEntranceZ],-1);
    }
    }


    Die schleifen sind zum überprüfen ob schon ein textdraw da ist oder nicht

  • Also, da ich grade doch nicht so viel Zeit dafür habe, als gedacht, geb ich dir eine Kurzfassung:
    Das hast du oben stehen:
    new houseid = -1;
    Und dann die Abfrage:
    for(new ha = 0; ha < sizeof(BizzInfo); ha++)
    {
    if(BizzInfo[ha][bSetted] == 1)
    {
    houseid = ha + 1;
    }
    }
    Nehmen wir mal an, bei keinem Biz ist bSetted 1.
    Dann haben wir am Ende bei houseid immernoch -1.


    Dann folgt diese Abfrage:
    if(BizzInfo[houseid][bSetted] == 0)
    Das ist nun das Problem. Ein Array hat NIEMALS Werte außerhalb des Definierten Bereiches (0 bis zur Zahl im new -1 (also bei new muh[3] von 0 bis 2))


    Wenn also eine Variable des Arrays außerhalb abgerufen wird, erscheint bei OnPlayerCommandText ein "Unknown Command"-Fehler (in manchen Fällen crasht auch das Script).


    Füg also eine Abfrage für -1 ein, dann ist alles erledigt ;)

  • Wie genau meinst du das genau? Also wie genau soll ich das jeds machen`?


    //edit


    Texthinzugefügt

    Einmal editiert, zuletzt von Falke1992 ()

  • Ersetze:


    if(HouseInfo[houseid][hSetted] == 0)mitif(houseid != -1)
    {
    if(HouseInfo[houseid][hSetted] == 0)
    und
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Houseid already setted!");
    return 1;
    }mit
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Houseid already setted!");
    return 1;
    }
    }



    und



    if(BizzInfo[houseid][hSetted] == 0)mitif(houseid != -1)
    {
    if(BizzInfo[houseid][hSetted] == 0)
    und
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Bizzid already setted!");
    return 1;
    }mit
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, "* ERROR: Automatic detected Bizzid already setted!");
    return 1;
    }
    }