Litte help in dialog
#6

I do this in my script to have directly the name.

Quote:

public MySQLGetName(result[], sqlid)
{
new query[128];
format(query, sizeof(query), "SELECT `Name` FROM `players_stats` WHERE ID=%d", sqlid);
mysql_query(query);
mysql_store_result();

if(mysql_num_rows()==0)
{return format(result, 32, "None");}
else
{
new strid[32];
if(mysql_fetch_row(strid)==1)
{
return format(result, 32, "%s", strid);
}
}
return 1;
}

My method could work for everything but take more ressources than yours. Just for your case, you script seems me much better than mine.

Your script there can't work for disconnect player unless you load all the sql database when GameMode Start
Reply


Messages In This Thread
Litte help in dialog - by N3cromancer - 28.02.2015, 20:58
Re : Litte help in dialog - by Etolas - 28.02.2015, 21:06
Re: Re : Litte help in dialog - by N3cromancer - 28.02.2015, 21:12
Re : Re: Re : Litte help in dialog - by Etolas - 28.02.2015, 21:13
Re: Litte help in dialog - by N3cromancer - 28.02.2015, 21:18
Re: Litte help in dialog - by Etolas - 28.02.2015, 21:26
Re: Litte help in dialog - by N3cromancer - 28.02.2015, 21:43
Re: Litte help in dialog - by Etolas - 28.02.2015, 22:02

Forum Jump:


Users browsing this thread: 1 Guest(s)