how can I use a function from a diffrent class? Im new to seperating classes, I can seperate classes already but how can I use a function from a diffrent class.
you need to get an instance of the class and call a function to that like ($class = new MyClass())->dosmth() or do it staticly if it's static MyClass::doSmthStatic()
Think you can show me a quick example? I wanna use the function on my plugin called “Interact” from my class called “EventListener” how could i do that? If you could please give me an example?
add a argument on construct to grab your main class and save it in a property also add an argument to the newclass command giving it your own class access it by using the property you had saved the main class to
I think you should ask on stackoverflow for this .. This really is not related to pmmp and on stackoverflow you have better chance to get help if you still don't understand it.