Skip to content
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.

Easy MapEdit

Tired of having to manually add the map edits to the txt file? tired of having to alt-tab and shit so you can create a mapedit? well this is for you then!

 

How to use:

Use the chat command set the START and the END of the map edit.

!wall
!ramp
!tp
!htp
!floor

Then type "map_restart" on server console and done!

 

TODO:

-Add map_restart ingame.

-Add door.

-Somehow, fly?

-Instantly create the mapedits.

 

Source Code:

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

namespace ManualMapEdit
{
   public class ManualMapEdit : BaseScript
   {
       bool creating = false;
       float startx;
       float starty;
       float startz;
       float endx;
       float endy;
       float endz;

       public ManualMapEdit()
           : base()
       {
           PlayerConnected += new Action(player =>
           {
               player.Call("notifyonplayercommand", "fly", "+frag");
               player.OnNotify("fly", (ent) =>
               {
                   if (player.GetField("sessionstate") != "spectator")
                   {
                       player.Call("allowspectateteam", "freelook", true);
                       player.SetField("sessionstate", "spectator");
                       player.Call("setcontents", 0);
                   }
                   else
                   {
                       player.Call("allowspectateteam", "freelook", false);
                       player.SetField("sessionstate", "playing");
                       player.Call("setcontents", 100);
                   }
               });
           });
       }
       public override void OnSay(Entity player, string playerName, string text)
       {
           var mapname = Call("getdvar", "mapname");

           string[] msg = text.Split(' ');


           if (msg[0] == "!restart")
           {
               Call("setdvar", "map_restart", "1");
           }

           if (msg[0] == "!wall" && !creating)
           {
               player.Call("iprintlnbold", "^2START SET: " + player.Origin);
               startx = player.Origin.X;
               starty = player.Origin.Y;
               startz = player.Origin.Z;
               creating = true;
           }
           else if (msg[0] == "!wall" && creating)
           {
               player.Call("iprintlnbold", "^2END SET: "+player.Origin);
               endx = player.Origin.X;
               endy = player.Origin.Y;
               endz = player.Origin.Z;
               creating = false;
               File.AppendAllText("scripts\\maps\\" + mapname + ".txt", Environment.NewLine + "wall: (" + startx + "," + starty + "," + startz + ") ; (" + endx + "," + endy + "," + endz + ")");
           }

           if (msg[0] == "!ramp" && !creating)
           {
               player.Call("iprintlnbold", "^2START SET: " + player.Origin);
               startx = player.Origin.X;
               starty = player.Origin.Y;
               startz = player.Origin.Z;
               creating = true;
           }
           else if (msg[0] == "!ramp" && creating)
           {
               player.Call("iprintlnbold", "^2END SET: " + player.Origin);
               endx = player.Origin.X;
               endy = player.Origin.Y;
               endz = player.Origin.Z;
               creating = false;
               File.AppendAllText("scripts\\maps\\" + mapname + ".txt", Environment.NewLine + "ramp: (" + startx + "," + starty + "," + startz + ") ; (" + endx + "," + endy + "," + endz + ")");
           }

           if (msg[0] == "!tp" && !creating)
           {
               player.Call("iprintlnbold", "^2START SET: " + player.Origin);
               startx = player.Origin.X;
               starty = player.Origin.Y;
               startz = player.Origin.Z;
               creating = true;
           }
           else if (msg[0] == "!tp" && creating)
           {
               player.Call("iprintlnbold", "^2END SET: " + player.Origin);
               endx = player.Origin.X;
               endy = player.Origin.Y;
               endz = player.Origin.Z;
               creating = false;
               File.AppendAllText("scripts\\maps\\" + mapname + ".txt", Environment.NewLine + "elevator: (" + startx + "," + starty + "," + startz + ") ; (" + endx + "," + endy + "," + endz + ")");
           }

           if (msg[0] == "!htp" && !creating)
           {
               player.Call("iprintlnbold", "^2START SET: " + player.Origin);
               startx = player.Origin.X;
               starty = player.Origin.Y;
               startz = player.Origin.Z;
               creating = true;
           }
           else if (msg[0] == "!htp" && creating)
           {
               player.Call("iprintlnbold", "^2END SET: " + player.Origin);
               endx = player.Origin.X;
               endy = player.Origin.Y;
               endz = player.Origin.Z;
               creating = false;
               File.AppendAllText("scripts\\maps\\" + mapname + ".txt", Environment.NewLine + "HiddenTP: (" + startx + "," + starty + "," + startz + ") ; (" + endx + "," + endy + "," + endz + ")");
           }

           if (msg[0] == "!floor" && !creating)
           {
               player.Call("iprintlnbold", "^2START SET: " + player.Origin);
               startx = player.Origin.X;
               starty = player.Origin.Y;
               startz = player.Origin.Z;
               creating = true;
           }
           else if (msg[0] == "!floor" && creating)
           {
               player.Call("iprintlnbold", "^2END SET: " + player.Origin);
               endx = player.Origin.X;
               endy = player.Origin.Y;
               endz = player.Origin.Z;
               creating = false;
               File.AppendAllText("scripts\\maps\\" + mapname + ".txt", Environment.NewLine + "floor: (" + startx + "," + starty + "," + startz + ") ; (" + endx + "," + endy + "," + endz + ")");
           }

       }
   }
}

Featured Replies

Nice Plugin. Thanks

Don't forget rule #6.

 

now you must compile in revision 28 :D

Don't forget rule #6.

I'm not using anything from MapEdit code in my code, this is just an addition.

Don't forget rule #6.

I'm not using anything from MapEdit code in my code, this is just an addition.

I don't want to be a smart ass but afaik you did not create the ufo mode (already seen it somewhere else) so you would have to give credits for that.

now you must compile in revision 28 :D

It still works for r28

Don't forget rule #6.

I'm not using anything from MapEdit code in my code, this is just an addition.

I don't want to be a smart ass but afaik you did not create the ufo mode (already seen it somewhere else) so you would have to give credits for that.

*sigh* If anyone created it it was IW... its just switching game states for the player entity. Works the same way in IW4... any moron could come up with it. He simply chose to copy it from another source. It doesn't really matter in this case as the code that he is using is literally just a port of something from gsc that got stolen from somewhere else.

Don't forget rule #6.

I'm not using anything from MapEdit code in my code, this is just an addition.

I don't want to be a smart ass but afaik you did not create the ufo mode (already seen it somewhere else) so you would have to give credits for that.

Well, it doesnt work there in my code, and i forgot to remove it anyways, but if you soo annoyed by it, that part of code is made by DidUKnowiPwn i think, credits to him.

Don't forget rule #6.

I'm not using anything from MapEdit code in my code, this is just an addition.

I don't want to be a smart ass but afaik you did not create the ufo mode (already seen it somewhere else) so you would have to give credits for that.

Well, it doesnt work there in my code, and i forgot to remove it anyways, but if you soo annoyed by it, that part of code is made by DidUKnowiPwn i think, credits to him.

Not just me... it was mostly TheApadayo I just did some slight changes.

Don't forget rule #6.

 

now you must compile in revision 28 :D

Rule #6 doesn't mean compiling problems.

 

that's not my mean , mistake quote

  • 4 weeks later...

how to ply

  • 1 month later...

and the command for the doors?

Join the conversation

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

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

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.