-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: ems heals work and adjust healing #107
Conversation
TriggerClientEvent('inventory:client:ItemBox', player.PlayerData.source, exports.ox_inventory:Items()['firstaid'], "remove") | ||
TriggerClientEvent('hospital:client:Revive', patient.PlayerData.source) | ||
if not player or not exports.ox_inventory:RemoveItem(src, 'firstaid', 1) then return end | ||
TriggerClientEvent('qbx_medical:client:playerRevived', player.PlayerData.source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably call an server side export? Not sure that this event is intended to be public
player.Functions.RemoveItem('bandage', 1) | ||
TriggerClientEvent('inventory:client:ItemBox', src, exports.ox_inventory:Items()['bandage'], "remove") | ||
TriggerClientEvent("hospital:client:HealInjuries", patient.PlayerData.source, "full") | ||
lib.callback("qbx_medical:client:heal", patient.PlayerData.source, false, "full") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably call a server side export.
local player = exports.qbx_core:GetPlayer(source) | ||
local patient = exports.qbx_core:GetPlayer(playerId) | ||
local src = source | ||
local player = exports.qbx_core:GetPlayer(playerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
player seems to only be used to get playerId anyway, so this could be simplified further not to convert to player.
player.Functions.RemoveItem('bandage', 1) | ||
TriggerClientEvent('inventory:client:ItemBox', src, exports.ox_inventory:Items()['bandage'], "remove") | ||
TriggerClientEvent("hospital:client:HealInjuries", patient.PlayerData.source, "full") | ||
lib.callback("qbx_medical:client:heal", patient.PlayerData.source, false, "full") | ||
end) | ||
|
||
---@param playerId number | ||
RegisterNetEvent('hospital:server:RevivePlayer', function(playerId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just delete this event altogether in favor of calling qbx_medical exports directly?
setBedCam() | ||
CreateThread(function() | ||
Wait(5) | ||
if isRevive then | ||
exports.qbx_core:Notify(Lang:t('success.being_helped'), 'success') | ||
Wait(config.aiHealTimer * 1000) | ||
TriggerEvent("hospital:client:Revive") | ||
else | ||
TriggerEvent("qbx_medical:client:playerRevived") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking this should be an export. In general I don't think resource A should trigger events owned by resource B. API should be provided via exports.
@solareon update on requested changes |
@ChatDisabled out on Christmas vacation for a couple weeks. I'll work on these when I get back. If someone else would like to work on them I can port them to the main repo and let others hack on it a bit. Just let me know |
Description
Healing a player as ems didn't do anything. This corrects that issue and prevents players from getting stuck in a bed. Items are also now removed when using them. Also adjusted the amounts healed to be more reasonable.
Checklist