Dynamic Object Creating
#6

Wow, this works now:

pawn Код:
public HousesLoad()
{
    new temp[400], string[200], rows, fields;
    cache_get_data(rows, fields, g_Handle);

    new id = 0;
    if(rows)
    {
        while(id <= rows-1)
        {
            cache_get_row(id, 0, temp, g_Handle), HouseInfo[id][hHouseID] = strval(temp);
            cache_get_row(id, 1, HouseInfo[id][hAddress], g_Handle, 32);
            cache_get_row(id, 2, HouseInfo[id][hOwner], g_Handle, 35);
            cache_get_row(id, 3, temp, g_Handle), HouseInfo[id][hPrice] = strval(temp);
            cache_get_row(id, 4, temp, g_Handle), HouseInfo[id][hEnterPos][0] = floatstr(temp);
            cache_get_row(id, 5, temp, g_Handle), HouseInfo[id][hEnterPos][1] = floatstr(temp);
            cache_get_row(id, 6, temp, g_Handle), HouseInfo[id][hEnterPos][2] = floatstr(temp);
            cache_get_row(id, 7, temp, g_Handle), HouseInfo[id][hEnterPos][3] = floatstr(temp);
            cache_get_row(id, 8, temp, g_Handle), HouseInfo[id][hExitPos][0] = floatstr(temp);
            cache_get_row(id, 9, temp, g_Handle), HouseInfo[id][hExitPos][1] = floatstr(temp);
            cache_get_row(id, 10, temp, g_Handle), HouseInfo[id][hExitPos][2] = floatstr(temp);
            cache_get_row(id, 11, temp, g_Handle), HouseInfo[id][hExitPos][3] = floatstr(temp);
            cache_get_row(id, 12, temp, g_Handle), HouseInfo[id][hInterior] = strval(temp);
            cache_get_row(id, 13, temp, g_Handle), HouseInfo[id][hVirtualWorld] = strval(temp);
            cache_get_row(id, 14, temp, g_Handle), HouseInfo[id][hType] = strval(temp);
            cache_get_row(id, 15, temp, g_Handle), HouseInfo[id][hLock] = strval(temp);
            cache_get_row(id, 16, temp, g_Handle), HouseInfo[id][hSafe] = strval(temp);
           
            if(!strcmp("None", HouseInfo[id][hOwner], false))
            {
                HouseInfo[id][hPickup] = CreateDynamicPickup(1273, 23, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], -1, -1, -1, 100.0);
                format(string, sizeof(string), "Type"White": %s\n"Aqua"Address"White": %s\n"Aqua"Owner"White": None\n"Aqua"Price"White": $%d\n"Aqua"Status"White": Unlocked", HouseType(id), HouseInfo[id][hAddress], HouseInfo[id][hPrice]);
                HouseInfo[id][hText] = CreateDynamic3DTextLabel(string, COLOR_AQUA, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100);
            }
            else
            {
                HouseInfo[id][hPickup] = CreateDynamicPickup(1273, 23, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], -1, -1, -1, 100.0);
                format(string, sizeof(string), "Type"White": %s\n"Aqua"Address"White": %s\n"Aqua"Owner"White": %s\n"Aqua"Status"White": %s", HouseType(id), HouseInfo[id][hAddress], HouseInfo[id][hOwner], HouseStatus(id));
                HouseInfo[id][hText] = CreateDynamic3DTextLabel(string, COLOR_AQUA, HouseInfo[id][hEnterPos][0], HouseInfo[id][hEnterPos][1], HouseInfo[id][hEnterPos][2], 25, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 100);
            }
            if(HouseInfo[id][hSafe] > 0)
            {
                HouseInfo[id][hSafe] = CreateDynamicObject(2332, 273.93460, 304.21188, 998.54669, 356.85840, 0.00000, 270.00000, HouseInfo[id][hVirtualWorld], HouseInfo[id][hInterior], -1, 300.0);
                SaveHouse(id);
            }
            id ++;
        }
        houseid = rows;
    }
    else
    {
        for(new i = 0; i < MAX_HOUSES; i++)
        {
            HouseInfo[i][hHouseID] = -1;
        }
    }
    return 1;
}
Don't understand what the difference is but there we go ha. Thanks
Reply


Messages In This Thread
Dynamic Object Creating - by AphexCCFC - 29.04.2014, 00:20
Re: Dynamic Object Creating - by SkittlesAreFalling - 29.04.2014, 00:26
Re: Dynamic Object Creating - by AphexCCFC - 29.04.2014, 00:39
Re: Dynamic Object Creating - by AphexCCFC - 29.04.2014, 00:42
Re: Dynamic Object Creating - by SkittlesAreFalling - 29.04.2014, 00:45
Re: Dynamic Object Creating - by AphexCCFC - 29.04.2014, 00:51
Re: Dynamic Object Creating - by SkittlesAreFalling - 29.04.2014, 00:52

Forum Jump:


Users browsing this thread: 1 Guest(s)