"Refreshing" a certain house
#7

I select * from houses which is then passed through to the "HouseCheck" function:
pawn Код:
forward HouseCheck();
public HouseCheck()
{
    new rows = mysql_num_rows();
    if(!rows) return print("Houses failed to load. - No rows returned.");
    for(new i = 0; i < rows; i++)
    {
        new temp[24];
        HouseInfo[i][ID] = cache_get_row_int(i, 0, sqldb);
        cache_get_row(i, 1, temp); HouseInfo[i][Owner] = temp;
        HouseInfo[i][IntX] = cache_get_row_float(i, 2, sqldb);
        HouseInfo[i][IntY] = cache_get_row_float(i, 3, sqldb);
        HouseInfo[i][IntZ] = cache_get_row_float(i, 4, sqldb);
        HouseInfo[i][ExtX] = cache_get_row_float(i, 5, sqldb);
        HouseInfo[i][ExtY] = cache_get_row_float(i, 6, sqldb);
        HouseInfo[i][ExtZ] = cache_get_row_float(i, 7, sqldb);
        HouseInfo[i][Interior] = cache_get_row_int(i, 8, sqldb);
        HouseInfo[i][Locked] = cache_get_row_int(i, 9, sqldb);
        HouseInfo[i][Money] = cache_get_row_int(i, 10, sqldb);
        HouseInfo[i][Price] = cache_get_row_int(i, 11, sqldb);
       
        if(!strcmp("STATE", HouseInfo[i][Owner]))
        {
            format(GlobalString, sizeof(GlobalString), ""COL_RED"[House]\n"COL_WHITE"Price: %i", HouseInfo[i][Price]);
            HouseInfo[i][hLabel] = Create3DTextLabel(GlobalString, 0x008080FF, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], 40.0, 0, 0);
            HouseInfo[i][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], -1);
        }
        else
        {
            format(GlobalString, sizeof(GlobalString), ""COL_RED"[House]\n"COL_WHITE"Owner: %s", HouseInfo[i][Owner]);
            HouseInfo[i][hLabel] = Create3DTextLabel(GlobalString, 0x008080FF, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], 40.0, 0, 0);
            HouseInfo[i][hPickup] = CreateDynamicPickup(1272, 1, HouseInfo[i][ExtX], HouseInfo[i][ExtY], HouseInfo[i][ExtZ], -1);
        }
    }
    return true;
}
Reply


Messages In This Thread
"Refreshing" a certain house - by BleverCastard - 21.06.2014, 21:53
Re: "Refreshing" a certain house - by Cypress - 21.06.2014, 22:12
Re: "Refreshing" a certain house - by BleverCastard - 21.06.2014, 22:14
Re: "Refreshing" a certain house - by Cypress - 21.06.2014, 22:16
Re: "Refreshing" a certain house - by BleverCastard - 21.06.2014, 22:23
Re: "Refreshing" a certain house - by Cypress - 21.06.2014, 22:30
Re: "Refreshing" a certain house - by BleverCastard - 21.06.2014, 22:31
Re: "Refreshing" a certain house - by Cypress - 21.06.2014, 22:33
Re: "Refreshing" a certain house - by BleverCastard - 21.06.2014, 22:34
Re: "Refreshing" a certain house - by iCuttah - 21.06.2014, 22:36

Forum Jump:


Users browsing this thread: 2 Guest(s)