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

RSS[L4D2] pcsWelcome Message


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Description
This plugin uses HookEvent("player_team") and grabs their new (and old) team. If their team is 0, they aren't fully-loaded. If their team is 1, they are loaded but haven't been assigned a team yet because other players are still loading (or are about to be assigned a team). Once players have been assigned to team 2 (survivors) or team 3 (infected), they are fully past the loading screen and can see chat. This plugin then displays a message to them. This plugin should be compatible with competitive L4D2 servers as well.

By default, this prints 2 messages to each player individual, translated to their language provided in the phrases file. You also have an option to make it print every map, or just on the very first time they connect to the server. Once they disconnect, they'll see the welcome message again.

An autoexec is created in cfg/sourcemod for this plugin.

Cvars
  • pcs_everymap "1" // Whether to print every map.
  • pcs_lines "2" // How many lines to print.

Other plugins use things like player_connect, player_spawn, or OnClientPutInServer(), etc. Some of these fire multiple times in L4D2 especially during map changes, and don't cover the initial time everyone is loading in from a lobby where load times and connections vary. As well, things like OnClientPutInServer() will fire before a client finishes loading.

Compiling

In order to compile, you will need colors.inc ->
https://forums.alliedmods.net/showthread.php?t=96831

Installation

You don't need to mess with any of the code to change the messages in the translation files.
pcsWelcome.smx -> addons/sourcemod/plugins
pcswelcome.phrases.txt -> addons/sourcemod/translations

Changelog:
Code:

1.0 (July 16th - 2024)
  - Initial release.

Additional
This is a very simple plugin. While I plan to add to it, the whole point of it is for others to build on it and tailor it to their own liking. You can increase the amount of lines by changing a few things in a few places easily. The plugin also should work for Left4Dead1, but I do not have a server setup to test these so if you want you can remove the public APLRes AskPluginLoad2 at the top to let it load.

Attached Files
File Type: sp Get Plugin or Get Source (pcsWelcome.sp - 2.7 KB)
File Type: txt pcswelcome.phrases.txt (549 Bytes)
File Type: smx pcsWelcome.smx (7.1 KB)

Wyświetl pełny artykuł

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