Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

RSSPlugin request for retakes


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Hello everyone!

I have this retakes plugin on my server:

https://github.com/splewis/csgo-retakes

I added this HUD plugin to it:

https://github.com/b3none/retakes-hud
Code:

/*
 * Retake - Bombsite overlays
 * by: shanapu
 * https://github.com/shanapu/retake-overlays
 *
 * Version: 1.0
 *
 * Copyright (C) 2017 Thomas Schmidt (shanapu)
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http:// www.gnu.org/licenses/>.
 */


#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <overlays>
#include <retakes>


#pragma semicolon 1
#pragma newdecls required


ConVar gc_bTeam;
ConVar gc_fTime;
ConVar gc_sPathA;
ConVar gc_sPathB;


char g_sPathA[64];
char g_sPathB[64];


public Plugin myinfo = {
        name = "Retake - Bombsite overlays",
        author = "shanapu",
        description = "Show a overlay with the actual bomsite",
        version = "1.1",
        url = "https://github.com/shanapu/retake-overlays"
};


public void OnPluginStart()
{
        CreateConVar("sm_retakes_overlays_version", "1.0", "The version of this SourceMod plugin", FCVAR_DONTRECORD);
       
        gc_bTeam = CreateConVar("sm_retake_overlays_team", "1", "Show overlays only for counter-terrorists", _, true, 0.0, true, 1.0);
        gc_fTime = CreateConVar("sm_retake_overlays_time", "1.5", "How long show the Bombsite overlays? in seconds", _, true, 1.0);
        gc_sPathA = CreateConVar("sm_retake_overlays_path_a", "overlays/retake/overlay_a", "Path to the bombsite A overlay DONT TYPE .vmt or .vft");
        gc_sPathB = CreateConVar("sm_retake_overlays_path_b", "overlays/retake/overlay_b", "Path to the bombsite B overlay DONT TYPE .vmt or .vft");

        gc_sPathA.GetString(g_sPathA, sizeof(g_sPathA));
        gc_sPathB.GetString(g_sPathB, sizeof(g_sPathB));

        HookConVarChange(gc_sPathA, OnSettingChanged);
        HookConVarChange(gc_sPathB, OnSettingChanged);

        AutoExecConfig(true, "overlays", "sourcemod/retakes");
}


public void OnSettingChanged(Handle convar, const char[] oldValue, const char[] newValue)
{
        if (convar == gc_sPathA)
        {
                strcopy(g_sPathA, sizeof(g_sPathA), newValue);
                PrecacheDecalAnyDownload(g_sPathA);
        }
        if (convar == gc_sPathB)
        {
                strcopy(g_sPathB, sizeof(g_sPathB), newValue);
                PrecacheDecalAnyDownload(g_sPathB);
        }
}


public void OnMapStart()
{
        PrecacheDecalAnyDownload(g_sPathA);
        PrecacheDecalAnyDownload(g_sPathB);
}


public void Retakes_OnSitePicked(Bombsite& site)
{
        if (site == BombsiteA)
        {
                for (int i = 1; i <= MaxClients; i++)
                {
                        if (!IsClientInGame(i))
                                continue;

                        if (CS_TEAM_CT == CS_TEAM_CT)
                                continue;

                        ShowOverlay(i, g_sPathA, gc_fTime.FloatValue);
                       
                }
        }
       
        else if (site == BombsiteB)
        {
                for (int i = 1; i <= MaxClients; i++)
                {
                        if (!IsClientInGame(i))
                                continue;

                        if (CS_TEAM_CT == CS_TEAM_CT)
                                continue;

                        ShowOverlay(i, g_sPathB, gc_fTime.FloatValue);
                       
                }
        }
}

Which basically announces, where the bombsite is, like so:

Retake Bombite: A
Retake Bombite: B

or saying Defend The bombsite for the terrorists and etc'.

I saw the HUD plugin on a server, which displayed the HUD with players counted on each team, like so:

Retake Bombsite :A CT-2 Terror-3

This is the function that needs to be added for it to work:

Code:

stock int GetAliveTeamCount(int team)
{
    int number = 0;
    for (new i=1; i<=MaxClients; i++)
    {
        if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == team) 
            number++;
    }
    return number;
}

I would have done it myself, but I couldn't do it because I'm not familiar with SourcePawn, and also the translation Phrases.

I would be glad if someone can help me with it.
It would also be great to release it to everyone to enjoy.:)

Przeczytaj cały wpis

Odnośnik do komentarza
Udostępnij na innych stronach

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...