SIMPLE VEHICLE SEARCH SCRIPT FOR FIVEM ROLEPLAY SERVERS.
This script is for FXServers ONLY.
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.
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?
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?
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!