[Release][FX] Simple Vehicle Search (v2.0)

SIMPLE VEHICLE SEARCH SCRIPT FOR FIVEM ROLEPLAY SERVERS.

:bangbang: This script is for FXServers ONLY. :bangbang:

I wasn’t planning on releasing this as it’s quite simple to do but I figured I’d return to the favor to the community.
This script is exactly how it sounds, simply search the target vehicle and roleplay it out. The code is not the best, by far. I’m still learning and it’s all basically trial and error for me. This does indeed work and I have tested it on 2 servers by multiple people. No issues were reported.

Version:

  • Version 1.0
  • Fixed an issue allowing the player to search their own vehicle.


  • Version 2.0
  • Ability to set vehicle inventory (to a player ID, not vehicle YET)

To update from v1 simply copy-paste client.lua and server.lua and overwrite the existing files.


What to expect in version 2.1?

  • Inventory saving

Features:

  • Search any target vehicle that isn’t your own. ( the vehicle you were in last )
  • Doors open simultaneously.
  • Features are synchronized for all players.
  • Set vehicle inventories according to playerId’s.

Installation:

  • (1) Place simple_vehsearch folder inside your servers resources folder.
  • (2) Add -start simple_vehsearch to your AutoStartResources in your server.cfg file.

Usage:

  • /search to begin and /search to end.
  • /searchcar [id] (must be set by player) Version 2 only
  • /setinv (sets players vehicle inventory) Version 2 only
  • /resetinv (clears inventory) Version 2 only

Credits:
@asser90 - used the tow script as a guideline

  • Current bug: Looking away from vehicle doesn’t trigger doors to open.

Please if you find any bugs or have suggestions on what I can do to improve this, DO NOT post on this thread… just private message me.


Downloads:
simple_vehsearch.zip (2.2 KB) Version 1.0
simple_vehsearch v2.zip (2.6 KB) Version 2.0

6 Likes

is this simply a search emote or can you find things in it?

Right now it’s just an animation, text chat, and opening/closing doors. I’m going to be working on players being able to add things to the vehicle.

2 Likes

Update: players are now able to set vehicle inventories through their ID’s. It is not linked to the actual vehicle yet but I am working on it.

To update from v1 simply copy-paste client.lua and server.lua and overwrite the existing files.

Cheers.

is this for lamdba menu servers?

Great script. Anyway you can also make it so it randomly puts items on player ID and generates new items after each search so they don’t always have the same items?

Can be if you want it to be.

It can be done but your then forcing the player to have items they don’t want to RP with. This lets them manually add them. They can reset the inventories after each RP

Right, but there are players who steal cars or borrow a friends car and sometimes they wouldn’t know what would be in the car. Kinda like you see on some cop shows. Maybe have both in the script? They can still add their own inventory and have a random chance of something else showing up?

Will be nice if you can add in a random cars food/weapons/money like in a survival game.

Maybe in a later date, but not my plans right now.

Post has been removed by author.

And can you tell me how to make this commands only for police officer to have permission to use it

Could you not adjust it to the PoliceJob? it would be awesome cause I think its something that Policeman should do. (if you would do it, then please under the F6 Menu). Anyways good release and keep it up! :+1: