House Level Error
#1

So when i create house level of it should be 4 as it is defined in variable

pawn Код:
HInfo[id][Level] = 4;
But when created, on label level is 109 and i have no idea why, here is the code.

pawn Код:
new string[2500];
                        new id = SpawnedHouses+1;
                        new vw = random(2000);
                        new Float:ulazx, Float:ulazy, Float:ulazz, Float:ulaza;
                        GetPlayerPos(playerid, ulazx, ulazy, ulazz);
                        GetPlayerFacingAngle(playerid, ulaza);
                       
                        format(string, sizeof(string), "INSERT INTO `kuce` (`ID`, `ImaVlasnika`, `Vlasnik`, `Vrsta`, `UlazX`, `UlazY`, `UlazZ`, `UlazA`, \
                        `IzlazX`, `IzlazY`, `IzlazZ`, `IzlazA`, `DostupanRent`, `RentCena`, `Droga`, `Mats`, `Zakljucano`, `Cena`, `Adresa`, `VW`, `Interior`, `kLevel`) VALUES"
);
                       
                        format(string, sizeof(string), "%s ('%d', '0', 'Niko', 'Mala Kuca', '%f', '%f', '%f', '%f', '2333.1892089844', '-1076.9910888672', '1049.0234375', '0.0000', '0', '-1', '0', '0', '0', '25000', 'Commerce %d', '%d', '6', '4')", string, id, ulazx, ulazy, ulazz, ulaza, id, vw);
                        mysql_function_query(konekt, string, true, "OnQueryFinish", "i", THREAD_OSTALO);
                       
                        HInfo[id][kID] = id; HInfo[id][ImaVlasnika] = 0; HInfo[id][Vlasnik] = 0;
                        HInfo[id][UlazX] = ulazx; HInfo[id][UlazY] = ulazy; HInfo[id][UlazZ] = ulazz; HInfo[id][UlazA] = ulaza;
                        HInfo[id][IzlazX] = 2333.1892089844; HInfo[id][IzlazY] = -1076.9910888672; HInfo[id][IzlazZ] = 1049.0234375; HInfo[id][IzlazA] = 0.0000;
                        HInfo[id][DostupanRent] = 0; HInfo[id][RentCena] = -1; HInfo[id][Droga] = 0; HInfo[id][Mats] = 0; HInfo[id][Zakljucano] = 0;
                        HInfo[id][Cena] = 25000; HInfo[id][VW] = vw; HInfo[id][Interior] = 6; HInfo[id][Level] = 4;
                       
                       
                        strmid(HInfo[id][Vrsta], "Mala Kuca", 0, strlen("Mala Kuca"),255);
                        format(HInfo[id][Adresa],32,"Commerce %d",id);
                       
                        SCMF(playerid, WHITE, "Kuca ID %d je uspesno kreirana.", id);
                       
                        SpawnedHouses++;
                       
                        format(str, sizeof(str), "Kuca na prodaju\nVrsta: %s\nCena: $%d\nLevel: %d\nAdresa: %s", HInfo[hID][Vrsta], HInfo[hID][Cena], HInfo[hID][Level], HInfo[hID][Adresa]);
                        KucaLabel[hID] = Create3DTextLabel(str ,0x00FF00AA, HInfo[hID][UlazX], HInfo[hID][UlazY], HInfo[hID][UlazZ], 10, 0, 1);
And image:

Reply
#2

You can try this.

