Hello!
For some reason my discord rich presence stopped working. I have had this script on 3 different servers of mine. I have quite alot of experience in scripting allready. So I know I put in all the right values but for some reason it stopped showing up in Discord. Am I the only one who has this? There are no errors client side nor server side. The weird thing is tho, on the server side it says it’s running. But when I open my resource monitor when I am in my server, I can’t find it. This is what it says on our profiles on Discord.
Here is my source code:
Citizen.CreateThread(function()
while true do
SetDiscordAppId(105**************614)
SetDiscordRichPresenceAsset('big')
SetDiscordRichPresenceAssetText('RevlineRP 1.0 | FiveM Community')
SetDiscordRichPresenceAssetSmall('small')
SetDiscordRichPresenceAssetSmallText('Join Today! discord.gg/*****')
SetDiscordRichPresenceAction(0, "Make sure to Join Our Discord!", "https://discord.gg/****")
SetDiscordRichPresenceAction(1, "Might as Well Connect!", "fivem://connect/******")
Citizen.Wait(60000)
end
end)
Citizen.CreateThread(function()
while true do
local VehName = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsUsing(PlayerPedId()))))
if VehName == "NULL" then VehName = GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsUsing(PlayerPedId()))) end
local x,y,z = table.unpack(GetEntityCoords(PlayerPedId(),true))
local StreetHash = GetStreetNameAtCoord(x, y, z)
local pId = GetPlayerServerId(PlayerId())
local pName = GetPlayerName(PlayerId())
Citizen.Wait(15000)
if StreetHash ~= nil then
StreetName = GetStreetNameFromHashKey(StreetHash)
if IsPedOnFoot(PlayerPedId()) and not IsEntityInWater(PlayerPedId()) then
if IsPedSprinting(PlayerPedId()) then
SetRichPresence("ID: "..pId.." | "..pName.." is sprinting down "..StreetName)
elseif IsPedRunning(PlayerPedId()) then
SetRichPresence("ID: "..pId.." | "..pName.." is running down "..StreetName)
elseif IsPedWalking(PlayerPedId()) then
SetRichPresence("ID: "..pId.." | "..pName.." is walking down "..StreetName)
elseif IsPedStill(PlayerPedId()) then
SetRichPresence("ID: "..pId.." | "..pName.." is standing on "..StreetName.."")
end
elseif GetVehiclePedIsUsing(PlayerPedId()) ~= nil and not IsPedInAnyHeli(PlayerPedId()) and not IsPedInAnyPlane(PlayerPedId()) and not IsPedOnFoot(PlayerPedId()) and not IsPedInAnySub(PlayerPedId()) and not IsPedInAnyBoat(PlayerPedId()) then
local MPH = math.ceil(GetEntitySpeed(GetVehiclePedIsUsing(PlayerPedId())) * 2.236936)
if MPH > 50 then
SetRichPresence("ID: "..pId.." | "..pName.." is speeding down "..StreetName.." at "..MPH.."MPH in a "..VehName)
elseif MPH <= 50 and MPH > 0 then
SetRichPresence("ID: "..pId.." | "..pName.." is cruising down "..StreetName.." at "..MPH.."MPH in a "..VehName)
elseif MPH == 0 then
SetRichPresence("ID: "..pId.." | "..pName.." is parked on "..StreetName.." in a "..VehName)
end
elseif IsPedInAnyHeli(PlayerPedId()) or IsPedInAnyPlane(PlayerPedId()) then
if IsEntityInAir(GetVehiclePedIsUsing(PlayerPedId())) or GetEntityHeightAboveGround(GetVehiclePedIsUsing(PlayerPedId())) > 5.0 then
SetRichPresence("ID: "..pId.." | "..pName.." is flying over "..StreetName.." in a "..VehName)
else
SetRichPresence("ID: "..pId.." | "..pName.." is landed at "..StreetName.." in a "..VehName)
end
elseif IsEntityInWater(PlayerPedId()) then
SetRichPresence("ID: "..pId.." | "..pName.." is swimming")
elseif IsPedInAnyBoat(PlayerPedId()) and IsEntityInWater(GetVehiclePedIsUsing(PlayerPedId())) then
SetRichPresence("ID: "..pId.." | "..pName.." is sailing in a "..VehName)
elseif IsPedInAnySub(PlayerPedId()) and IsEntityInWater(GetVehiclePedIsUsing(PlayerPedId())) then
SetRichPresence("ID: "..pId.." | "..pName.." is in a yellow submarine")
end
end
end
end)
I have tried multiple scripts from github, but all to no avail. I am honestly lost on what to do.
Thanks in advance!