MySQL Top Money
#6

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Try...

Код:
CMD:showtop(playerid)
{
	new Cache:Result, Name[24], Money, fString[128], cString[600];
	
	Result = mysql_query(dbhandle, "SELECT column_money FROM user_table ORDER BY column_money DESC LIMIT 10");
	if(cache_num_rows())
	{
		for(new i = 0; i < cache_num_rows(); ++ i)
		{
			cache_get_field_content(i, "Column Name", Name);
			Money = cache_get_field_content_int(i, "Column Money");
			
			format(fString, sizeof fString, "Name: %s | Money: $%d,00\n", Name, Money);
			strcat(cString, fString);
		}
	}
	cache_delete(Result);
	
	ShowPlayerDialog(playerid, 555, DIALOG_STYLE_MSGBOX, "MONEY RANK", cString, "OK","");
	
	return true;
}
Код:
warning 219: local variable "Name" shadows a variable at a preceding level
error 035: argument type mismatch (argument 3)
warning 204: symbol is assigned a value that is never used: "Name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.


CMD:showtop(playerid)
{
	new Cache:Result, Name[24], Money, fString[128], cString[600];

	Result = mysql_query(g_SQL, "SELECT Para FROM oyuncudata ORDER BY Para DESC LIMIT 10");
	if(cache_num_rows())
	{
		for(new i = 0; i < cache_num_rows(); ++ i)
		{
			cache_get_field_content(i, "Isim", Name); // Error
			Money = cache_get_field_content_int(i, "Para");

			format(fString, sizeof fString, "Kullanıcı: %s | Para: $%s\n", Name, convertNumber(Money));
			strcat(cString, fString);
		}
	}
	cache_delete(Result);
	ShowPlayerDialog(playerid, 95959, DIALOG_STYLE_MSGBOX, "MONEY RANK", cString, "OK","");
	return true;
Reply


Messages In This Thread
[SOLVED] MySQL Top Money - by sampkinq - 22.08.2016, 19:35
Re: MySQL Top Money - by F1N4L - 22.08.2016, 19:43
Re: MySQL Top Money - by sampkinq - 22.08.2016, 19:50
Re: MySQL Top Money - by Isolated - 22.08.2016, 19:57
Re: MySQL Top Money - by F1N4L - 22.08.2016, 20:00
Re: MySQL Top Money - by sampkinq - 22.08.2016, 20:09
Re: MySQL Top Money - by Abagail - 22.08.2016, 20:10
Re: MySQL Top Money - by F1N4L - 22.08.2016, 20:24
Re: MySQL Top Money - by sampkinq - 22.08.2016, 20:24
Re: MySQL Top Money - by Shinja - 22.08.2016, 20:29

Forum Jump:


Users browsing this thread: 1 Guest(s)