[House] Get New House ID
#1

Hi,

I'm trying to get the ID of a new house and I did this:


Код:
stock GetNewHouseID()
{
	new query[128];
	mysql_format(mysql, query, sizeof(query), "SELECT * FROM `maisons`");
	mysql_tquery(mysql, query, "OnGetHouseID", "");
	return 1;
}

public OnGetHouseID()
{
	new rows, fields; 
    cache_get_data(rows, fields, mysql);
    if(rows)
    {
		new id = cache_get_row_count();
		return id; // Here it gives me the good ID.
    }
	return ID_MAISON_INVALIDE;
}

In my createhouse CMD, the World of the house = the new ID.


So I got something like this:

mInfo[m][mWorld] = GetNewHouseID();

But it always give me 1 as ID.

I think that is cause I did "return 1".
But how could I return the value from my public ?
I mean "return id;" but from my public.


Thank you !
Reply


Messages In This Thread
[House] Get New House ID - by anou1 - 08.03.2014, 20:53
Re: [House] Get New House ID - by PowerPC603 - 08.03.2014, 21:05
Re: [House] Get New House ID - by Mriss - 08.03.2014, 21:06
Re: [House] Get New House ID - by anou1 - 08.03.2014, 21:25
Re : [House] Get New House ID - by anou1 - 09.03.2014, 12:45
Respuesta: [House] Get New House ID - by CuervO - 09.03.2014, 15:12
Re : [House] Get New House ID - by anou1 - 09.03.2014, 16:01

Forum Jump:


Users browsing this thread: 2 Guest(s)