[ESX] GPS item (hidden / shown)

So is this running in a loop ?
Because i use esx_kashacters and they have a DisplayRadar(false) on start.

This is because you did not picked a char yet to play with.
As soon as a land on the ground with the car i picked it doesnt show my Radar even when i have it in my inventory.

Can anybody help ?

Only thing I could was keep drop it and pick it up

is this why when a user logs in they have a map? but if they have a gps and lose it this works fine.

Hey @renaiku is there anyway to make the gps an usable item instead of detecting if the player has one gps? it would make him use the gps to show the minimap and if he used the item again it would go off, is there anyway to make this? If so, would you be able to help me? xD

thanks for your time!

1 Like

IDK much about coding, but i managed to make it a usable item to show the map instead of dropping it just add these in the corresponding scripts. (next to figure out how to make it usable again to remove the radar) Edit: am thinking an if statement of some sort

server\main.lua

ESX.RegisterUsableItem(‘gps’, function(source)
local _source = source
TriggerClientEvent(‘gps:showradar’, _source)
end)

client\main.lua

RegisterNetEvent(‘gps:showradar’)
AddEventHandler(‘gps:showradar’, function()
DisplayRadar(true)
end)

4 Likes

Hey @Ownage_Galore , thanks for your help sir!

That part i already had i’m missing the part where you can use it again and it will go off any idea?:thinking:

@David_Carneiro im currently trying to figure this out, i have barely 6 months experience in this but am doing pretty darn good at learning it XD

2 Likes

We could use a variable for whrn its on the variable its true then for exemple

If showmap == true then
    Displayradar(false)
Elseif...

You dont see left down gps, also buy gps in shop

I don’t have gps when i join my server i have gps when i give to me gps then drop it it deapers!

It doeesn’t do anything for me. I need help. Radar still shows up even without gps

Do you have Vmenu?

Hmm it doesnt seem to work for me either. COmpletelyt removed V menu and everything. Any updates?

Don’t work to me too, any working gps script?

maybe anyone hawe working this script?

I Wanted that the Blip is dissapearing , if ur distance to the GPS is too far. Like you lost the signal if u reached a specifical distance. How can i code this

startAnim(“amb@prop_human_bum_bin@idle_a”,“idle_a”)
Citizen.Wait(2000)
ClearPedTasks(PlayerPedId())
TriggerServerEvent(‘esx_cichygps:zabierz’)
ESX.ShowNotification(’~g~Das GPS wurde angebracht. ~y~Die Verbindung wird aufgebaut…’)
Citizen.Wait(2000)
SetEntityAsMissionEntity(vehicle)
local oznaczenie = AddBlipForEntity(vehicle)
SetBlipSprite(oznaczenie, 458)
SetBlipColour(oznaczenie, 1)
BeginTextCommandSetBlipName(“STRING”)
AddTextComponentString(‘GPS Signal’)
EndTextCommandSetBlipName(oznaczenie)
PlaySoundFrontend(-1, ‘BACK’, ‘HUD_AMMO_SHOP_SOUNDSET’, false)
ESX.ShowNotification(’~g~Das GPS Signal wurde aufgebaut. Es hält jetzt für ~y~5 Minuten’)
Citizen.Wait(300000)
RemoveBlip(oznaczenie)
else
ESX.ShowHelpNotification(‘Kein Fahrzeug in der Nähe’)
end
end)

I have a problem with the gps that comes out of this in the console and I don’t know how to fix it, someone who gives me a hand thanks

Its not working with legacy if still suport available i am using chezza’s inventory the server side function onAddinventoryitem is not working don’t know why if someone can help

how did u dot it please tell me