[Release] SmartTester - Breathalyser, Drugalyser, Custom Sounds, Animation & Customisable

SmartTester - London Studios

SmartObservations is a FiveM resource coded in C# enhancing the roadside testing experience. The resource includes a customisable Breathalyser and Drugalyser including realistic sounds, the ability to fail to provide a specimen and a delay before you receive the drug result. All of which can be customised in the config.ini The plugin also extends your arm in-game when you are taking a sample.

View a demonstration video here.

This plugin is made by LondonStudios, we have created a variety of releases including TaserFramework, SearchHandler, ActivateAlarm and more!

SmartTester

Usage

/breathalyse [PlayerId] - Takes a sample of breath from another player.
/drugalyse [PlayerId] - Takes a saliva sample from another player.
/setbreath [result] - If you are being breathalysed, you’ll be prompted in chat to use this command.
/setdrug [Cannabis (true/false) Cocaine (true/false)] - If you are being drugalysed, you’ll be prompted in chat to use this command. eg, /setdrug true true
/failprovide - If you are being sampled, this will fail to provide and the officer will be notified.

After drugalysing someone, the default value in the config is set to 90 seconds, meaning the plugin will wait this duration before releasing the result to you.

Installation

Download the resource from GitHub here.

  1. Create a new resource folder on your server.
  2. Add the contents of “resource” inside it. This includes:
    “Client.net.dll”, “Server.net.dll”, “fxmanifest.lua”, “SharpConfig.dll”, “html”.
  3. In server.cfg, “ensure” SmartTester, to make it load with your server startup.

Configuration

The plugin is customisable in terms of the units and the drugs tested by the drugalyser. Please open the config.ini file to make edits.

[SmartTesting]
# Breathalyser
breathalyserUnit = µg/100ml
breathalyserLimit = 35

# Drugalyser
drugalyserDrug1 = Cannabis
drugalyserDrug2 = Cocaine
drugalyserDelay = 90 #seconds

For example, if you want to remove the delay, change 90 to 0. You can change the breathalyser Unit or limit above, they are currently set to the UK limits and unit. You can also change the drug names it detects for.

Source Code

Please find the source code in the “src” folder. Please ensure you follow the licence in “LICENCE.md”.

Feedback

We appreciate feedback, bugs and suggestions related to SmartTester and future plugins. We hope you enjoy using the resource and look forward to hearing from people!

8 Likes

Good evening how use your src folder

Very nice, you keep spitting out more an more things that are just awesome :slight_smile: keep up the great work

Hi,

The source code is there to be modified by developers, please respect and follow the LICENCE.md when doing so.

We do not provide assistance modifying the source code.

Best wishes,
London Studios.

Hi,

Thank you for your comments.

We are glad you enjoy using our plugins.

Best wishes,
London Studios.

I have the same thoughts for this as I did with the observation script. Have the prompt state what the max value is for the legal limit and also what level would be fatal. I see this is in ug/100ml so I don’t know the values (we use % here and 0.08% starts where you are in violation of the law for driving so my example is using that since I don’t know the measuring system you use. But with %, the prompt would be something like “0.00 to 0.07=Legal | 0.08 to 0.39=drunk | 0.40+ = Fatal”

Also, I’d recommend instead of true/false for the drugs, prompt them to say yes or no if the drugs are in their system.

I love this script though and will be implementing it immediately!

Hi,

Thanks for your comments. I am not quite sure what you are actually suggesting with this feature, we currently have a config.ini which allows you to modify some of the values.

You should be able to interpret the value given to know if it is “Legal, drunk or fatal” in your recording system, however this has been requested and I am happy to implement this if you could specify how it would work.

I think you mean - an option to enable via the config which will then tell you which category the breathalyser results return fits in. I can also change the drugalyser to “yes/no” but honestly I believe “true/false” works fine and I see nothing wrong with it, however if there is a way to make it better I will.

Best wishes,
London Studios.

I think what he means is switching the “ml” option to BAC %.

In the U.S. the unit of measurements used for someones Blood Alcohol Content is percentage. The legal limit in most U.S. states is 0.08%.

Personally, I second having this as an option if that’s what he is suggesting.
More of the “less experienced” roleplayers (and for that matter some more experienced too) will find that way of reading it more comprehendable and simplified as that’s what most FiveM servers go by.

Also, I’d just like to say thank you for all the content you’ve been coming out with. It’s all very simple scripts that are very essential. They all (I’m using each one of them) work flawlessy!

Hi,

Thank you for the feedback. There is nothing stopping him changing it from “ml” to “%”, I have provided a config.ini file for a reason, you have the ability to change the breathalyser units used and also the alcohol limit.

Furthermore, the option you are referring to is something I will look into.

Thank you for your comments regarding our releases, I am glad you like them.

Best wishes,
London Studios.

I’m sorry, let me clarify a little. What I was referring to is when they go to set their BAC and start typing the command, they are given the prompt/guide text. Have that text give them sample values for those who want to be “drunk” but don’t know what value would indicated drunk or someone who wants to have had a drink so they have some alcohol but not enough to be drunk.

OK I am a little confused here by this script. If as an officer I can set the limits for BAL or for the drug then I could simply fail every person who is detained or arrested. Is there a way to shut that off so it cant be used in that matter?

Ok thank you
the files must be compiled in DLL?

Hi,

Unfortunately a prompt feature is not something I would add as default, however I am happy to add it and then allow it to be enabled in the config file.

This is something I will look into.

Best wishes,
London Studios.

Hi,

I am not sure what you mean by your question, if you could please clarify it.

I am not sure why you think officers can choose the breathalyser limit?
Nowhere in the plugin have I provided that ability except for the config.ini file, which applies for all players.

Best wishes,
London Studios

Hi,

If you wish to modify the source code you would need to recompile this to a “dll” file.

Best wishes,
London Studios

ok but one last which file belongs to the client and the other to the server because I only want to modify the MAIN

Hi,

The “Main.cs” file belongs to the Client

Best wishes,
London Studios

Could i suggest checking for closest Playerped instead of entering an id to make it more RP friendly <3 love the script

Hi,

Please clarify your comment.

Best wishes,
London Studios

SmartTester - Update

Now able to use /breathalyse and /drugalyse without specifying a player ID. This will now breathalyse or drugalyse the nearest player to you.

No more /breathalyse [Player ID], and now just /breathalyse.

Chat suggestions have also been updated to echo this change.

Please download the update from GitHub.