Hello, im posting my first script.
This script adds discord rich presence.
Rich presence includes:
Job specific icons (easy to configure)
Player ID, name and total players on server.
Feel free to edit the code, but dont forget to mention me
Donβt Count players in the discord rich presence. Player 0/64 all time.
players = {}
local playerCount = Config.PlayerCount - 1
for i = 0, playerCount do
if NetworkIsPlayerActive( i ) then
table.insert( players, i )
end
end
SetRichPresence('ID:' .. GetPlayerServerId(NetworkGetEntityOwner(GetPlayerPed(-1))) .. ' | ' .. GetPlayerName(PlayerId()) .. ' | ' ..' '.. Config.PlayerText ..' ' .. #players .. '/' .. tostring(Config.PlayerCount))
Starting under the ESX framework, only problem is that the script doesnt wait until the player spawns, it tries to retrieve all the info when a player join.