Recent Posts

Pages: [1] 2 3 ... 10
Developers Corner / Re: Slash commands
« Last post by Jewson on Today at 12:36:52 AM »
Ok daddy. :D
I was just writing it when I was so tired.
Developers Corner / Re: Slash commands
« Last post by JamminR on Yesterday at 08:32:45 PM »
Welcome to Ulysses, welcome to ULib.
Please don't use language, even censored out, most parents wouldn't want a 6 year old hearing.
Developers Corner / Re: Slash commands
« Last post by Jewson on Yesterday at 08:21:43 PM »
Ok I found my mess up. I was inserting in this "ply:ConCommand( commandstring )", at the beginning a beginning of chat command not console command from the table. Now I changed that to insert a chat command and now it works.

Thank you anyway.

PS. To all of you out there. Remember to double check your code.
Developers Corner / Re: Slash commands
« Last post by iViscosity on Yesterday at 08:11:56 PM »
ULX doesn't give "Unknown command" messages unless actually doing "ulx <command>" in the console. Chat commands won't give that to you. Is that the full message that you are given or is there more?
Developers Corner / [SOLVED] Slash commands
« Last post by Jewson on Yesterday at 07:59:28 PM »
I'm new to forum and new to ULX and ULib (code side ofc). And I'm coding RP gamemode. I decided to integrate ULX permissions into my gamemode to not make my own. I did my own chat command thing to recognize commands and execute them in console. And it works ( or worked ). It reacts to "/" commands and I did "/addmoney" and /setmoney and when I try to type them in I get this in console: "Unknown command: addmoney" and "Unknown command: setmoney". When I type for eg. "/ajhdajs" my system reacts but with two command mentioned earlier it doesn't work.

I think it is ULX causes that, because before I added ULX and ULib to my server/gamemode it worked perfectly.

Thanks to all of you who help me.
Releases / Re: ULib SQLite Authentication
« Last post by FunServer on Yesterday at 01:27:55 PM »
Thank you.
Releases / ULib SQLite Authentication
« Last post by MrPresident on July 17, 2018, 04:26:10 PM »
What This Is
This is a replacement for ULib's UCL storage system. The current system saves and reads all stored users and their accesses from a single text file. This works fine, unless you a LOT of users, at which point you will start to experience some lag.

What This Does
This overrides the Save and Load functions in UCL. Instead of loading and saving your users to the users.txt file, it will instead load and save them from a SQLite database.

What This Doesn't Do
This only handles users. It doesn't store groups or group permissions. Those are still going to be stored in the groups.txt
This doesn't handle banning. Bans are already saved to the SQLite database by default in the newer versions of ULX.

What Is Modified
You will need to *replace* your ucl.lua file in addons\ULib\lua\ulib\server\ucl.lua
We typically NEVER recommend that you replace any of our stock files as this could cause issues or the changes will be reverted the next time you update ULib.. However, due to the nature of this kind of modification simply writing it into an addon wouldn't work because of the way modules are loaded. If you choose to install this, I HIGHLY recommend making a backup of your ULib addon first.
Inside the ucl.lua file I added some SQLite functions. I also modified the SaveFile function as well as completely commented out the LoadFromFile function. I also slightly modified addUser and removeUser functions.

How To Install
1. Download the copy of ucl.lua from this post (YOU NEED TO BE LOGGED IN TO SEE IT)
2. Replace Addons\ULib\lua\server\ucl.lua with the one I provided.
3. (optional) From your server console or in game (if you are a superadmin) run ulib_loadlegacy to load your users from your users.txt and load them into your database.

Upgrading from my MySQL module addon
If you decided you want to use the SQLite version instead of the MySQL version (because maybe you only have 1 server and don't need to access the data from outside of gmod) I've made it quite easy to import your existing MySQL users into this new SQLite system. Follow these directions EXACTLY:

1. BEFORE uninstalling the old module and installing this module, you will need to download the UCL MySQL to SQLite Backup file below.
2. Install it as an addon.
3. Launch your server and run the command: ulib_backupmysql
4. Verify that it wrote a file entitled: garrysmod/data/sql_ucl_backup.txt
5. Stop server and uninstall the addon you just installed. You won't need it anymore.
6. Download the latest version of ULib and overwrite the current version you have (This resets your ucl.lua file back to default)
7. Proceed to install this SQLite version as normal.
8. Once you've launched your server with the SQLite version installed, run the following command from the server to import your backed up users: ulib_loadfrommysql

If you update ULib this modification will be lost and you'll have to reinstall it.
This comes as-is and while I did to testing, there is no way for me to know if it'll work in every situation. Please make a backup of your ULib files before installing this.

Post questions here, and I will do my best to help you. I've tested this with ULX/ULib version:
ULib v2.63d (05/12/18)
ULX v3.73d (05/20/18)

Please let me know how this works for you. :)
Additionally, though the actual releases may not work anymore, you might get more ideas from the bare code in releases/archived releases section.
There were 2 or 3 made to control usage of various weapons/items/functions/etc.
Developers Corner / Re: Custom Echo Text Colors
« Last post by JamminR on July 17, 2018, 03:58:33 PM »
Follow the function code.
Starts here -
Goes down, determines if it's the beginning of the line, sets default color, goes down, if it comes across a player, colors misc color.
Try this:

Code: Lua
  1. local CN= "Trainer"
  3. local bannedSweps = {
  4.         "weapon_keypadchecker",
  5.         "arrest_stick",
  6.         "door_ram",
  7.         "keys",
  8.         "pocket",
  9.         "unarrest_stick",
  10.         "weaponchecker",
  11.         "weapon_nav_editor",
  12.         "manhack_welder",
  13.         "tbfy_manager",
  14.         "weapon_vape_mega"
  15. }
  17. function ulx.give( calling_ply, target_ply, weapon )
  18.         if table.HasValue( bannedSweps, weapon ) then
  19.                 print("That weapon is banned!")
  20.         else
  21.                 target_ply:Give( weapon )
  22.         end
  23.         ulx.fancyLogAdmin( calling_ply, true , "#A gave #T a ".. weapon ,target_ply)
  24. end
  25. local give = ulx.command( CN, "ulx give", ulx.give , "!give" , true )
  26. give:addParam{ type=ULib.cmds.PlayerArg, target="*"}
  27. give:addParam{ type=ULib.cmds.StringArg, hint="weapon"}
  28. give:defaultAccess( ULib.ACCESS_ADMIN )
  29. give:help( "Gives a certain player a weapon" )

Note: Not tested... just fixed the table stuff in your code.
Pages: [1] 2 3 ... 10