24.11.2012, 14:52
Hi. Well simply, I have a very basic script, right.
Well and then this
The reason why did I make so many exceptions is that I was testing what can possibly cause the issue. Ignore that.
Well the issue itself is that once I perform the command, I get a value from previous performing. So, let's say that... I perform it first time, it returns an empty string. I do it second time, it returns what it should return the first time. I do it third time, it returns what it should return the second time..
Any ideas?
Код:
link = mysql_connect("localhost","samp","samp","imnotgonnatellyouthis");
if(mysql_ping())
{
printf("MySQL connection is working okay moving on.");
mysql_set_charset("utf8_unicode_ci");
}else{
printf("MYSQL connection is not working. HALT LOL.");
SendRconCommand("stop");
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/checksql", cmdtext, true, 10) == 0)
{
new sql[256], str[128], result[256];
mysql_format(link, sql, "SELECT * FROM `%s` WHERE `id` = '%d'", "users", 1);
if(mysql_query("SELECT * FROM users WHERE id=1",-1,-1,link))
{
if(mysql_store_result())
{
if(mysql_fetch_row_format(result))
{
SendClientMessage(playerid,0xffffffff,result);
}
}
}
return 1;
}
return 0;
}
Well the issue itself is that once I perform the command, I get a value from previous performing. So, let's say that... I perform it first time, it returns an empty string. I do it second time, it returns what it should return the first time. I do it third time, it returns what it should return the second time..
Any ideas?

