Перейти к содержимому
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.
Опубликовано:

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

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!
      11%
      15
    • No!
      3%
      5
    • Yes!
      84%
      107

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

Featured Replies

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

What is the name of the flag iran icon?

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

hello everyone !

 

This code is made by using the following script ! Much love to publish;) Developed by [ HUN ] . Maverick :.- PupujZRT

 

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

namespace MaverickScripts
{
   public class WelcomeMessagesV2 : BaseScript
   {
       private HudElem globalText;
       private bool globalTextVisible;

       public WelcomeMessagesV2()
           : base()
       {
           var config = File.ReadAllLines("scripts\\message.txt");
           //Precache the Icon
           Call("precacheShader", config[3]);
           Call("precacheShader", config[5]);
           globalTextVisible = false;

           PlayerConnected += entity =>
           {
               // Global flashing header text
               globalText = HudElem.CreateFontString(entity, "objective", 2f);
               globalText.SetPoint("TOPCENTER", "TOPCENTER", 0, 10);
               globalText.SetText(config[4]);

               //Icon2
               var icon2 = HudElem.CreateIcon(entity, config[5], 50, 50);
               icon2.SetPoint("BOTTOMRIGHT", "BOTTOMRIGHT", 0, 0);
               icon2.Alpha = 1;

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

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

                   //Third Line
                   var thirdLine = HudElem.CreateFontString(entity, "objective", 1.5f);
                   thirdLine.SetPoint("CENTER", "CENTER", 0, -10);
                   thirdLine.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(5000, Momo5502 => //Momo5502 as parameter^^
                   {
                       firstLine.SetText("");
                       secondLine.SetText("");
                       thirdLine.SetText("");
                       icon.Alpha = 0;

                       // Show and hide title in every 10 seconds
                       entity.OnInterval(10000, player =>
                       {
                           globalTextVisible = !globalTextVisible;
                           if (globalTextVisible)
                           {
                               globalText.SetText(config[4]);
                           }
                           else
                           {
                               globalText.SetText("");
                           }
                           return true;
                       }
                       );
                   }
                   );
               }
               );
           };
       }
   }
}

  • 3 weeks later...
Опубликовано:

Here is a program that compiles iwi format With it you can see the titles and emblems in a folder main (run program open the iw folder and drag the file in the program) sorry for my english :oops:

Screenshot

http://hostingkartinok.com/show-image.php?id=5bf0a1081e2ca2010e3bfd686bd02b91

Download

http://www.codspc.com/files/doc_download/61-utilita-iwi-x-dds-4-0-konverter-fajlov.html

  • 3 weeks later...
Опубликовано:

Put files where needed to be but it does not start up with my server . what should i try?

Join the conversation

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

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

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

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

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

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

Account

Navigation

Поиск

Поиск

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.