GetLeaderFaction
#3

Sadly to return the string, you cant thread the query. So;
Код:
GetFactionLeader(id)
{
	mysql_format(g_SQL, Query, sizeof (Query), "SELECT `Nick` FROM `Factions` WHERE `id` = '%i'", id);

	new 
		name[MAX_PLAYER_NAME + 1],
		Cache:result = mysql_query(g_SQL, Query)
	;

    if (cache_num_rows()) {
	   	cache_get_field_content(0, "Nick", name);
	}
	else 
	{
		format(name, sizeof (name), "None");
	}

	cache_delete(result);
	return name;
}
Reply


Messages In This Thread
GetLeaderFaction - by norton2 - 28.08.2015, 14:53
Re: GetLeaderFaction - by Logofero - 28.08.2015, 15:09
Re: GetLeaderFaction - by Evocator - 28.08.2015, 15:17
Re: GetLeaderFaction - by norton2 - 28.08.2015, 15:26
Re: GetLeaderFaction - by Logofero - 28.08.2015, 15:27

Forum Jump:


Users browsing this thread: 1 Guest(s)