[FREE] mth-rc / The free ultimate RC-car resource

We have a custom animation to be unique; don’t want to copy the other phone / tablet ones…

nice work dude!

2 Likes

animdict = “anim@amb@nightclub@peds@”
anim = “anim_heists_heist_safehouse_intro_phone_couch_female”

The above anim is the same as your animation in your video but native fivem.

Ah well, doesn’t matter. I had Dark Animations make the animation specifically tailed for this script with the precise hand, finger and thumb positioning as every other script uses a phone or tablet; we’re not trying to reinvent the wheel, we’re trying to improve it and make it freely available for others.

It’s fantastic to hear that you’re working on your own script. That’s one of the wonderful aspects of FiveM and open source software - the ability to showcase your skills and contribute to the community. However, we’ll be focusing on our resources with our own unique ideas and approaches. We genuinely wish you the best of luck with your own project.

Thanks for stopping by.

V1.0.4 IS OUT !

  • Fix franklin’s voice
  • Ability to self destruct when on camera
  • Delete blip on self destruct
  • Support for qb-inventory
  • Fix modkit
  • Add short-circuit on water
  • Add recall option
  • Better Explosion

Thanks to @anon70864786 and @copofiscool for the help !

Oh nice there’s now ox_inventory support! But is there anyway i can use this as an item too? I’m just using the default ESX Legacy one, my items are in the db. I don’t have the coding knowledge to make this work for me😥

Replied but my post somehow need approval :confused: but check the readme I’m adding the instructions now

1 Like

Thank you! I’ll check it out!

1 Like
1 Like

You’d have to add the item to your database, and then to register it’s use in a server sided script :

ESX.RegisterUsableItem('cappuccino', function(source) --replace cappuccino for your id of the item which you add to the database
    local xPlayer = ESX.GetPlayerFromId(source)
    
    xPlayer.removeInventoryItem('rcbandito', 1) --this will remove the item after the use
    TriggerClientEvent('mth-rc:client:SpawnRcCar', source)
end)

Hi,

I’ve created a server.lua and linked that in the fxmanifest of your script. So there’s a server.lua within the mth-rc folder. I thought that could maybe work.

I pasted in the following code and added the rccar as an item in my database.

ESX.RegisterUsableItem('rccar', function(source) --replace cappuccino for your id of the item which you add to the database
    local xPlayer = ESX.GetPlayerFromId(source)
    
    xPlayer.removeInventoryItem('rccar', 1) --this will remove the item after the use
    TriggerClientEvent('mth-rc:client:SpawnRcCar', source)
end)

But when i start the script, i get this error.

Is it not possible to add the server.lua to your script? Any idea what i’m doing wrong maybe?

Also, i was wondering, since you’re able now to use it as item, could there be anyway to pick the rc car up without using a command? Like walking up to it and pressing E or something? And dropping the remote! Just a thought that could maybe improve it even more.

Hey, you’d have to put this script in an esx file, perhaps search for a file where there are already some ESX.RegisterUsableItem and put it here

As for the pickup, we thought about it and I might dev it one day, but it’s not getting worked on rn !

Hi, Okay thank you! Great support!

1 Like

Hi, would you have a version to use /rc with permission?
for vip plans

1 Like

That’s a nice idea. Disclaimer, i have no scripting skills whatsover, but i’m bored at work and i’m trying to understand scripting more so i’m just trying something here. I believe you gotta add an extra check at line 16 in the client.lua that checks if player is vip (1) or not (0). In my db, vip is defined a 1 or a 0 in the users table.

So it could be something like this, maybe?

if Config.UseCommand then
    RegisterCommand('rc', function(source, args)
        local player = ESX.GetPlayerFromId(source)
        local vip = ESX.GetPlayerData().vip

        if vip == 1 then
            ToggleRcCar()
        else
            TriggerClientEvent('chatMessage', source, '^1Error: ^7Only VIPS may use this command.')
        end
    end)
end
1 Like

Nice idea, he can use yours if this is how esx handles vip players, or he could use it through ace permissions using the implemented ace handler for registercommand (see RegisterCommand - FiveM Natives @ Cfx.re Docs)

I don’t really know how vip are handled but knjgh scripts looks good to me :slight_smile:

2 Likes

For me this code did not work, would you have any code for permission only for staffs (Administrators)?

@knjgh

I would like to deprive this /rc command somehow, leaving in the city free access to the command for everyone could turn into a mess

This is so cool , I can’t stop playing with it when I’m testing other stuff XD

2 Likes