returning an array
#1

hey all

i need your help
ok i want to return an array by an stock but i dont know how to do.

at the moment i use the split function out of my stock
Код:
	new regionArray[2][64],region[64];
	region=GetRegionName(0,5);
	split(region, regionArray, '|');
	regionArray[0]
	regionArray[1]
my stock:
Код:
stock GetRegionName(Float:x,Float:y)
{
	new query[128],result[32];
	format(query,sizeof(query),"SELECT regionMain,regionSub FROM samp_regions WHERE regionOLX<='%f' AND regionURX>='%f' AND regionURY<='%f' AND regionOLY>='%f' LIMIT 1;",x,x,y,y);
	mysql_query(query, -1, -1, MySQLConnection);
	mysql_store_result(MySQLConnection);
	if(mysql_num_rows(MySQLConnection) > 0)
	{
	    mysql_fetch_row(result,"|",MySQLConnection);
	}
	return result;
}
how can i make that i just have
Код:
	regionArray=GetRegionName(0,5);
	regionArray[0]
	regionArray[1]
or is that impossible?

thanks and greetz from germany
Reply


Messages In This Thread
returning an array - by Akmet - 29.12.2010, 12:26
Re: returning an array - by DeathOnaStick - 29.12.2010, 13:10
AW: returning an array - by Akmet - 29.12.2010, 13:53

Forum Jump:


Users browsing this thread: 2 Guest(s)