I have player status for every move they make. Whatâs the way to remove this? Iâve gone through the Visualizer but it resets everytime I make edits to it.
I am not able to do that, i tried but i am not getting to the display the player count for some reason even before that it says User - 0/32
Do I need to start the script in server.cfg?
Iâve had some awful luck on this script and canât seem to get it to work again. I got this working with my servers but when I updated the pipeline id (server âcoreâ) they suddenly stop working. Iâve tried making the script from scratch, tried remaking the discord app. Yet, having no luck. Does anyone know what the issue might be?
and how do I add it to the FiveM RichPresence script?
Yes, just make a simple resource and start that in the server.cfg.
Make two files:
(Make sure to edit variables accordingly)
client.lua
Citizen.CreateThread(function()
while true do
-- Replace the functions below with your own ID and asset-names
-- This is the Application ID (Replace this with you own)
SetDiscordAppId(123456788967867867)
-- Here you will have to put the image name for the "large" icon.
SetDiscordRichPresenceAsset('logo_name')
-- Here you can add hover text for the "large" icon.
SetDiscordRichPresenceAssetText('This is a lage icon with text')
-- Here you will have to put the image name for the "small" icon.
SetDiscordRichPresenceAssetSmall('logo_name')
-- Here you can add hover text for the "small" icon.
SetDiscordRichPresenceAssetSmallText('This is a lsmall icon with text')
-- Showname implementation with new Native
-- Old script: https://github.com/Parow/showname
-- Amount of online players (Don't touch)
local playerCount = #GetActivePlayers()
-- Your own playername (Don't touch)
local playerName = GetPlayerName(PlayerId())
-- Set here the amount of slots you have (Edit if needed)
local maxPlayerSlots = "32"
-- Sets the string with variables as RichPresence (Don't touch)
SetRichPresence(string.format("%s - %s/%s", playerName, playerCount, maxPlayerSlots))
-- It updates every one minute just in case.
Citizen.Wait(60000)
end
end)
__resource.lua
resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'
client_script 'client.lua'
why does a very large amount of player on the server
just have me on the server and it shows 200 player
What code did you use? (you can send it privately if you want)
Iâve tested it and it works just fine, maby you have a old server version where the âGetActivePlayers()â native is missing, this was added in v1.0.0.1367 on June 28th, so make sure you server version is v1.0.0.1367 or above
did I update the game artifacts?
I donât know how to update with your link
Hi i have also problem with player counter is meybe problem in rich presence? Meybe i set some thing wrong i am not sure now. I whant to remove player location and set only how many are them online.
Sorry for the late response, but yes you need a newer version from the artifacts for the native to work (any version after 1367 sould work) https://runtime.fivem.net/artifacts/fivem/build_server_windows/master/
it doesnât work for me
Iâm alone on the server and tag 119 players
already updated the artifacts
I have chnaged the code for you with the old method of counting the online players, instead of âGetActivePlyers()â i use a simple for loop
Try this code
client.lua
Citizen.CreateThread(function()
while true do
-- Replace the functions below with your own ID and asset-names
-- This is the Application ID (Replace this with you own)
SetDiscordAppId(123456788967867867)
-- Here you will have to put the image name for the "large" icon.
SetDiscordRichPresenceAsset('logo_name')
-- Here you can add hover text for the "large" icon.
SetDiscordRichPresenceAssetText('This is a lage icon with text')
-- Here you will have to put the image name for the "small" icon.
SetDiscordRichPresenceAssetSmall('logo_name')
-- Here you can add hover text for the "small" icon.
SetDiscordRichPresenceAssetSmallText('This is a lsmall icon with text')
-- Your own playername (Don't touch)
local playerName = GetPlayerName(PlayerId())
-- Set here the amount of slots you have (Edit if needed)
local maxPlayerSlots = 32
-- For loop to get active player (Legacy method)
local playerCount= 0
for i = 0, maxPlayerSlots do
if NetworkIsPlayerActive(i) then
playerCount = playerCount+1
end
end
-- Sets the string with variables as RichPresence (Don't touch)
SetRichPresence(string.format("%s - %s/%s", playerName, playerCount, maxPlayerSlots))
-- It updates every one minute just in case.
Citizen.Wait(60000)
end
end)