SA-MP Forums Archive
Houses not loading owner name. [REP+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Houses not loading owner name. [REP+] (/showthread.php?tid=320413)



Houses not loading owner name. [REP+] - ricardo178 - 22.02.2012

Hello. Made my own house system, but i am having problems with loading. they all load, but all loas as if they were for sale. Any load with owner...


The owner is set as "Owner:RIcardo_Rodrigues" in the file..
Loading code:
pawn Код:
LoadHousesInfo();
    LoadHouses();
    for(new h = 1; h < sizeof(HouseInfo); h++)
    {
        format(file, sizeof(file), "RRP/houses/%d.ini", h);
        if(fexist(file))
        {
            if(HouseInfo[h][Owner] == 0)
            {
                new string[128];
                housepickup[h] = CreatePickup(1273, 1, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 0);
                format(string, sizeof(string), "This house is for sale. Use /buyhouse to buy it. Price: %d", HouseInfo[h][Price]);
                housetext[h] = Create3DTextLabel(string, COLOR_RED, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 10.0, 0);
            }
            else if(HouseInfo[h][Owner] != 0)
            {
                new string[128];
                housepickup[h] = CreatePickup(1272, 1, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 0);
                format(string, sizeof(string), "This house is owned by %s.", HouseInfo[h][Owner]);
                housetext[h] = Create3DTextLabel(string, COLOR_RED, HouseInfo[h][X], HouseInfo[h][Y], HouseInfo[h][Z], 10.0, 0);
            }
        }
    }
    return 1;



Re: Houses not loading owner name. [REP+] - coole210 - 22.02.2012

You are using Owner as a variable, not a string..

pawn Код:
if(HouseInfo[h][Owner] == 0)
pawn Код:
else if(HouseInfo[h][Owner] != 0)