Loading business pickups.
#1

Hey guys, when my i load my businesses the pickups don't load, here the function here.

pawn Код:
Create LoadBusiness()
{
    new string[156];
    CreateDynamic3DTextLabel(string ,COLOR_BLUE,1788.5947,-1297.0627,14, 50, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0,-1,-1,-1,50);
    for(new i; i < MAX_BUSINESSES; i++)
    {
        format(string, sizeof(string), "SELECT * FROM businesses WHERE Id = %d", i);
        mysql_query(string);
        mysql_store_result();
        if(!mysql_num_rows())
        {
            mysql_free_result();
        }
        else
        {
            new Query[100];
            if(mysql_fetch_row(Query,"|"))
            {
                sscanf(Query, "p<|>e<iis[30]iiiii>", Business[i]);
            }
            if(Business[i][bLevel] == 1)
            {
                Business[i][bPrice] = 100000;
                Business[i][bPay] = 5000;
            }
                         //some more levels here.
            if(!strmatch(Business[i][bOwner], "None"))
            {
                BusinessPickups[i] = CreateDynamicPickup(1274, 23, Business[i][bX], Business[i][bY], Business[i][bZ], -1 , -1, -1, 200);
                format(string, sizeof(string), "Business is owned by:\n%s",Business[i][bOwner]);
                CreateDynamic3DTextLabel(string ,COLOR_BLUE,Business[i][bX], Business[i][bY], Business[i][bZ]+0.5, 50, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0,-1,-1,-1,50);
            }
            else
            {
                CreateDynamicMapIcon(Business[i][bX], Business[i][bY], Business[i][bZ], 52, 0, -1, -1, -1, 200);
                BusinessPickups[i] = CreateDynamicPickup(1274, 23, Business[i][bX], Business[i][bY], Business[i][bZ], -1 , -1, -1, 200);
                format(string, sizeof(string), "Business Price: $%d\n/Buybusiness to purchase it!",Business[i][bPrice]);
                CreateDynamic3DTextLabel(string ,COLOR_BLUE,Business[i][bX], Business[i][bY], Business[i][bZ]+0.5, 50, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0,-1,-1,-1,50);
            }
        }
    }
}
I also have a house system which all the pickups load for that.
i can post some other code if you need it.
Cheers, and thanks in advance.
Reply


Messages In This Thread
Loading business pickups. - by Haydz - 02.02.2011, 06:01
Re: Loading business pickups. - by PeteShag - 02.02.2011, 07:46
Re: Loading business pickups. - by Haydz - 02.02.2011, 07:49
Re: Loading business pickups. - by PeteShag - 02.02.2011, 08:00
Re: Loading business pickups. - by Haydz - 02.02.2011, 08:07

Forum Jump:


Users browsing this thread: 2 Guest(s)