hi! ive been doing server development for like 1 year or 2 right… i know front and back about resources and shit so i aint dumb
so i load up to my vps and decide i wanna develop my rich presence for my server because it has some advertising leads to it since you can press and button and you can make players link it to a website which is sick as fuck right
i have an older resource that ive used for around 12 months now for previous servers and it’s worked perfectly fine since. i decide to make a new discord dev application so i dont use my previous server dev app. i ensure the script and i load into the server. i connect to the fivem rich presence and then it says im connecting to my server and then disappears. literally no client and server errors in any console and i dont know what i did wrong. i had a friend give me his rich presence resource and it works literally perfectly fine??? we have the same line of code. ill present both lines here in a second, but heres a video of my activity of when i open fivem and connect to my server.
friends code:
Citizen.CreateThread(function()
while true do
SetDiscordAppId(844781187087466497)
SetDiscordRichPresenceAsset('big')
SetDiscordRichPresenceAssetText('Dark Networks 2.0 | FiveM Community')
SetDiscordRichPresenceAssetSmall('small')
SetDiscordRichPresenceAssetSmallText('Join Today! discord.gg/3xPR4gHDeA')
SetDiscordRichPresenceAction(0, "Make sure to Join Our Discord!", "https://discord.gg/3xPR4gHDeA")
SetDiscordRichPresenceAction(1, "Might as Well Connect!", "https://cfx.re/join/r3ydj7")
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)
my code:
Citizen.CreateThread(function()
while true do
--properties
local name = GetPlayerName(PlayerId())
local id = GetPlayerServerId(PlayerId())
local street = GetStreetNameFromHashKey(GetStreetNameAtCoord(table.unpack(GetEntityCoords(player))))
local vehicle = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(GetVehiclePedIsUsing(PlayerPedId()))))
local MPH = math.ceil(GetEntitySpeed(GetVehiclePedIsUsing(PlayerPedId())) * 2.236936)
local NumberOfPlayers = 0
for i = 0, 255 do
if NetworkIsPlayerActive(i) then
NumberOfPlayers = NumberOfPlayers + 1
end
end
--game status app
SetDiscordAppId(863587944127660043)
--logo icon
SetDiscordRichPresenceAsset('tempestlogo')
SetDiscordRichPresenceAssetText('https://discord.tempestcommunity.com/')
--buttons
local button1name = 'Wanna know what Tempest is? Check out our website!'
local button1url = 'https://www.tempestcommunity.com/'
local button2name = 'Join our Discord community too!'
local button2url = 'https://discord.tempestcommunity.com/'
SetDiscordRichPresenceAction(0, button1name, button1url)
SetDiscordRichPresenceAction(1, button2name, button2url)
--small icon
--SetDiscordRichPresenceAssetSmall('discordsmall')
--SetDiscordRichPresenceAssetSmallText('https://discord.gg/cooley')
--loop for rich presense change
SetRichPresence('Players: ' .. NumberOfPlayers)
Wait(5*1000)
SetRichPresence('ID: ' .. id)
Wait(5*1000)
SetRichPresence('IGN: ' .. name)
Wait(5*1000)
SetRichPresence('www.tempestcommunity.com/')
Wait(7*1000)
--updates every selected seconds
Citizen.Wait(10000)
end
end)
--[[
UNUSED RICH PRESENSES:
SetRichPresence( "AOP: " .. TriggerClientEvent('aop:updateAOP') )
]]
so wtf did i do wrong? am i supposed to wait for like discord to verify something or some shit like what? this is pissing me off because it literally works fine for my friend but it doesnt for me like what what did i do wrong