Enum Error: error 008: must be a constant expression; assumed zero
#6

Make a variable that holds the number of houses. For starters, make it ~40. When your gamemode starts and mysql loads up the houses, use mysql to retrieve how many rows there are. So you get the number of rows (houses) and then set that number for the variable that holds the number of houses. Lets say an admin uses a command to add a house. When the admin uses the command, just do ++ to the variable that holds the number of houses. And that's it.

Whole idea:
Код:
new MAX_HOUSES=40,Skin[MAX_HOUSES][House];

enum House
{
	HouseID,
	OwnerID
}


public OnGameModeInit()
{
	// mysql loading
	MAX_HOUSES=mysql_rows;
}

CMD:addhouse(playerid, params[])
{
	// add house...
	MAX_HOUSES++;
	return 1;
}
I'm not sure if this would be the best idea, but that would be how I would do it.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)