Ok so i was wondering how i can make each of my $args[0] in a different file , its for a faction plugin so theirs going be a lot of $args[0] usage so i want to sperate them to its own file.
Can someone just show me the correct way todo this? I don't care if its complicated or its more of a hassle.
The question is not in whether it's complicated or whether you know how to, but in why you want to do it. If you simply think multi files "looks cool": Just forget it. It looks even cooler if you manage a large plugin in a single file. If you want to separate your code into separate files to make it easier to manage, just create "utility classes" that declare static methods. Create a class of any (valid) name you like, declare a static function with the required parameters (e.g. $main, $args, $sender, etc.) and call the static function from your original command handler, moving your code over there. You don't even need to create useless stuff like class properties and constructors. If you truly have reasons related to OOP that makes you want to separate files... you should know how anyway.
A SubCommand class would probably be what you're looking for, but I'd look into OOP(Object Oriented Programming) before trying to do it. In the long run, it'd be good to know OOP anyways.
I have seen so many people registering commands with custom classes without an explicit reason to. What they do is just to complicate a single plugin by rewriting what is in the PluginCommand class. This gets more ironic when your command only has a few lines that actually execute something, and you're writing several tens of lines in several files, redirecting calls everywhere just to execute a few lines. Admittedly, it is good when your plugin gets big in the future. But you could as well implement the onCommand() method in PluginBase and make calls to static methods in other classes. Generally, you don't need to register custom command classes unless your commands are highly dynamic (e.g. you register new commands according to settings in a config, not hardcoded commands).