ID To Pickup.
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
You can't allocate IDs, just store them. When you create a pickup for a house, remember the ID it returns and compare that instead.
I allready did it, I think I did it lol.

Код:
stock LoadHouses()
{
	new
		Str[255],
		hID,
		Float:intX,
		Float:intY,
		Float:intZ,
		Float:exitX,
		Float:exitY,
		Float:exitZ,
		hOwner[24],
		hWorld,
		hPrice,
		hIntID,
		hLocked;

	mysql_query("SELECT * FROM `houses`");
	mysql_store_result();
	new haI = 1;
    if(mysql_num_rows() > 0)
    {
        while(mysql_fetch_row(Str))
        {
		    sscanf(Str, "p<|>iffffffs[24]iiii", hID, intX, intY, intZ, exitX, exitY, exitZ, hOwner, hWorld, hPrice, hIntID, hLocked);
		    HousePickup[hID] = CreatePickup(1273, 1, exitX, exitY, exitZ);
		    iHos[haI][haID] = haI;
			iHos[haI][haIntX] = intX;
			iHos[haI][haIntY] = intY;
			iHos[haI][haIntZ] = intZ;
 		    iHos[haI][haExitX] = exitX;
			iHos[haI][haExitY] = exitY;
			iHos[haI][haExitZ] = exitZ;
			iHos[haI][haIntID] = hIntID;
			iHos[haI][haPrice] = hPrice;
			iHos[haI][haLocked] = hLocked;
			iHos[haI][haWorld] = hWorld;
			format(iHos[haI][haOwner], 24, "%s", hOwner);
			haI++;
			hTotal++;
		}
	}
	mysql_free_result();
	printf("** %i\t<->\tHouses Loaded from\t<->\tMySQL\t\t   **", hTotal);
	new FormatBuffer[255];
	format(FormatBuffer,sizeof(FormatBuffer),"ID: %i", HousePickup[hID]);
	print(FormatBuffer);

	
	return 1;
}
and LoadHouses is on gamemodeint
Reply


Messages In This Thread
ID To Pickup. - by TheINCDope - 08.11.2014, 17:19
Re: ID To Pickup. - by Wingman - 08.11.2014, 17:39
Re: ID To Pickup. - by TheINCDope - 08.11.2014, 18:09
Re: ID To Pickup. - by TheINCDope - 08.11.2014, 20:02

Forum Jump:


Users browsing this thread: 1 Guest(s)