pawn Код:
new string[2500];
                        new id = SpawnedHouses+1;
                        new vw = random(2000);
                        new Float:ulazx, Float:ulazy, Float:ulazz, Float:ulaza;
                        GetPlayerPos(playerid, ulazx, ulazy, ulazz);
                        GetPlayerFacingAngle(playerid, ulaza);
                       
                        format(string, sizeof(string), "INSERT INTO `kuce` (`ID`, `ImaVlasnika`, `Vlasnik`, `Vrsta`, `UlazX`, `UlazY`, `UlazZ`, `UlazA`, \
                        `IzlazX`, `IzlazY`, `IzlazZ`, `IzlazA`, `DostupanRent`, `RentCena`, `Droga`, `Mats`, `Zakljucano`, `Cena`, `Adresa`, `VW`, `Interior`, `Level`) VALUES"
);
                       
                        format(string, sizeof(string), "%s ('%d', '0', 'Niko', 'Mala Kuca', '%f', '%f', '%f', '%f', '2333.1892089844', '-1076.9910888672', '1049.0234375', '0.0000', '0', '-1', '0', '0', '0', '25000', 'Commerce %d', '%d', '6', '4')", string, id, ulazx, ulazy, ulazz, ulaza, id, vw);
                        mysql_function_query(konekt, string, true, "OnQueryFinish", "i", THREAD_OSTALO);
                       
                        HInfo[id][kID] = id; HInfo[id][ImaVlasnika] = 0; HInfo[id][Vlasnik] = 0;
                        HInfo[id][UlazX] = ulazx; HInfo[id][UlazY] = ulazy; HInfo[id][UlazZ] = ulazz; HInfo[id][UlazA] = ulaza;
                        HInfo[id][IzlazX] = 2333.1892089844; HInfo[id][IzlazY] = -1076.9910888672; HInfo[id][IzlazZ] = 1049.0234375; HInfo[id][IzlazA] = 0.0000;
                        HInfo[id][DostupanRent] = 0; HInfo[id][RentCena] = -1; HInfo[id][Droga] = 0; HInfo[id][Mats] = 0; HInfo[id][Zakljucano] = 0;
                        HInfo[id][Cena] = 25000; HInfo[id][VW] = vw; HInfo[id][Interior] = 6; HInfo[id][Level] = 4;
                       
                       
                        strmid(HInfo[id][Vrsta], "Mala Kuca", 0, strlen("Mala Kuca"),255);
                        format(HInfo[id][Adresa],32,"Commerce %d",id);
                       
                        SCMF(playerid, WHITE, "Kuca ID %d je uspesno kreirana.", id);
                       
                        SpawnedHouses++;
                       
                        format(str, sizeof(str), "Kuca na prodaju\nVrsta: %s\nCena: $%d\nLevel: %d\nAdresa: %s", HInfo[hID][Vrsta], HInfo[hID][Cena], HInfo[hID][Level], HInfo[hID][Adresa]);
                        KucaLabel[hID] = Create3DTextLabel(str ,0x00FF00AA, HInfo[hID][UlazX], HInfo[hID][UlazY], HInfo[hID][UlazZ], 10, 0, 1);
Reply
#3

Nope, again it shows Level: 109

But when i restart server and load mysql base it displays correctly, only when i create a house it sets level to 109.
Reply
#4

Can we see the house creating command?
Reply
#5

Well this is the creating command, i mean you just select what type of house u want in dialog, but this is pretty much it:

pawn Код:
case DIALOG_KKUCU:
        {
            if(!response) return 1;
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        new string[2500];
                        new id = SpawnedHouses+1;
                        new vw = random(2000);
                        new Float:ulazx, Float:ulazy, Float:ulazz, Float:ulaza;
                        GetPlayerPos(playerid, ulazx, ulazy, ulazz);
                        GetPlayerFacingAngle(playerid, ulaza);

                        format(string, sizeof(string), "INSERT INTO `kuce` (`ID`, `ImaVlasnika`, `Vlasnik`, `Vrsta`, `UlazX`, `UlazY`, `UlazZ`, `UlazA`, \
                        `IzlazX`, `IzlazY`, `IzlazZ`, `IzlazA`, `DostupanRent`, `RentCena`, `Droga`, `Mats`, `Zakljucano`, `Cena`, `Adresa`, `VW`, `Interior`, `Level`) VALUES"
);

                        format(string, sizeof(string), "%s ('%d', '0', 'Niko', 'Mala Kuca', '%f', '%f', '%f', '%f', '2333.1892089844', '-1076.9910888672', '1049.0234375', '0.0000', '0', '-1', '0', '0', '0', '25000', 'Commerce %d', '%d', '6', '4')", string, id, ulazx, ulazy, ulazz, ulaza, id, vw);
                        mysql_function_query(konekt, string, true, "OnQueryFinish", "i", THREAD_OSTALO);

                        HInfo[id][kID] = id; HInfo[id][ImaVlasnika] = 0; HInfo[id][Vlasnik] = 0;
                        HInfo[id][UlazX] = ulazx; HInfo[id][UlazY] = ulazy; HInfo[id][UlazZ] = ulazz; HInfo[id][UlazA] = ulaza;
                        HInfo[id][IzlazX] = 2333.1892089844; HInfo[id][IzlazY] = -1076.9910888672; HInfo[id][IzlazZ] = 1049.0234375; HInfo[id][IzlazA] = 0.0000;
                        HInfo[id][DostupanRent] = 0; HInfo[id][RentCena] = -1; HInfo[id][Droga] = 0; HInfo[id][Mats] = 0; HInfo[id][Zakljucano] = 0;
                        HInfo[id][Cena] = 25000; HInfo[id][VW] = vw; HInfo[id][Interior] = 6; HInfo[id][Level] = 4;


                        strmid(HInfo[id][Vrsta], "Mala Kuca", 0, strlen("Mala Kuca"),255);
                        format(HInfo[id][Adresa],32,"Commerce %d",id);

                        SCMF(playerid, WHITE, "Kuca ID %d je uspesno kreirana.", id);

                        SpawnedHouses++;
                        PostaviKucneLabele(id);

                    }
                }
            }
        }
Reply
#6

anyone ?
Reply
#7

anyone ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)