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

This is a simple plugin that allow admins to change jump_height, g_speed and g_gravity dvars.

 

The plugin work only if there is a text file called "jump_plugin_setting.txt" on the same folder.

Edit the file provided with this:

AdminName1,AdminName2,AdminName3
jump_height=39
g_speed=190
g_gravity=800

Admins name are separated by a comma (no space!)

The numbers near dvar will be the default value dvar of all matches.

 

Chat control for admin:

//jump_height [number]

//g_speed[number]

//g_gravity[number]

 

//all default config //This command will set all dvar to default config value.

//all default game //This command will set all dvar to default game value.

 

//jump_height default config //This command will set jump_height dvar to default config value.

//jump_height default game //This command will set jump_height dvar to default game value.

//g_speed default config //This command will set g_speed dvar to default config value.

//g_speed default game //This command will set g_speed dvar to default game value.

//g_gravity default config //This command will set g_gravity dvar to default config value.

//g_gravity default game //This command will set g_gravity dvar to default game value.

 

Source code:

/*  
           ***Settings Plugin***

   Based on InstaGib plugin by DaMacc
   Admin system and chat control by Kiren0494
   zxz0000 remove fall damage
*/

using System;
using System.IO;
using System.Collections;
using System.Runtime.InteropServices;

using InfinityScript;

namespace InfinityScript.Examples
{
   public class jump_plugin : BaseScript
   {
       public string executionPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
       public int jump_heightConfig;
       public int g_speedConfig;
       public int g_gravityConfig;
       public int jump_heightDefault = 39;
       public int g_speedDefault = 190;
       public int g_gravityDefault = 800;

       public jump_plugin()
       {
           StreamReader objReader = new StreamReader(@executionPath + "\\" + "jump_plugin_setting.txt");
           string sLine = "";
           ArrayList arrText = new ArrayList();

           while (sLine != null)
           {
               sLine = objReader.ReadLine();
               if (sLine != null)
               {
                       arrText.Add(sLine);
               }
           }
           objReader.Close();
           string[] admins = arrText[0].ToString().Split(',');
           string[] settings = arrText[1].ToString().Split('=');
           jump_heightConfig = int.Parse(settings[1]);
           settings = arrText[2].ToString().Split('=');
           g_speedConfig = int.Parse(settings[1]);
           settings = arrText[3].ToString().Split('=');
           g_gravityConfig = int.Parse(settings[1]);

           setDefaultConfigValue();

           OnNotify("prematch_done", () =>
           {
               Call("iprintln", "^6Setting plugin loaded with ^2jump_height = ^1" + JumpHeight + "^2, g_speed = ^1" + Speed + "^2, g_gravity = ^1" + Gravity);
           });

           PlayerConnecting += new Action(entity =>
           {
               entity.SetField("isAdmin", 0);
               for (int i = 0; i < admins.Length; i++)
               {
                   if (admins[i].CompareTo(getPlayerName(entity))==0)
                   {
                       entity.SetField("isAdmin", 1);
                   }
               }
           });
       }

