Skip to content

partiusfabaa/ms-advertisement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

ms-advertisement

A plugin for cs that allows you to show ads in chat/center

Preview

Chat:

image

Center:

image

Installation

  1. Install ModSharp
  2. Download Advertisement
  3. Unzip the archive and upload it to the game server

Config

The config is created automatically

[
  {
    "Interval": 5,
    "Messages": [
      {
        "Chat": "{info_status}",
        "Center": "{center_date}"
      },
      {
        "Center": "{info_server}"
      },
      {
        "Chat": "{chat_social}"
      }
    ]
  }
]

Localization

The plugin supports translations, but they are optional. You can write raw text directly in the config if you prefer.

To use the translation system: Define your translations in the language file.

Use the key format {KEY_NAME} in your Advertisement.json.

Example:

If you have "my_message" in your lang file, put {my_message} in the config.

Custom Placeholders (API)

This plugin supports ModSharp Dynamic Natives. Other plugins can register custom tags to be used in advertisements.

For Developers: Register a function returning an object via RegisterDynamicNative.

  • Supported signatures: Func<IPlayerController, object> or Func<object>.

Example:

Code: RegisterDynamicNative(this, "MyPlugin::Credits", (Func<IPlayerController, object>)GetPlayerCredits);

Config: Your credits: {MyPlugin::Credits}

CHAT COLORS:

{White}, {DarkRed}, {Pink}, {Green}, {LightGreen}, {Lime}, {Red}, {Grey}, {Yellow}, {Gold}, {Silver}, {Blue}, {DarkBlue}, {Purple}, {LightRed}, {Muted}, {Head}

TAGS:

{MAP} 	- current map

{TIME} 	- server time

{DATE} 	- current date

{IP} - server ip

{PORT} - server port

{PLAYERS} - number of players on the server

{MAXPLAYERS} - how many slots are available on the server

\n OR {N}		- new line

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages