![]() :addParamĮxplode:defaultAccess( ULib.ACCESS_ADMIN )Įxplode:help( "Explodes target(s) with given and blast area " )Įxplode:logString( "#1s exploded #2s with #3i damage in a #4i radius blast area" ) ULib's documentation regarding shared command system explains MUCH of the below literal code functions Ĭode: local = ulx.command( "", "'>",, ",, ) Can you imagine 30+ functions, each one checking to make sure that argument 1 was typed, and had a player involved?Įven more checks if numbers/coordinates/whatever were expected after a valid players name. For every variable necessary, code would be required to make sure there's a default or error out.Įasy? Sure! But bulky. All the checks and balances would be required to be done within each function before the "Do Stuff". Though the above looks easy enough, which it is, remember that, when properly written, every single "well written" ulx function made by Team Ulysses or anyone else would include all of that code above. Do Gmod Lua effects stuff with all of the above variables. ULib.tsay( ply, "Radius must be between 0", true ) If #argv 10000 or radius < 0 then - return an error if radius is above 10000 and less than 0. Since ULX doesn't have anywhere near the documentation of ULib -, I'm writing this post as a general tutorialĪs to how the new (as of ULX 3.5 (currently in SVN)) command system works.įor comparison, the first few examples will show the OLD (ULX <= v3.4) code for adding a command.Ĭode: ulx.setCategory( "Fun" ) - Set category for help functionįunction ulx.cc_explode( ply, command, argv, args ) Why else would we have a Modules folder within ULX? That would/could allow greater functionality of administrating your server. Though ULX wasn't written to build an entire system on like ULib could be, ULX WAS made to be able to add additional commands and functions Some community members have stated that it is complicated to understand -Īnd are of the opinion that ULX wasn't meant to be built upon. As of (the upcoming) ULX 3.5, the command system has been totally re-written in a way that allows for much greater flexibilityĪnd though it may not seem so at first, I feel it is much easier to create commands/modules once you've gotten the hang of it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |