Hey guys, I want to create a custom scoreboard using a menu. Currently this is what I have.
Code:
public OnClientConnected(client)
{
new Handle:Scoreboard = CreateMenu(MenuHandler1);
SetMenuTitle(Scoreboard, "Scoreboard");
AddMenuItemPlayers(Scoreboard);
DisplayMenu(Scoreboard, client, MENU_TIME_FOREVER);
}
AddMenuItemPlayers(Handle:menu)
{
decl String:cName[MAX_NAME_LENGTH]; decl String:UserId[10];
for(new i = 1; i <= MaxClients; i++)
{
if(IsClientInGame(i))
{
GetClientName(i, cName, sizeof(cName));
IntToString(GetClientUserId(i), UserId, sizeof(UserId));
new CurrentClientFrags = GetClientFrags(i) - FragCount[i];
new String:buffer[100];
Format(buffer, sizeof(buffer), "%s Wins: %i Kills: %i", cName, Wins[i], CurrentClientFrags);
AddMenuItem(Handle:menu, UserId, buffer, ITEMDRAW_RAWLINE);
}
}
}
public MenuHandler1(Handle:Scoreboard, MenuAction:action, param1, param2)
{
}
"Wins" is an array of integers, obviously each position storing the number of wins a player has.
I'm not sure how to permanently display it to all users as well as making it automatically update the wins, kills etc. If someone could provide me with some assistance I'd be very grateful
__________________