General > Developers Corner
ULX User Group Ranks in a Loading Screen?
(1/1)
? Rainn ?:
Hello! I am developing a loading screen and I was wondering is there any way you can implement ULX ranks in a loading screen? My guess is that it would have to include PHP or JavaScript. If you guys have a piece of code you are willing to give or can point me in the right direction that would be great! If you have any questions please ask away! Thanks.
Timmy:
There are many ways to implement ULX ranks in a loading screen.
Here's how I would approach this:
1. Create a PHP script that can receive and save data.
2. Create a Lua script that generates a hash table that maps SteamID -> group, serialize it, and send it off to the web server every time a group-related change occurs.
3. Create a PHP script that reads the saved data, deserialize it, and use it to look up the group by SteamID.
The following should get you something to play around with:
Create the following files on your web server:
* index.php
* update.php
Create the following file on your game server:
* lua/autorun/server/loadingscreen.lua
Instructions:
- Set the url variable in loadingscreen.lua equal to the location of the update.php script.
--- Code: ---local url = "https://example.org/update.php"
--- End code ---
- Set your sv_loadingurl equal to the location of the index.php script. Append "?steamid=%s" to tell the script about the user's SteamID.
--- Code: ---sv_loadingurl "https://example.org/index.php?steamid=%s"
--- End code ---
- Add a user to a group, remove a user from a group or change the name of a group to send data to the web server.
--- Code: ---ulx adduserid STEAM_0:0:57225082 superadmin
--- End code ---
Navigation
[0] Message Index
Go to full version