       public override void OnSay(Entity player, string playerName, string text)
       {
           string[] arrChatMsg = text.Split(' ');

           if (arrChatMsg[0] == "/jump_height")
           {
               if (playerIsAdmin(player) == 0)
               {
                   player.Call("iprintlnbold", "^1SORRY, YOU ARE NOT ADMIN D:");
                   return;
               }
               try
               {
                   if (arrChatMsg.Length != 1)
                   {
                       if (arrChatMsg[1] == "default")
                       {
                           if (arrChatMsg[2] == "game")
                           {
                               Call("iprintln", "^1jump_height " + JumpHeight + "-----^5Changed^1-^5to^1----->" + jump_heightDefault + " (default game value) ^2by" + playerName);
                               JumpHeight = jump_heightDefault;
                           }
                           if (arrChatMsg[2] == "config")
                           {
                               Call("iprintln", "^1jump_height " + JumpHeight + "-----^5Changed^1-^5to^1----->" + jump_heightConfig + " (default server value) ^2by" + playerName);
                               JumpHeight = jump_heightConfig;
                           }
                       }
                       else
                       {
                           Call("iprintln", "^1jump_height " + JumpHeight + "-----^5Changed^1-^5to^1----->" + arrChatMsg[1] + " ^2by" + playerName);
                           JumpHeight = int.Parse(arrChatMsg[1]);
                       }
                   }
                   else
                       player.Call("iprintlnbold", "^1jump_height is set to ^2:"+JumpHeight);
               }
               catch (Exception e)
               {
               }
           }
           if (arrChatMsg[0] == "/g_speed")
           {
               if (playerIsAdmin(player) == 0)
               {
                   player.Call("iprintlnbold", "^1SORRY, YOU ARE NOT ADMIN D:");
                   return;
               }
               try
               {
                   if (arrChatMsg.Length != 1)
                   {
                       if (arrChatMsg[1] == "default")
                       {
                           if (arrChatMsg[2] == "game")
                           {
                               Call("iprintln", "^1g_speed " + Speed + "-----^5Changed^1-^5to^1----->" + g_speedDefault + " (default game value) ^2by" + playerName);
                               Speed = g_speedDefault;
                           }
                           if (arrChatMsg[2] == "config")
                           {
                               Call("iprintln", "^1g_speed " + Speed + "-----^5Changed^1-^5to^1----->" + g_speedConfig + " (default server value) ^2by" + playerName);
                               Speed = g_speedConfig;
                           }
                       }
                       else
                       {
                           Call("iprintln", "^1g_speed " + Speed + "-----^5Changed^1-^5to^1----->" + arrChatMsg[1] + " ^2by" + playerName);
                           Speed = int.Parse(arrChatMsg[1]);
                       }
                   }
                   else
                       player.Call("iprintlnbold", "^1g_speed is set to ^2:" + Speed);
               }
               catch (Exception e)
               {
               }

           }
           if (arrChatMsg[0] == "/g_gravity")
           {
               if (playerIsAdmin(player) == 0)
               {
                   player.Call("iprintlnbold", "^1SORRY, YOU ARE NOT ADMIN D:");
                   return;
               }
               try
               {
                   if (arrChatMsg.Length != 1)
                   {
                       if (arrChatMsg[1] == "default")
                       {
                           if (arrChatMsg[2] == "game")
                           {
                               Call("iprintln", "^1g_gravity " + Gravity + "-----^5Changed^1-^5to^1----->" + g_gravityDefault + " (default game value) ^2by" + playerName);
                               Gravity = g_gravityDefault;
                           }
                           if (arrChatMsg[2] == "config")
                           {
                               Call("iprintln", "^1g_gravity " + Gravity + "-----^5Changed^1-^5to^1----->" + g_gravityConfig + " (default server value) ^2by" + playerName);
                               Gravity = g_gravityConfig;
                           }
                       }
                       else
                       {
                           Call("iprintln", "^1g_gravity " + Gravity + "-----^5Changed^1-^5to^1----->" + arrChatMsg[1] + " ^2by" + playerName);
                           Gravity = int.Parse(arrChatMsg[1]);
                       }
                   }
                   else
                       player.Call("iprintlnbold", "^1g_gravity is set to ^2:" + Gravity);
               }
               catch (Exception e)
               {
               }
           }
           if (arrChatMsg[0] == "/all")
           {
               if (playerIsAdmin(player) == 0)
               {
                   player.Call("iprintlnbold", "^1SORRY, YOU ARE NOT ADMIN D:");
                   return;
               }
               try
               {
                   if (arrChatMsg[1] == "default")
                   {
                       if (arrChatMsg[2] == "config")
                       {
                           Call("iprintln", "^1jump_height = " + JumpHeight + "g_speed = " + Speed + " g_gravity = " + Gravity + "^2 Changed by " + playerName);
                           setDefaultConfigValue();
                       }
                       if (arrChatMsg[2] == "game")
                       {
                           Call("iprintln", "^1jump_height, g_speed, g_gravity changed to normal value ^2by " + playerName);
                           setDefaultGameValue();
                       }
                   }
               }
               catch (Exception e)
               {
               }
           }
           return;
       }

       public override void OnPlayerDamage(Entity player, Entity inflictor, Entity attacker, int damage, int dFlags, string mod, string weapon, Vector3 point, Vector3 dir, string hitLoc)
       {
           if (mod == "MOD_FALLING" && JumpHeight > 120)
           {
               player.Health += damage;
           }
       }

