[Help] GPS when spawn for the first time

Hi, I would like that when spawn for the first time on the server we do not have GPS and we can buy one, I would like to know how I can do.

Thank you

You can code it yourself using these functions, you’ll just have to link it to some sort of economy resource/database to keep track of who’s got a “gps”/radar:

HideHudComponentThisFrame()
ShowHudComponentThisFrame()

Sorry but I did not quite understand

You want a resource that disables your radar until you’ve purchased one right? Code it yourself, I’ve given the two lines that you’l need to hide the radar and the hud components list.

Yes but the two lines I put them or? And then how to make an item so that enssuite her put me the radar?

I don’t understand a single thing you’re trying to say.

I try to say, or I can put the two lines you gave me

Still don’t get what you’re saying.

You gave me two lines of code:

HideHudComponentThisFrame ()
ShowHudComponentThisFrame ()

I would like to know where to place them

Make a client resource file and put the HideHudComponentThisFrame() in there. then add the event handler (for when they buy a radar) and use the ShowHudComponentThisFrame()

Ok but I put it or its HideHudComponentThisFrame () in which file

put that in a client script

Ok but what? There is not a function to create there is nothing?

uhm no? I m not sure what you mean

I do not understand where to put the code give me the location where I have to put the code because I do not understand

Like I said, make it yourself. I won’t make it. I gave you some tips, now google on how to make a fivem script and you’ll understand where to put the things I’ve given already.

If you don’t know how coding works, you shouldn’t be trying to work with it until you gain more knowledge. You were given the two methods in order to help you read up on how they work. You do not simply cut and paste the code into a file. You, yourself must create the function.

You were literally given the documentation on the methods.

In your db, you shloud create a column in users named “hasGPS”. You can easily create a system for buy a gps.
Then, you can get the value in the db when the user connect to your server.
juste have something like that: (use es:playerLoaded for starrt your sql query).
When you have your informations (If the player have gps or not),

if PlayerHasGPS then
    ShowHudComponentThisFrame ()
else
    HideHudComponentThisFrame ()
end

Ok, I created my column in my DB then the code you gave me I put it in any file? Example: essentialmode?

Use this