• Off-Topic
  • Forum thread subjection "high scores"

Could we start a new topic for high scores for things like highest amount of money, most amount of drugs sold in a single run

  • This could start giving more players a chance to get more drugs on them for a higher drug run

  • Get more players active on the forums to post their high scores

  • Give the server a sense of competitiveness than just killing people and having the highest rdm reputation

and you must have a screenshot of you having that much drugs or money for it to count for the sense of fairness.

cool idea but would there be like one day to do it or would it be anytime as long as you have a screen shot then at the end of the month or something who ever has the highest?

Sheckles 200k crime on purge leaving city45

lol

do it michaelback. do it for the community egostroking.

public Action:Hiscores(Client)
{
	new Handle:hTop = CreateMenu(HiscoresHandle);
	SetMenuTitle(hTop, "Hiscores:");
	AddMenuItem(hTop, "1", "[Wealthiest Players]");
	AddMenuItem(hTop, "2", "[Most Wanted]");
	AddMenuItem(hTop, "3", "[Overall Top 10]");
	AddMenuItem(hTop, "-1", "[Back to Bank]");
	SetMenuPagination(hTop, 7);
	DisplayMenu(hTop, Client, 30);
}

public HiscoresHandle(Handle:hTop, MenuAction:action, Client, param2)
{
	decl String:sData[32];
	GetMenuItem(hTop, param2, sData, sizeof(sData));
	new iData = StringToInt(sData);
	
if(action == MenuAction_Select)
{
	switch(iData)
	{
		case 1: //Wealthiest
		{
			decl String:sQuery[128];
			Format(sQuery, sizeof(sQuery), "SELECT steam_id, bank, cash FROM `sapphire_players` ORDER BY bank + cash DESC LIMIT 25;");
			new iUser = GetClientUserId(Client);
			SQL_TQuery(g_hDB, SQL_RichestPlayers, sQuery, iUser);
		}
		
		case 2: //Most Wanted
		{
			decl String:sQuery[128];
			Format(sQuery, sizeof(sQuery), "SELECT steam_id, crime FROM `sapphire_players` ORDER BY crime DESC LIMIT 25;");
			new iUser = GetClientUserId(Client);
			SQL_TQuery(g_hDB, SQL_MostWanted, sQuery, iUser);
		}
		
		case 3: //Overall
		{
			decl String:sQuery[128];
			Format(sQuery, sizeof(sQuery), "SELECT steam_id, bank, cash, crime, income FROM `sapphire_players` ORDER BY bank + cash + crime + income DESC LIMIT 10;");
			new iUser = GetClientUserId(Client);
			SQL_TQuery(g_hDB, SQL_Overall, sQuery, iUser);
		}
	}
}
else if(action == MenuAction_End)
{
	CloseHandle(hTop);
}

return;
}	

public Action:Bank(Client)
{
	new iPromotion = RoundToCeil(Pow(float(g_iIncome[Client]), 3.0)) - g_iMinutes[Client];
	
new Handle:hBank = CreateMenu(BankHandle);
SetMenuTitle(hBank, "Cash: $%i\nBank Account: $%i\nIncome: $%i\nNext Promotion: %i minutes", g_iCash[Client], g_iBank[Client], g_iIncome[Client], iPromotion);

AddMenuItem(hBank, "1", "[Withdraw]");
AddMenuItem(hBank, "2", "[Deposit]");
AddMenuItem(hBank, "3", "[Hiscores]");
SetMenuPagination(hBank, 7);
DisplayMenu(hBank, Client, 20);
}

public BankHandle(Handle:hBank, MenuAction:action, Client, param2)
{
	if(action == MenuAction_Select)
	{
		new String:sData[64];
		GetMenuItem(hBank, param2, sData, sizeof(sData));
		new iData = StringToInt(sData);	
		switch(iData)
		{
			case 1:
			{
				WithdrawHandle(Client);
			}
			
		case 2:
		{
			DepositHandle(Client);
		}
		
		case 3:
		{
			Hiscores(Client);
		}
	}
}
else if(action == MenuAction_End)
{
	CloseHandle(hBank);
}
return;
}

public SQL_RichestPlayers(Handle:hOwner, Handle:hHndl, const String:sError[], any:data)
{
	new Client = GetClientOfUserId(data);
	if(Client == 0)
	{
		return;
	}
	
if (hHndl == INVALID_HANDLE)
{
	LogError("[Project Sapphire] SQL_RichestPlayers: Query failed! %s", sError);
}
else 
{
	decl String:FormatMessage[1024], iCash[25], iBank[25], String:sSteamID[25][32];	
	new len = 0; 
	new i = 0;
	len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "   Richest Players:\n\n");

	while(SQL_FetchRow(hHndl))
	{
		SQL_FetchString(hHndl, 0, sSteamID[i], sizeof(sSteamID[]));
		iCash[i] = SQL_FetchInt(hHndl, 1);
		iBank[i] = SQL_FetchInt(hHndl, 2);
		len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "%i   %s  (%i)\n", i+1, sSteamID[i], iBank[i] + iCash[i]);
		i++;
	}
	
	PrintEscapeText(Client, FormatMessage);
}
}

public SQL_MostWanted(Handle:hOwner, Handle:hHndl, const String:sError[], any:data)
{
	new Client = GetClientOfUserId(data);
	if(Client == 0)
	{
		return;
	}

if (hHndl == INVALID_HANDLE)
{
	LogError("[Project Sapphire] SQL_MostWanted: Query failed! %s", sError);
}
else 
{
	decl String:FormatMessage[2048], iCrime[25], String:sSteamID[25][32];
	new len = 0; 
	new i = 1;
	len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "   Most Wanted Players:\n\n");
	
	while(SQL_FetchRow(hHndl))
	{
		SQL_FetchString(hHndl, 0, sSteamID[i], sizeof(sSteamID[]));
		iCrime[i] = SQL_FetchInt(hHndl, 1);
		if(iCrime[i] > 0)
		{
			len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "%i   %s  (%i)\n", i, sSteamID[i], iCrime[i]);
		}
		
		i++;
	}
	PrintEscapeText(Client, FormatMessage);
}
}

public SQL_Overall(Handle:hOwner, Handle:hHndl, const String:sError[], any:data)
{
	new Client = GetClientOfUserId(data);
	if(Client == 0)
	{
		return;
	}

if (hHndl == INVALID_HANDLE)
{
	LogError("[Project Sapphire] SQL_Overall: Query failed! %s", sError);
}
else 
{
	decl String:FormatMessage[2048], String:sSteamID[25][32], iBank[25], iCash[25], iCrime[25], iIncome[25];
	new len = 0; 
	new i = 1;
	len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "   Overall Top Players:\n\n");
	
	while(SQL_FetchRow(hHndl))
	{
		SQL_FetchString(hHndl, 0, sSteamID[i], sizeof(sSteamID[]));
		iBank[i] = SQL_FetchInt(hHndl, 1);
		iCash[i] = SQL_FetchInt(hHndl, 2);
		iCrime[i] = SQL_FetchInt(hHndl, 3);
		iIncome[i] = SQL_FetchInt(hHndl, 4);
		
		new iTotal = iBank[i] + iCash[i] + iCrime[i] + iIncome[i];
		if(iCrime[i] > 0)
		{
			len += Format(FormatMessage[len], sizeof(FormatMessage)-len, "%i   %s  (%i)\n", i, sSteamID[i], iTotal);
		}
		
		i++;
	}
	PrintEscapeText(Client, FormatMessage);
}
}