public int movementSpeed = 24;
PlayerBot pb = new PlayerBot(/*whatever it needs in here*/);
pb.jump=10;
pb.movementSpeed=100;
namespace MCDzienny
{
public partial class PBot
{
//file
}
}
namespace MCDzienny
{
public class Cmdzombot : Command
{
//rest of stuff
PBot pb = new PBot(/*the stuff*/);
}
}
ismellike wrote:To edit the jump and movementSpeed you would have to do something like this.
- Code: Select all
PlayerBot pb = new PlayerBot(/*whatever it needs in here*/);
pb.jump=10;
pb.movementSpeed=100;
If I were to make a zombot, I would make a partial class like I did with the mapgen plugin.
I would just directly copy and paste the PlayerBot.cs file into my code around a partial class and add in options to search only for not infected.
- Code: Select all
namespace MCDzienny
{
public partial class PBot
{
//file
}
}
namespace MCDzienny
{
public class Cmdzombot : Command
{
//rest of stuff
PBot pb = new PBot(/*the stuff*/);
}
}
ismellike wrote:That way you could edit it however you want it, or how would you add it o_o?
using System;
namespace MCDzienny
{
public class CmdMyCommand : Command
{
// Stuff
public override void Use(Player p, string message)
{
PBot pb = new PBot(p);
pb.MyMethod();
}
}
public class PBot
{
Player player;
public PBot(Player p)
{
player = p;
}
public void MyMethod()
{
player.flipHead = true;
}
}
}
public partial class MyClass
{
public string myClassName;
public MyClass(string myClassName)
{
this.myClassName = myClassName;
}
}
public partial class MyClass
{
public string myString;
public int myInt;
public void MyMethod(string str, int i)
{
Console.WriteLine(str + " " + i.ToString());
}
}
public class StartOfProgram
{
public static void Main(string[] args)
{
MyClass mc = new MyClass("name");
mc.myString = "hello";
mc.myInt = 10;
mc.MyMethod(mc.myString, mc.myInt);
}
}
Users browsing this forum: No registered users and 1 guest