[Release] free Simple AI doctor

This script is more advanced looking at config. Feel free to do any changes you want! Let me know if you would like to see more features in the future!

In case of any questions I will be more than happy to answer! I’ll leave my discord below

rocket5115#7304

Features:
-Translations: en, pl. In future maybe more!
-Easy and configurable Config!;
-revive and heal payments separated!;
-3 types of coordinates separated from each other!;
-ActiveEMS count system!;
-revive chance(I will be updating it soon);
-four drug effects!;
-Configurable drug effect time!;
-Ped spawn!
-Configurable Hunger and thirst restore!
-mythic notify and pNotify support!
-Multiple locations can be added!

Script: rocket5115/simple-doctor-AI: simple doctor AI that’s free (github.com)

Dependencies:

es_extended

mythic_notify or pNotify

esx_ambulancejob

Optional:

motiontext

esx_status

And that’s all! I hope some people can tell me how I can improve it!

You have everything in config.lua. Well… almost everything. text and other stuff you can change easily in client/main.lua. If you find any bugs let me know! Thanks!

And also its using esx_ambulancejob from esx_framework(sorry :frowning: ) but you can change coordinates in config.lua so good luck.

Updates:

Update 1.0
-Fixed EMS counting system
-Added Config.ActiveEMS and Config.EMSinService with thread. Its refreshing every once in a while.
Update 1.1
-Added chance system which isn’t perfect nor good. It still needs some work.
Update 1.2
-Added Drug effect after getting healed/revived. It doesn’t have dependency because its in main.lua
-Four type of drug effects
Update 1.3
-Fixed multiple spawning peds in the same place, after restart of resource.(this is still not working 100%)
-Added Hunger and thirst restore which you can configure in config.lua
-Added mythic_notify and pNotify support. I will add more like taskbar or just simple esx(no dependency then)
-Added translations: pl and en. Maybe more in future.
Update 1.4
-Fixed multiple peds spawning after player connects
Update 1.5
-Added EnableControl so in case of something this may enable control you want to use if its disabled. I’m not sure if it will override any script.
-Added Config for Control that activates healing
-Removed dependency for motiontext. If someone wants you can turn off usemotiontext and it will not crash server or script!
Update 1.6
-Changed config layout
-Added Multiple possible locations of peds, text and interactions. Also I added howtoaddped.txt on github. Hope It helps some of you.
-Added little more configs.
-Changed little bit of client/main.lua ^^

TODO:

-Add more configs.

My other work:
[Release]esx_autorepairshop - FiveM Resource Development & Modding / Releases - Cfx.re Community

8 Likes

Thoes the AI sometimes mess up and just stand near but do nothing? I wonder since I’ve a AI doctor already but it’s like 60% chance he actually revive u :wink:

I added a EMS check for that. It is just normal job check. But u want like a citizen thread for it? So it checks once in a while? Since if someone as EMS join and then change job, it still thinks it’s an EMS online if you don’t do a citizen thread. :slight_smile:

Do you mean that he just stands and do nothing? (my script ofcourse) If I understand correctly. No he doesn’t. Ped is not responsible for actually reviving you! He is just standing there waiting for nothing. Vdist2 is config.interactcoords between you and and interactcoords. and config.Distance just checks if you are too far away.

And about this citizen thread. Well I will try. The problem is. The script is mostly on client side which technically means that if I do EMS count I will have to triggerclientevent from server side so that client side knows what it has to do. But then it just randomly says that native 0x2F7A49E6 could not process or something like that. Probably because I try to do it other way around. EMS counting system is not actually that important for now because first I have to find a way to block usage of doctor first without blocking all controls :grinning_face_with_smiling_eyes:

Does this scrpit really need the “motiontext” and “mythic_notify”

I mean. You can modify it if you want. Its better to have them otherwise if you try to use it, it will just send error that there’s no export for like DoHudText(mythic_notify) for example if you don’t have it. Feel free to do any changes you want! You have client side and server side which is not encrypted so feel free to edit it however you want. :wink:

And I will add that I tested many possibilities and sometimes it just refused to work without one of those. Motiontext maybe not but it still may cause troubles. And mythic_notify is used in sequence of tasks and sometimes it refused to work. Maybe I will try to use more like taskbar or pNotify

I cant use that when im dead at the zone WHY?

This might be due to one of your script blocking button “e” check esx_ambulancejob for “DisableControlAction(1, 46, true)” or “DisableControlAction(0)” and remove them/delete them. It should work then. :slight_smile:

I will add support for other buttons too in future. Right Now I hope I helped!

ambulancejob need press E to revive after a time.
The script can be used to heal you if you are alive, but I think it fails when you are dead, there must be some error in the execution when you are dead as it also does not do what it would do if you are alive (heal you).

@picoleto

ambulancejob need press E to revive after a time.

Yes you’re right. It needs. But at the same time it disables it. Trust me. I’ve been testing this script more than week after any update. I have also been testing many possibilities if something might go wrong. I did it and that’s why client side has 750 lines and not 500 because I Included all those possibilities.

I suggest, you will stop ignoring me and just do what I say you should! Its just very not fair for me, that I created a script that is working very well and I publicated it for free. I know some servers are using it right now and they don’t have this problem. Because they changed esx_ambulancejob!

I’m trying to help you but if you won’t listen to me then that’s not going to work. Either my help or script.

And also if you think something is not working then look if there are any errors. I know for a fact that only errors were in previous versions but they are not avaible for public.

I hope you can listen and just do as I say. Its not the script that is not working, because it reacts only if you click “E” near the zone. And if you have control disabled then that’s your fault! And also I will add that “basia:revive” also heals you when you’re alive so don’t tell me there is something wrong with execution of script if its working when you are alive.

1 Like

I wasn’t criticizing your work friend.

1 Like

Sorry, but this is what I felt. I might be too aggresive in last message too, so sorry for that.

1 Like

No problem bro, you did good work.

Trying to find a way to have multiple blips in more than one hospital. Have you tried it?
The only way i see it for now is having de same script with a different name.
Of course that means 2 more scripts using even more resources.

Script was made for single use only. I will try to add more blips and just more control over zones so you can get more zones.

Okay i’ll try to find a way and if i do will let you know!

Thanks for this amazing release and keep up the great work!

Was just wondering if you could assist me, when ever I press E I always get the below error and my character just keeps walking on the same spot.

SCRIPT ERROR: citizen:/scripting/lua/scheduler.lua957: No such export DpHudText in resource mythic_notify

I do have mythic_notify installed and working as I use it for other resources.

mythic_notify has other versions too. You could take export from other script that uses it or look inside client.lua in mythic_notify for other exports. Just change other DoHudText for The one that you have found/chosen

Or just change A Little bit mythic_notify and add export for DoHudText and add function to client.lua. should work too

1 Like

Brilliant! Thank you very much will check it out :smiley: