[Free][Release] AngelicXS' - Medical Diseases / Illnesses

thanks ill try

Fire script for sure! Is there a way multiple drugs can cure the listed symptoms as well?

Sure just add more items.

The server sided event to trigger is as follows:

TriggerEvent('angelicxs-MedicalDiseases:CureDisease',source, 'disease')

relapse ‘disease’ with any of the following:

'all' - cures all diseases
'coughing' - cures coughing
'vomiting' - cures vomiting
'dizzy' - cures dizziness

server.lua issue:
so line 44, 50 and 56 all say this :
TriggerEvent(‘angelicxs-MedicalDiseases:CureDisease’,source, ‘coughing’)
so line 50 and 56 should be changed to these:
line 50 TriggerEvent(‘angelicxs-MedicalDiseases:CureDisease’,source, ‘vomiting’)
line 56 TriggerEvent(‘angelicxs-MedicalDiseases:CureDisease’,source, ‘dizzy’)

this one caused major errors for me unfortunately… so these are how it worked for me
– --illness
[‘coughmedicine’] = {[‘name’] = ‘coughmedicine’, [‘label’] = ‘Cough Medicine’, [‘weight’] = 500, [‘type’] = ‘item’, [‘image’] = ‘coughmedicine.png’, [‘unique’] = false, [‘useable’] = true, [‘shouldClose’] = true, [‘combinable’] = nil, [‘description’] = ‘Cough Medicine’},
[‘nasuamedicine’] = {[‘name’] = ‘nasuamedicine’, [‘label’] = ‘Nausea Medicine’, [‘weight’] = 200, [‘type’] = ‘item’, [‘image’] = ‘nasuamedicine.png’, [‘unique’] = false, [‘useable’] = true, [‘shouldClose’] = true, [‘combinable’] = nil, [‘description’] = ‘Nausea Medicine’},
[‘gingermedicine’] = {[‘name’] = ‘gingermedicine’, [‘label’] = ‘Ginger Medicine’, [‘weight’] = 500, [‘type’] = ‘item’, [‘image’] = ‘gingermedicine.png’, [‘unique’] = false, [‘useable’] = true, [‘shouldClose’] = true, [‘combinable’] = nil, [‘description’] = ‘Ginger Medicine’},

No Error…the illness effect is some seconds and no notification if i try to use the item
and i cant use any of the 3 items to cure

Please ensure you are using the newest version (fxmanifest will say V1.1.2) that should fix some of the issues you are having.

also make sure you change this setting to allow the items instead of the command
Config.RegisterCommand = false – True Allows a /command to cure all diseases instead of items

Yes, good catch. I also saw that I forgot to update the disease triggers earlier and it was fixed when I released V1.1.2

had a small typeo on first item.
when i copy and pasted here , it filled the spaces with lines so my bad if it caused any issues.

Anyway to impliment a clothing item (mask) to prevent sickness?

Sure, just add your relevant code check at line at about line 81 at the ( if getSick == 1 and not isSick then ) check.

Ive never coded to check for a clothing item in qb , if you get any free time , can you shoot me a snippet to test

After this line

local getSick = math.random(1,2)

put this:

local mask = 123 -- MASK NUMBER    
local ped = PlayerPedId()
local draw = GetPedDrawableVariation(ped, 1)
if draw == mask then getSick = 2 end
2 Likes

havent tried this yet , but thats cause some players been getting some negative effects.

upon taking pill while sick i witnessed player walking around by itself without player input.
also had another player get stuck in place while taking a pill.

i turned off script both times and it resolved the issues. not sure what it is tho.

I made some adjustments to the ResetSickness function. I recommend downloading the new client file and see if that resolves some of the issues you were seeing.

1 Like

How to export vomiting into a usable item

Here is a picture where i would want to export it
image

Add this to the client of the medical illness script.

RegisterNetEvent('angelicxs-MedicalDiseases:ItemVomit', function()
    sickType = 'vomiting'
    isSick = true
    while isSick and sickType == 'vomiting' do
        local sleep = math.random(30, 90)
        local ped = PlayerPedId()
        local health = GetEntityHealth(ped)
        local dict = 'oddjobs@taxi@tie'
        local anim = 'vomit_outside'
        AnimDictLoader(dict)
        AnimpostfxPlay('SwitchHUDIn', 3000, false)
        TaskPlayAnim(ped, dict, anim, 8.0, 8.0, -1, 50, 0, false, false, false)
        if health > 120 then
            SetEntityHealth(ped, math.floor(health-10))
        end
        Wait(8000)
        AnimpostfxStop('SwitchHUDIn')
        RemoveAnimDict(dict)
        ClearPedTasks(ped)
        Wait(sleep*1000)
    end
end)

And then you would add this to your item
TriggerClientEvent(‘angelicxs-MedicalDiseases:ItemVomit’,source)

I did that and now it shows this


And here is the item
image
Thanks for helping!

wait nevermind i just realized i was supposed to put thes ’ instead. Thanks it work now!

Can we make the disease affected by the weather?
For example, walking in the rain without an umbrella will get you sick, or if you stay outside in the snow for a long time, you can catch a cough.

Most likely, just run a weather dependent loop that calls the diseases as applicable.