Author Topic: ULX User Group Ranks in a Loading Screen?  (Read 163 times)

0 Members and 1 Guest are viewing this topic.

Offline ? Rainn ?

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
ULX User Group Ranks in a Loading Screen?
« on: October 18, 2017, 05:44:15 PM »
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.

Offline Timmy

  • Respected Community Member
  • Full Member
  • *****
  • Posts: 155
  • Karma: 127
  • Code monkey
    • View Profile
Re: ULX User Group Ranks in a Loading Screen?
« Reply #1 on: October 22, 2017, 05:24:01 AM »
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: [Select]
local url = "https://example.org/update.php"- 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: [Select]
sv_loadingurl "https://example.org/index.php?steamid=%s"- 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: [Select]
ulx adduserid STEAM_0:0:57225082 superadmin
hello@timmy.ws (PGP key) • Steam • GitHub