Hello everyone! Today I am releasing another free script, which is WX Hospital! This is a simple OX based script with NPC doctor. He can heal you or sell medicals (bandages and medikit). The script is as always open source and contains simple config where you can customize almost everything!
Doesn’t work I have to restart the script while players are nearby to actually see the doctor, and when they press regsiter they do all the animaions and it “revives” them kinda but they still have the distress call thing in front of them.
Great idea, I just need to remove the functionality for buying supplies and paying for healing as we don’t use inventory/money on our server. That aside, I popped open the github and gotta ask, what is going on with your fxmanifest? Why are you loading the configs multiple times? You have the client_scripts loading configs/*.lua which is loading the config and webhook config, you have the server_scripts loading the webhook config again, and then you have shared_scripts loading the config and webhook config again??? Also, don’t handle webhooks on the client side, they are extremely exploitable if you do that! Webhooks should be handled server side only and if the config_hospital needs to be done on both, just list it under the shared scripts.
Also, another idea to consider, instead of just having a default configged amount of time for them to be in the bed, you could get their current health and subtract that from a full health of 200 then multiply that result by 500 or 1000 or whatever you want to get a duration of time to heal for. This way the more injured they are, the longer it takes to heal.
hey, thanks for the suggestions, I don’t have much time right now for my free resources but if you’d like you can create the PR. about the manifest, iirc I copied some other resource’s folder when I was making the resource lmao
Citizen.CreateThread(function ()
for k,v in pairs(wx.Peds) do
RequestModel(v.Model)
while not HasModelLoaded(v.Model) do
Wait(500)
end
doctor = CreatePed(0,v.Model,v.Coords.x-0.21,v.Coords.y,v.Coords.z-1,v.Heading,false,true)
FreezeEntityPosition(doctor, true)
SetEntityInvincible(doctor,true)
SetBlockingOfNonTemporaryEvents(doctor,true)
TaskStartScenarioInPlace(doctor,'PROP_HUMAN_BUM_SHOPPING_CART',0,true)
local options = {
{
name = 'wx_hospital:register',
event = 'wx_hospital:job',
distance = wx.MinDistance,
icon = 'fa-solid fa-briefcase-medical',
label = wx.Lang.TargetRegister,
},
}
exports.ox_target:addModel(v.Model, options)
end
end)
Citizen.CreateThread(function ()
for k,v in pairs(wx.Peds) do
RequestModel(v.Model)
while not HasModelLoaded(v.Model) do
Wait(500)
end
doctor = CreatePed(0,v.Model,v.Coords.x-0.21,v.Coords.y,v.Coords.z-1,v.Heading,false,true)
FreezeEntityPosition(doctor, true)
SetEntityInvincible(doctor,true)
SetBlockingOfNonTemporaryEvents(doctor,true)
TaskStartScenarioInPlace(doctor,'PROP_HUMAN_BUM_SHOPPING_CART',0,true)
local options = {
{
name = 'wx_hospital:register',
event = 'wx_hospital:job',
distance = wx.MinDistance,
icon = 'fa-solid fa-briefcase-medical',
label = wx.Lang.TargetRegister,
},
}
exports.ox_target:addModel(v.Model, options)
end
end)
¿Cómo podría configurar para que los que presionen en revivir se hagan spawn en otra cama que no este desocupada?
How could I configure so that those who press revive spawn in another bed that is not unoccupied?