[CS:GO] Sm_Scores

Post Reply
User avatar
Andreeas
Hero Member
Hero Member
Posts: 601
Joined: Wed Jan 22, 2020 8:17 pm
Jucator SA:MP ?: Nu
Nick:: Andreeas
Jucator CS ?: Nu

[CS:GO] Sm_Scores

Post by Andreeas »

Sm_Scores
Hi!
So I was recently searching around for a similar plugin, but couldn't just find anything that satisfied me enough. Sure, there were a lot of good plugins that I could use, however I thought that it isn't that hard to make it yourself, so I did it. And here I am today, still using this plugin on my own servers and it works great! (In my eyes).

Please, do not let the simplicity of this script get judget, I made it to fill up my needs, also I thought about posting it here if anyone had the similar needs as me . Enjoy the release, didn't correct my grammar or spelling, so my English might be broken I think lol.
Get a girl's heart, don't know how tho lol, wish me good luck.
Finnish school.
Get into another school and finnish education.
Become a billionaire.

Code: Select all

#include <cstrike>

char g_sInfo[128];

public void OnPluginStart()
{
    RegConsoleCmd("sm_rounds", RoundsCmd);
    HookEvent("round_end", RoundEnd);
}

public Action RoundsCmd(int iClient, int iArgs)
{
    if(iClient) PrintToChat(iClient, " » You're \x07%d \x01rounds in to the game!", CS_GetTeamScore(CS_TEAM_T) + CS_GetTeamScore(CS_TEAM_CT));
    return Plugin_Handled;
}

public void RoundEnd(Event event, const char[] name, bool dbc)
{
    switch(event.GetInt("winner"))
    {
        case CS_TEAM_T: FormatEx(g_sInfo, sizeof(g_sInfo), " » \x07Terrorists \x01has won the last round. %d - %d", CS_GetTeamScore(CS_TEAM_T), CS_GetTeamScore(CS_TEAM_CT));
        case CS_TEAM_CT: FormatEx(g_sInfo, sizeof(g_sInfo), " » \x0BCounter-Terrorists \x01has won the last round. %d - %d.", CS_GetTeamScore(CS_TEAM_CT), CS_GetTeamScore(CS_TEAM_T));
    }
    
    CreateTimer(8.0, TimerWinner, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action TimerWinner(Handle hTimer)
{
    PrintToChatAll(g_sInfo);
    return Plugin_Stop;
} 
Post Reply

Return to “Server Management”