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

Hello, prompt once again =)

I write the AutoBan script for my server.

I can not understand what command to ban the player has connected

ban + name does not work, after the client connection to the console server is written there is no such command

 

player.Call(" ? ");

 

"ban " + banlist[numline] - not work

 

 

----cut----

if (player.GetField("name") == banlist[numline])

{

player.Call(" ? ");

}

----cut----

Featured Replies

Опубликовано:
I believe it was banclient insteadm

Sorry

I use a translator and I do not understand the meaning of the expression.

Could you rephrase the answer?

Опубликовано:
I believe it was banclient insteadm

Sorry

I use a translator and I do not understand the meaning of the expression.

Could you rephrase the answer?

 

Like he said, if you mean the console command, it's 'banclient #'

replace # with the client number

Опубликовано:
Like he said, if you mean the console command, it's 'banclient #'

replace # with the client number

 

No, I'm not talking about the console command.

In the console all works well.

 

I made a script that reads the file names from the autoban.txt.

If we assume no string tag end of the file, then check the user is connected to the line from the file name autoban.txt.

If the user is in the file Banlist, i need to ban a user and does not give it connects.

 

And the command console by type (ban name, and etc) - does not work in this script.

Swears in the log server, there is no such command.

 

I need in the body of the program player.Call ("suicide"); replace at something else then, to connected player received a ban.

 

---programm body---
           var banlist = File.ReadAllLines("scripts\\autoban.txt");
           Log.Write(LogLevel.Info, "\n Bro-Team Server AutoBan Plugin loaded!");
           PlayerConnected += new Action(player =>
           {
               int numline = 0;
               metka:
               if (banlist[numline] != "END")
               {
                   if (player.GetField("name") == banlist[numline])
                   {
                       var txt = HudElem.CreateFontString(player, "objective", 2f);
                       txt.SetPoint("CENTER", "CENTER", 0, 0);
                       txt.SetText("^1You permanently banned !");
                       player.Call("suicide");
                   }
                   else
                   {
                       numline = numline + 1;
                       goto metka;
                   }
---programm body---    

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

 

made as written on the link - does not work.

maybe I'm doing something wrong?

 

Server log:

----------------------------------

[Notifiable] Exception during handling of notify event connected on AutoBan.AutoBan: System.MissingMethodException: Method not found: 'InfinityScript.Utilities.ExecuteCommand'.

at InfinityScript.BaseScript.<.ctor>b__2 (InfinityScript.Parameter entity) [0x00000] in :0

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

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

----------------------------------

 

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

namespace AutoBan
{
   public class AutoBan : BaseScript
   {
       public AutoBan()
           : base()
       {
           var banlist = File.ReadAllLines("scripts\\autoban.txt");
           Log.Write(LogLevel.Info, "AutoBan Plugin loaded!");
           PlayerConnected += new Action(player =>
           {
               int numline = 0;
           metka:
               if (banlist[numline] != "END")
               {
                   if (player.GetField("name") == banlist[numline])
                   {
                       var txt = HudElem.CreateFontString(player, "objective", 2f);
                       txt.SetPoint("CENTER", "CENTER", 0, 0);
                       txt.SetText("^1You permanently banned !");
                       //Utilities.ExecuteCommand("ban " + banlist[numline]);
                       Utilities.ExecuteCommand("fast_restart");
                   }
                   else
                   {
                       numline = numline + 1;
                       goto metka;
                   }

               }
           });
       }
   }
}

  • 2 weeks later...
Опубликовано:
Utilities.ExecuteCommand("banclient {0}",FINDYOURSELF!);

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

>goto

 

NO, LEARN TO CODE

only use goto in switch statements, pls (and even then, try to code it so you don't even need to use it in switch statements)

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.