29.12.2010, 13:53
kk thank you
it runs now
but i include the split function directly into the stock
GetRegionName(Float,Float:y,dest[][])
{
new query[256],result[128];
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);
split(result, dest, '|');
}
return 1;
}
USAGE:
new array[2][32];
GetRegionName(x,y,array);
array[0]: regionMain
array[1]: regionSub
it runs now
but i include the split function directly into the stock
GetRegionName(Float,Float:y,dest[][])
{
new query[256],result[128];
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);
split(result, dest, '|');
}
return 1;
}
USAGE:
new array[2][32];
GetRegionName(x,y,array);
array[0]: regionMain
array[1]: regionSub