SA-MP Forums Archive
[HELP] Pickups at house entry - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Pickups at house entry (/showthread.php?tid=108158)



[HELP] Pickups at house entry - leestrong7 - 12.11.2009

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++;
			}
}



Re: [HELP] Pickups at house entry - WackoX - 12.11.2009

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...


Re: [HELP] Pickups at house entry - leestrong7 - 12.11.2009

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.


Re: [HELP] Pickups at house entry - Gergo1352 - 12.11.2009

And whats your problem?


Re: [HELP] Pickups at house entry - leestrong7 - 12.11.2009

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.


Re: [HELP] Pickups at house entry - Gergo1352 - 12.11.2009

Please show the value assigment of 'totalhouses' variable.


Re: [HELP] Pickups at house entry - leestrong7 - 12.11.2009

Код:
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();



Re: [HELP] Pickups at house entry - leestrong7 - 12.11.2009

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++;
        }
    }