Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Do you want to be able to configure the font through the config? 88 пользователей проголосовало

  1. 1. Do you want to be able to configure the font through the config?

    • Don't care!
      15
    • No!
      5
    • Yes!
      107

Пожалуйста, войдите или зарегистрируйтесь для голосования в опросе.

Featured Replies

Опубликовано:

First of all, I'm new to C#, so this mod might not be perfect!

The way it works is very simple. It reads a text file and displays it's content as welcome message on your server.

 

Source:

//momo5502 is learning C# 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

using InfinityScript;

namespace Message
{

   public class Message : BaseScript
   {
       public Message()
           : base()
       {

           //Read the config file
           var config = File.ReadAllLines("scripts\\message.txt");

           //Write to the console
           Log.Write(LogLevel.Info, "\nMomo5502's Welcome Message Plugin loaded!\nMessage set to:\n  1st Line: \"" + config[0] + "\"\n  2nd Line: \"" + config[1] + "\"\n  3rd Line: \"" + config[2] + "\"\nIcon set to: \"" + config[3] + "\"\nHud set to: \"" + config[4] + "\"");

           //Precache the Icon
           Call("precacheShader", config[3]);

           PlayerConnected += entity =>
           {
               //Hud Text
               var hud = HudElem.CreateFontString(entity, "objective", 3f);
               hud.SetPoint("TOPCENTER", "TOPCENTER", 0, 10);
               hud.SetText(config[4]);

               entity.AfterDelay(12000, Entity =>
                   {
                       //First Line
                       var elem = HudElem.CreateFontString(entity, "objective", 2.5f); 
                       elem.SetPoint("CENTER", "CENTER", 0, -50);
                       elem.SetText(config[0]);

                       //Second Line
                       var text = HudElem.CreateFontString(entity, "objective", 2.0f); 
                       text.SetPoint("CENTER", "CENTER", 0, -30);
                       text.SetText(config[1]);

                       //Third Line
                       var text1 = HudElem.CreateFontString(entity, "objective", 1.75f);
                       text1.SetPoint("CENTER", "CENTER", 0, -10);
                       text1.SetText(config[2]);

                       //Icon
                       var icon = HudElem.CreateIcon(entity, config[3], 60, 60);
                       icon.SetPoint("CENTER", "CENTER", 0, 30);
                       icon.Alpha = 1;

                       //Hide everything after 7 seconds
                       entity.AfterDelay(7000, Momo5502 => //Momo5502 as parameter^^
                       {
                           elem.SetText("");
                           text.SetText("");
                           text1.SetText("");
                           icon.Alpha = 0;
                       });   
                   });     
           };
       }
   }
}

 

Extract the downloaded files to the scripts folder and edit your welcome message in the message.txt

 

-UPDATE-

Supports now up to 3 lines of text, 1 icon and a hud text.

If you don't want for example the icon (or line1, 2 or 3), don't completly remove the line from the message.txt, but simply leave the line blank (or your unwanted line of text)!

To sum it up: Your message.txt contains out of 6 lines (no matter if blank or not):

Line 1: Text of line 1

Line 2: Text of line 2

Line 3: Text of line 3

Line 4: Iconname

Line 5: Hud text on the top

Line 6: Security line (always blank; otherwise server will crash)

 

Please report any bugs! :)

 

 

911D24FFAC5E2A378EBDC5BFD2BC3D9B3259FA72

 

C8D4CA156F51FE5C3401057E1ABC620FBBCE878F

 

  • Approved by Pigophone on 08/10/12

  • Ответы 82
  • Просмотры 7,2k
  • Created
  • Последний ответ

Top Posters In This Topic

Опубликовано:
  • Автор
MegMak":sl681ax1]i remeber the welcome message from alterIWnet IW4, something like this

 

Welcome to XXXX Server

Have fun "Player XXX"

Don't Hack

 

:cry: so nice ;)

 

:D Yeah, i already got multiple lines to work, and im now working on an icon ;)

Опубликовано:
MegMak":os6jb081]i remeber the welcome message from alterIWnet IW4, something like this

 

Welcome to XXXX Server

Have fun "Player XXX"

Don't Hack

 

:cry: so nice ;)

 

:D Yeah, i already got multiple lines to work, and im now working on an icon ;)

 

That will be awesome man, anything i can help you im here, im not a pro programer but i do my best!! :)

Опубликовано:
  • Автор
MegMak":1h1om8ga]
MegMak":1h1om8ga]i remeber the welcome message from alterIWnet IW4, something like this

 

Welcome to XXXX Server

Have fun "Player XXX"

Don't Hack

 

:cry: so nice ;)

 

:D Yeah, i already got multiple lines to work, and im now working on an icon ;)

 

That will be awesome man, anything i can help you im here, im not a pro programer but i do my best!! :)

Well, I'm not a pro programmer either xD

Опубликовано:
  • Автор
can not understand it! What should I edit? Dll file in the archive!

 

Your message.txt contains out of 5 lines (no matter if blank or not):

Line 1: Text of line 1

Line 2: Text of line 2

Line 3: Text of line 3

Line 4: Iconname

Line 5: Security line (always blank; otherwise server will crash)

Опубликовано:
  • Автор
plug off, and all is well! Why?

Aren't you using IW5 Server Addon instead of the IW5M API?

I do not understand. I use the server iw5 it works! But when I turn on the plugin I always spectator

Do you have the InfinityScript.dll?

Опубликовано:

Is this good? :(

haven't tested if the plugin actually works though..

 

[scriptLoader] An error occurred during initialization of the script Message: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IndexOutOfRangeException: Array index is out of range.

 at Message.Message..ctor () [0x00000] in :0 

 at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)

 at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 

 --- End of inner exception stack trace ---

 at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 

 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0 

 at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in :0 

 at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in :0 

 at System.Activator.CreateInstance (System.Type type) [0x00000] in :0 

 at InfinityScript.ScriptLoader.LoadAssembly (System.Reflection.Assembly assembly) [0x00000] in :0

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.