20.03.2013, 10:04
Hey guys, well I've been scripting for a year or two now but I stopped for a while and have decided to go back to it now.. Problem is with these new 'threaded queries' as 'unthreaded queries' are not supported any longer.
I'm gradually understanding how threaded queries work but there is still is a few dark spots that i'm trying to understand, so possibly someone here could answer this for me.
When a player registers on my server it checks to see if they are banned... now this all worked previously but with these new threaded queries it's a little more complex it would seem.. Before i'd just simply do a query to the server as they connect to check if they were banned. Like such below:
How ever, now it needs something in the scope such as a public call and forward... or is that necessary? Trying to understand the way the new threaded queries work is a bit hard for me to grasp. For example... This part
In the that code above I have marked a few parts that I am just... finding hard to understand, someone with knowledge on threaded queries could really help! Thanks
~Liam
I'm gradually understanding how threaded queries work but there is still is a few dark spots that i'm trying to understand, so possibly someone here could answer this for me.
When a player registers on my server it checks to see if they are banned... now this all worked previously but with these new threaded queries it's a little more complex it would seem.. Before i'd just simply do a query to the server as they connect to check if they were banned. Like such below:
pawn Code:
public OnPlayerConnect(playerid)
{
TogglePlayerClock(playerid, 1);
new query[200], Message[256];
new ip[16];
GetPlayerIp(playerid, ip, sizeof(ip));
format(query, sizeof(query), "SELECT * FROM `Banned` WHERE IP = '%s'", ip);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() >= 1)
{
SCM(playerid, COLOR_RED, "You are banned from this server.");
Kick(playerid);
}
mysql_free_result();
How ever, now it needs something in the scope such as a public call and forward... or is that necessary? Trying to understand the way the new threaded queries work is a bit hard for me to grasp. For example... This part
pawn Code:
mysql_function_query(dbHandle, query, true (This is the equivalent to mysql_store_result, right?) , "What Would Go Here?", "i - Would I need a player ID here to check if they are banned?", playerid);
In the that code above I have marked a few parts that I am just... finding hard to understand, someone with knowledge on threaded queries could really help! Thanks
~Liam