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

We all know the custom killstreak mods from iw4m, they were awesome! :o

For example: When you hit a 3 killstreak, you would be rewarded with 3 deagle bullets in iSnipe.

 

I would like to bring that back but I have no idea how to do it. :(

 

I know how to give the player the bullets, but I don't know how you set it so the player gets the bullets when he hits for example a 3 killstreak...

 

Could someone help me get started here? Since I am not a very experienced C# coder... :P

Featured Replies

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

Tech Support should have advanced knowledge about the project and provide correct answers. I am not sure if NTA just uses a random generator to choose the Tech Supporters.

 

Anyway you can count the killstreak (OnPlayerKilled) and when the player hits the desired value you execute your custom killstreak code.

Опубликовано:
Tech Support should have advanced knowledge about the project and provide correct answers. I am not sure if NTA just uses a random generator to choose the Tech Supporters.

 

Anyway you can count the killstreak (OnPlayerKilled) and when the player hits the desired value you execute your custom killstreak code.

They know enough about it. They're tech support, that doesn't mean that they know to code in C# nor that they are NTA.

Опубликовано:
  • Автор
Tech Support should have advanced knowledge about the project and provide correct answers. I am not sure if NTA just uses a random generator to choose the Tech Supporters.

 

Anyway you can count the killstreak (OnPlayerKilled) and when the player hits the desired value you execute your custom killstreak code.

 

Hmm I think I am going to give this another go tomorrow!

 

Thanks for trying to help me out. :D

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

So I came up with this code...

 

public class CustomKillstreaks : BaseScript
   {
       private int KillStreak = 0;
       private int KillAdd = 1;
       public static string SecondaryWeapon = "iw5_44magnum_mp_tactical";

       public void KillStreakCalculation()
       {
           KillStreak = KillStreak + KillAdd;
       }

       public override void OnPlayerKilled(Entity player, Entity inflictor, Entity attacker, int damage, string mod, string weapon, Vector3 dir, string hitLoc)
       {
           if (attacker.IsAlive)
           {
               KillStreakCalculation();
               if (KillStreak == 3)
               {
                   try
                   {
                       attacker.Call("setWeaponAmmoStock", SecondaryWeapon, "3");
                   }
                   catch (Exception ex)
                   {
                       Log.Write(LogLevel.Info, "Give Ammo Failed");
                   }
               }
           }
           else
           {
               KillStreak = 0;
           }
       }

   }

 

The console says the plugin is loaded but when I kill someone the server crashes -_-

What did I do wrong? :D

Please keep in mind that I am a very unexperienced C# programmer xD

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

This is easier said then done.... we just need a way to call stock gsc scripts from C#. All of the code is there in _killstreaks.gsc but we can't call it yet. This and a functioning "spawn" call needed to be added to the API.

Опубликовано:
  • Автор
This is easier said then done.... we just need a way to call stock gsc scripts from C#. All of the code is there in _killstreaks.gsc but we can't call it yet. This and a functioning "spawn" call needed to be added to the API.

 

Oh allright so you obviously have way more more knowledge on this then I do xD

So we'll just have to wait untill someone finds a way to call the code from the gsc's I suppose?

Опубликовано:
This is easier said then done.... we just need a way to call stock gsc scripts from C#. All of the code is there in _killstreaks.gsc but we can't call it yet.

won't be possible as there's no way to know which integer label id is which function

 

This and a functioning "spawn" call needed to be added to the API.

spawn should already be working; make sure you're calling it using a Vector3 object

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.