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

RSSCSGO hns plugin


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Currently making a hns server and created a plugin for team switching but im kinda stuck with it.

Plugin atm takes the first t to die and puts him to ct and takes the old ct to t so the hunter switches.

I need the plugin to check the amount of players and if there are more then 6 players on the server and if there is it takes to first 2 to die and puts them to ct so there are more hunters otherwise it continues with one hunter. Also if its possible it would be awesome if it could disable manual team switching. Thx alot to everyone who tries to help :)

code:
#include <cstrike>
#include <cstrike>
#include <sourcemod>
#include <sdktools>
public Plugin:myinfo =
{
name = "Team switch",
author = "Tanttinen",
description = "Team Switch for SourceMod.",
version = "1",
url = ""
};

new s_firstT;
new s_oldCT;
new bool:firstTdead = false;

public OnPluginStart()
{
HookEvent("player_death", OnPlayerDeath);
HookEvent("round_start", OnRoundStart, EventHookMode_Pre);
}

public Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
new victim = GetClientOfUserId(GetEventInt(event, "userid"));

if (GetClientTeam(victim) == CS_TEAM_T && !firstTdead) {
firstTdead = true;
s_firstT = victim;
s_oldCT = GetClientOfUserId(GetEventInt(event, "attacker"));

}

return Plugin_Continue;

}

public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{ if (s_firstT > 0 && s_oldCT > 0) {
ChangeClientTeam(s_firstT, CS_TEAM_CT);
ChangeClientTeam(s_oldCT, CS_TEAM_T);
}
firstTdead = false;
s_firstT = 0;
s_oldCT = 0;

}
public void OnMapEnd() {
firstTdead = false;
s_firstT = 0;
s_oldCT = 0;
}

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ę...