       public void setDefaultConfigValue()
       {
           JumpHeight = jump_heightConfig;
           Speed = g_speedConfig;
           Gravity = g_gravityConfig;
       }

       public void setDefaultGameValue()
       {
           JumpHeight = jump_heightDefault;
           Speed = g_speedDefault;
           Gravity = g_gravityDefault;
       }

       public string getPlayerName(Entity player)
       {
           return player.GetField("name");
       }

       public int playerIsAdmin(Entity player)
       {
           return player.GetField("isAdmin");
       }

       public static unsafe int Gravity
       {
           get
           {
               return *((int*)0x4768C6);
           }

           set
           {
               *((int*)0x4768C6) = value;
           }
       }

       public static unsafe int Speed
       {
           get
           {
               return *((int*)0x4760ea);
           }

           set
           {
               *((int*)0x4760ea) = value;
           }
       }

       public static unsafe float JumpHeight
       {
           get
           {
               return *((float*)0x6da708);
           }

           set
           {
               *((float*)0x6da708) = value;
           }
       }    
   }
}

 

Credits:

DaMacc - Offsets

zxz0O0 - Removed fall damage

Me

 

  • Approved by Pigophone on 31/10/12

Featured Replies

Опубликовано:
Awesome bro! But for me, it threw an error, the correct name is: "plugin_setting.txt" not "jump_plugin_setting.txt"

StreamReader objReader = new StreamReader(executionPath + "\\jump_plugin_setting.txt");

no no, definitely jump_plugin_setting.txt, as included with the .zip.

Опубликовано:
  • Автор
Awesome bro! But for me, it threw an error, the correct name is: "plugin_setting.txt" not "jump_plugin_setting.txt"

 

You`re right, Pigophone changed the name on the description but no on the source code :)

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

I compiled from the source...

why would you bother

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

I've been wanting something to have a g_speed increase on my server but don't know how to code. Thanks for the up, works great so far.

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

I really like this, but there's something missing there... how to change those variables from the console.

I even tried a trick such as setting the first admin on the txt as "console" and then on the console typing "say //jump_height 1000". But the command didn't work because of that "//" part.

I assume that taking that "//" part from the source and recompiling would do the trick for setting "console" as one of the admins, and then use something like "say jump_height 1000" to change the variables through the console. But I think something standard could be adopted, rather than custom code for that special need.

My purpose here is to first find a way to set those variables through console/rcon, and then I'll make and post here on this topic a small b3 plugin for those commands, so that all certain level b3 admins can control those variables, rather than 3 admins from the txt (useful for bigger online gaming communities who have several server admins).

  • 1 month later...
Опубликовано:

hi! I have a "little" problem with the script... so when we play some players have this problem

they don't die D: this happens only with 2 players, I've asked on italian forum and they told me to ask here, maybe there is a problem with the script or an error during compiling the script.

sorry for my english but I'm italian :D

  • 1 month later...
Опубликовано:

i have new code if you want pm me!

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

i put the admin names,,

 

but u know what,, all joiners can jump like me. lol

how can i set that only me can do that high jump..

 

need reply plss

Опубликовано:
i put the admin names,,

 

but u know what,, all joiners can jump like me. lol

how can i set that only me can do that high jump..

 

need reply plss

 

That is not possible. It's an unsafe value set for the entire server.

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

After Server UPDATE to version r29 , jump - Speed Script Don't Work !

 

I should Return to R28 ???? or This Script Will UPDATE ????

 

TNX

 

The source is in the post...

Compile it yourself for r29?

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

After Server UPDATE to version r29 , jump - Speed Script Don't Work !

 

I should Return to R28 ???? or This Script Will UPDATE ????

 

TNX

 

well it just works nice for me , i also use r29 anyway

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

in the game,

i just type

/jump_height

/g_gravity

/g_speed

 

and it works good for me :D

  • 1 month later...
Опубликовано:

works well , but how come when i have it set like this

SycoKill3r

jump_height=800

g_speed=200

g_gravity=600

 

people dont die like they are supposed to

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.