boofiboi / FiveM-Discord-Presence

FiveM resource to get your server a nice customized Discord rich presence.
GNU General Public License v2.0
15 stars 6 forks source link

Location #2

Closed SiahRBLX closed 11 months ago

SiahRBLX commented 1 year ago

Location does not match what player is on via ingame

boofiboi commented 1 year ago

Any screenshots of the issue? I unfortunatly wasnt able to reproduce it.

SiahRBLX commented 1 year ago

Not home at the moment but when In the city the location don’t update via rich presence when players go to different streets.

I’ll try testing more around 6am EST

boofiboi commented 1 year ago

I have a hunch what's going on. I'll get back to you when i also arrive home.

Deathdomain commented 11 months ago

he didnt post anything but i will

Deathdomain commented 11 months ago

https://cdn.discordapp.com/attachments/1070193725071962153/1190242597692776458/IMG_9934.png?ex=65a116cc&is=658ea1cc&hm=bfeec564bdc0c9db594493137348c491f5b6a73c43dada6f4fb3c028bca9539d&

Deathdomain commented 11 months ago

https://cdn.discordapp.com/attachments/1070193725071962153/1190242287976976384/image.png?ex=65a11683&is=658ea183&hm=6c96de9bad90af94561153c08718200b4f637a34164ced96f1b45b880a6b9752&

boofiboi commented 11 months ago

Perhaps im using the wrong export for getting the street location, lemme find it.

Deathdomain commented 11 months ago

okay, i just got mine from you last night :) easy to set up just want the street to show since its the only preset working for me

boofiboi commented 11 months ago
function location()
    local coords = GetEntityCoords(ped)
    local location = GetStreetNameFromHashKey(GetStreetNameAtCoord(coords[1], coords[2], coords[3]))
    local hash = GetStreetNameFromHashKey(location)
    return Config.LocationText .. ' ' .. hash
end

Could you try replacing the location() function with this and testing it? I don't currently have a FiveM server set up and I don't even have the game installed too

Deathdomain commented 11 months ago

function location()

that would be where? server or client?

boofiboi commented 11 months ago

Also,

Does the script always output Spanish Ave, or does it start where you are but not update? Because if so, I can fix this right now without the game installed.

Deathdomain commented 11 months ago

Also,

Does the script always output Spanish Ave, or does it start where you are but not update? Because if so, I can fix this right now without the game installed.

spanish 24/7

boofiboi commented 11 months ago

function location()

that would be where? server or client?

client.lua line 57

Deathdomain commented 11 months ago

function location()

that would be where? server or client?

client.lua line 57

restarting now and testing

Deathdomain commented 11 months ago

image

boofiboi commented 11 months ago

Any errors on the client side in the console?

Deathdomain commented 11 months ago

Any errors on the client side in the console?

no errors in F8 or in my console for VPN or TxAdmin

boofiboi commented 11 months ago

Any errors on the client side in the console?

no errors in F8 or in my console for VPN or TxAdmin

Any errors on the client side console? (F8 in game)

Deathdomain commented 11 months ago

Any errors on the client side in the console?

no errors in F8 or in my console for VPN or TxAdmin

Any errors on the client side console? (F8 in game)

No Errors in F8

boofiboi commented 11 months ago

Hmmm, try replacing the function with this:

function location()
    local coords = GetEntityCoords(ped)
    local streethash = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
    local streetname = GetStreetNameFromHashKey(streethash)
    return Config.LocationText .. ' ' .. streetname
end
Deathdomain commented 11 months ago

Hmmm, try replacing the function with this:

function location()
    local coords = GetEntityCoords(ped)
    local streethash = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
    local streetname = GetStreetNameFromHashKey(streethash)
    return Config.LocationText .. ' ' .. streetname
end

image

image

boofiboi commented 11 months ago

Change GetStreetNameAtCoord(coords.x, coords.y, coords.z) to GetStreetNameAtCoord(coords)

I genuinely have 0 clue right now how the coords works and how to parse them. I haven't used LUA in almost half a year.

Deathdomain commented 11 months ago

damn, might need to find another one huh?

boofiboi commented 11 months ago

I'll get around to installing it again and trying this out. Tommorow ill check back for more here.

Deathdomain commented 11 months ago

damn alright, ill revert back to the base one so my stuff shows up for now, might look for another and come back tomorrow for the fix :)

boofiboi commented 11 months ago

damn alright, ill revert back to the base one so my stuff shows up for now, might look for another and come back tomorrow for the fix :)

You could also try suggesting any new presets, im bone dry on ideas.

Deathdomain commented 11 months ago

i just wanted the Street name and Number of players in the city showing so the preset you had i was really vibing for :D

Deathdomain commented 11 months ago

damn alright, ill revert back to the base one so my stuff shows up for now, might look for another and come back tomorrow for the fix :)

You could also try suggesting any new presets, im bone dry on ideas.

anything yet?

boofiboi commented 11 months ago

I'm still working on it, seems im either using the natives wrong, or im doing smth else wrong.

boofiboi commented 11 months ago

Pushed a fix here

It does indeed turn out i am an idiot. It was a single word that was wrong.

Just replace the client.lua, everything else is the same for now.

boofiboi commented 11 months ago

I've reopened the issue, as I found a separate bug that correlates to this one. Also, still open for discussion if it still doesn't work.

boofiboi commented 11 months ago

It was a local issue and i forgot to close this one, im dumb.