18.12.2015, 16:27
So hello,
I am here to ask a simple question as I can NOT think of any best way of doing that function maybe someone has done it already and is eager to share it with us.
So basically, I want to make a function which requires "SELECT" query. The name of that function is "GetItemName(objectid)" and it's supposed to return the name of the object which player is currently looking at.
So, let's say, if I want to make that function and make it also multi_threaded query, then how do I do that without making TWO PUBLIC callbacks? I was trying to add parameter "phase" in that function but it doesn't do the trick.
Example:
We want THIS code to return the name of item. But multi_threaded query REQUIRES me to make another callback in first three dots "..." and return that value there. Which is REALLY pain in the ass.
So, anybody here smart enough to give some nice, clean solution to it? Will be grateful.
Thanks.
I am here to ask a simple question as I can NOT think of any best way of doing that function maybe someone has done it already and is eager to share it with us.
So basically, I want to make a function which requires "SELECT" query. The name of that function is "GetItemName(objectid)" and it's supposed to return the name of the object which player is currently looking at.
So, let's say, if I want to make that function and make it also multi_threaded query, then how do I do that without making TWO PUBLIC callbacks? I was trying to add parameter "phase" in that function but it doesn't do the trick.
Example:
pawn Код:
PublicEx GetItemName(objectid)
{
static query[64];
format(query, sizeof(query), "SELECT `name` FROM `items_data` WHERE `objectid` = %d", objectid);
mysql_function_query(SerwerData[E_SERWER_MYSQL], query, true, "...", "...", ...);
}
So, anybody here smart enough to give some nice, clean solution to it? Will be grateful.
Thanks.