Author Topic: Add-on help  (Read 2147 times)

I want to make a kill gui, or command. i made an add-on but it doesnt show up in the game or any add-on selection?

Gui = F10 in when you have the mission editor.

The Gui uses scripts. So you will be scripting.

Scripting - search a tutorial.

Making it appear, you must do correct packaging.

oh, i got most of that, and im quite good at computers, but i dont know how to package. is there somewhere to help me with that?

Use the search tool, or do what I did: check other add-ons of the same type, and see what they have in common, then make your like theirs.

ok thanks, so once i package it will it show up on add-on list? or do i have to upload it to personal uploads on rtb then download to my blockland?

Once you have it packaged with a server.cs and a description.txt and it's in your addon folder, it should work as long as you enable it.

ok, ive looked and once i package this ill retest, but should this work?

exec("./control.gui");

Code: [Select]
exec("./control.gui");

function Kill(%client)
{
ServercmdSelf Delete(findclientbyname(%client));

}

tell me whats wrong, the gui is just a button and a textbox, you are suppose to type in the name and it kills that person.

1. What's in control.gui?
2. What's the "command" variable of the button?
3. How are you opening the GUI?

1.
the gui is just a button and a textbox, you are suppose to type in the name and it kills that person.
2. i have no idea what you mean by command variable, im guessing its client?
3. i dont know how to open gui, thats part of the problem

If you haven't set the command then there's nothing linking your button to the textbox or the "Kill" function.

If it is a weapon, put this in...


Weapon_(your weapons name)

Maybe put in a command to open the Gui?

Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiControl(control) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   visible = "1";

   new GuiWindowCtrl() {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "110 27";
      extent = "153 95";
      minExtent = "8 2";
      visible = "1";
      text = "Killer";
      maxLength = "255";
      resizeWidth = "1";
      resizeHeight = "1";
      canMove = "1";
      canClose = "1";
      canMinimize = "1";
      canMaximize = "1";
      minSize = "50 50";
      closeCommand = "canvas.popdialog(control);";
   };
   new GuiBitmapButtonCtrl() {
      profile = "GuiDefaultProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "116 84";
      extent = "140 30";
      minExtent = "8 2";
      visible = "1";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "./client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "0 255 0 255";
   };
   new GuiMLTextCtrl() {
      profile = "GuiMLTextProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "177 91";
      extent = "19 14";
      minExtent = "8 2";
      visible = "1";
      lineSpacing = "2";
      allowColorChars = "0";
      maxChars = "-1";
      text = "Kill";
      maxBitmapHeight = "-1";
      selectable = "1";
   };
   new GuiEditCtrl() {
      profile = "LoadTextProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "122 54";
      extent = "125 30";
      minExtent = "8 2";
      visible = "1";
   };
   new GuiTextEditCtrl() {
      profile = "GuiTextEditProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "119 59";
      extent = "135 18";
      minExtent = "8 2";
      visible = "1";
      maxLength = "128";
      historySize = "0";
      password = "0";
      tabComplete = "0";
      sinkAllKeyEvents = "0";
   };
};
//--- OBJECT WRITE END ---

function pushtestgui(%Gui)
{
   %Gui = canvas.pushDialog(control);
}
here is the code for the gui...

- You've made an "open GUI" command that is never called. Make a keybind by looking at other mods that add to the options/controls menu.
- The button doesn't call your 'kill' function.

ok, im working on fixing all of that. but recently my blockland has been crashing constantly, after 3 or 4 hours, sometimes sooner. Could this be the cause? a broken add-on?