[HELP] Pickups at house entry
#1

So, it displays the pickup at the entry for house number '0', there are in total 40 houses. Can anyone shed some light on as to why this is? Thanks!

Код:
	for (new idx=0; idx<totalhouses; idx++)
{
if(HouseInfo[idx][hOwned] == 0)
			{
				AddStaticPickup(1273, 2, HouseInfo[idx][hEntrancex], HouseInfo[idx][hEntrancey], HouseInfo[idx][hEntrancez]);
				pickups++;
			}
			if(HouseInfo[idx][hOwned] == 1)
			{
				AddStaticPickup(1239, 2, HouseInfo[idx][hEntrancex], HouseInfo[idx][hEntrancey], HouseInfo[idx][hEntrancez]);
				pickups++;
			}
}
Reply
#2

Quote:
Originally Posted by leestrong7
So, it displays the pickup at the entry for house number '0', there are in total 40 houses. Can anyone shed some light on as to why this is? Thanks!

Код:
	for (new idx=0; idx<totalhouses; idx++)
{
if(HouseInfo[idx][hOwned] == 0)
			{
				AddStaticPickup(1273, 2, HouseInfo[idx][hEntrancex], HouseInfo[idx][hEntrancey], HouseInfo[idx][hEntrancez]);
				pickups++;
			}
			if(HouseInfo[idx][hOwned] == 1)
			{
				AddStaticPickup(1239, 2, HouseInfo[idx][hEntrancex], HouseInfo[idx][hEntrancey], HouseInfo[idx][hEntrancez]);
				pickups++;
			}
}
I dont understand you...
Reply
#3

Database has the coordinates for the entrance for 40 houses, I'm trying to use the information pulled from the database to create a pickup for each of the houses in that particular table.
Reply
#4

And whats your problem?
Reply
#5

As said in the first post, there is only one pickup appearing - This is for the very first entrance, the other 39 are not appearing - The pickup count does increase, however.
Reply
#6

Please show the value assigment of 'totalhouses' variable.
Reply
#7

Код:
public LoadSQLProperty()
{
	new arrCoords[32][32];
	new sql[80], row[512];
	format(sql, sizeof(sql), "SELECT COUNT(*) FROM property");
	samp_mysql_query(sql);
	//if (DEBUG) SQLLog(sql);
	samp_mysql_store_result();
	samp_mysql_fetch_row(row);
	totalhouses = strval(row);
	samp_mysql_free_result();
Reply
#8

I've also tried

Код:
#define MAX_HOUSE 50
new HouseInfo[MAX_HOUSE][hInfo];


for(new h = 0; h < sizeof(HouseInfo); h++)
    {
        if(HouseInfo[h][hOwned] == 0)
        {
            AddStaticPickup(1273, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            pickups++;
        }
        if(HouseInfo[h][hOwned] == 1)
        {
            AddStaticPickup(1239, 2, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]);
            pickups++;
        }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)