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

im trying to make a give me ammo plugin and i get a few errors

if anyone could help me solve those errors than that be really cool

 

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

namespace InfinityScript.Examples
{
   public class givemeammo : BaseScript
   }
         if (message.StartsWith("!givemeAmmo "))
   {
               var weapon = player.currentweapon;
         player.call("GiveMaxAmmo",weapon);
{
                       }
                   }
               }
               return ChatType.ChatNone;
           }
           else
           {
               return ChatType.ChatContinue;
           }
       }
   }
}

i get error in line 8 column 41, line 10 column 11, line 18 column 17, line 19 column 13

Featured Replies

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

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

namespace Ammo
{
   public class Ammo : BaseScript
   {
       public Ammo()
           : base()
       {
           PlayerConnected += new Action(entity =>
               {
                   Call("setdvar", "motd", "DUKIP is awesome");
                   if (message.StartsWith("!givemeAmmo "))
                       entity.Call("givemaxammo");
               });
       }
   }
}

if (message.StartsWith("!givemeAmmo ")) fix that yourself

 

-Also I said stop copying itsmods!-

Опубликовано:
  • Автор
>wtf is 'chattype', never heard of it

>not having a method

>weird indentation

 

like really

dont get mad at me...

i only tried learning c# for a day... the hello world thing

and i try to learn by looking at others scripts/plugins...

so if i mess up... dont be mad, im still a noob.

Опубликовано:
  • Автор
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InfinityScript;

namespace Ammo
{
   public class Ammo : BaseScript
   {
       public Ammo()
           : base()
       {
           PlayerConnected += new Action(entity =>
               {
                   Call("setdvar", "motd", "DUKIP is awesome");
                   if (message.StartsWith("!givemeAmmo "))
                       entity.Call("givemaxammo");
               });
       }
   }
}

if (message.StartsWith("!givemeAmmo ")) fix that yourself

 

-Also I said stop copying itsmods!-

thanks so much for the help :P

i tried fixing the "message" error by adding

using System.Windows.Forms; as the first line and adding system.windows.forms as a reference, but that error still doesnt go away... ??

Опубликовано:
  • Автор
g

using System.Windows.Forms; as the first line and adding system.windows.forms as a reference, but that error still doesnt go away... ??

 

 

9d1c8_funny-dog-pictures-i-has-a-hotdog-nope-not-a-clue.jpg

 

I'm working on it myself but this is very annoying.

lol im new to C#.. so yeah im like a lost dog kinda... im trying tho

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

using System.Windows.Forms; as the first line and adding system.windows.forms as a reference, but that error still doesnt go away... ??

 

 

9d1c8_funny-dog-pictures-i-has-a-hotdog-nope-not-a-clue.jpg

 

I'm working on it myself but this is very annoying.

lol im new to C#.. so yeah im like a lost dog kinda... im trying tho

There's the .dll I just tested it and it worked.

Function to give ammo = !giveammo

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

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

namespace Ammo
{
   public class Ammo : BaseScript
   {
       public Ammo()
           : base()
       {
           PlayerConnected += new Action(entity =>
           {
               Call("setdvar", "motd", "DUKIP is awesome");
           });
       }
       public override void OnSay(Entity player, string name, string message)
       {
           if (message.StartsWith("!giveammo"))
           {
               var weapon = player.CurrentWeapon;
               player.Call("giveMaxAmmo", player.CurrentWeapon);
           }
       }
   }
}

I added public override void OnSay and blah

Your message starts with was wrong.

The call maxammo wasn't complete because you didn't add player.CurrentWeapon/CurrentWeapon so you wouldn't receive the ammo.

Опубликовано:
Dane nice u got skill :P

Do u know any people that would not be annoyed if I asked them for a lil help...

I dont want to annoy u lol, then u would hate me :/

Just don't ask people every day. Just small snippets of code would be fine..

Опубликовано:
  • Автор
Ok I c now...

Thanxs so much diduknowipwn :DD

Btw how long have u been working with c#?

Less than a month lol

So essentially your original code was right but the {} were off and you didn't add the ammo call to the weapon

so basically just change the direction of { to this } when ending a "subject" and starting a new one..

Опубликовано:
  • Автор
Dane nice u got skill :P

Do u know any people that would not be annoyed if I asked them for a lil help...

I dont want to annoy u lol, then u would hate me :/

Just don't ask people every day. Just small snippets of code would be fine..

YES SIR !!

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.