Raised This Month: $ Target: $400
 0% 

[CS:GO] Custom scoreboard


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 06-14-2014 , 11:50   [CS:GO] Custom scoreboard
Reply With Quote #1

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
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time

Last edited by sim242; 06-14-2014 at 11:51. Reason: Missed out a piece of code
sim242 is offline
Send a message via Skype™ to sim242
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:04.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode