2024-12-16 03:53:59 -08:00
|
|
|
|
|
|
|
|
|
2025-07-01 03:09:46 -07:00
|
|
|
ps.registerCallback('md-drugs:client:consumedrugs', function(time, effect, anim, progresstext, status, item)
|
2024-07-09 17:07:20 -07:00
|
|
|
if not progressbar(progresstext .. GetLabel(item).. "!", time, anim ) then return end
|
2024-10-01 16:09:49 -07:00
|
|
|
for k, v in pairs (status) do
|
|
|
|
|
if k == 'health' then
|
|
|
|
|
local cur = GetEntityHealth(PlayerPedId())
|
|
|
|
|
SetEntityHealth(PlayerPedId(), cur + v)
|
|
|
|
|
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
|
|
|
|
|
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
|
|
|
|
|
elseif k == "armor" then
|
|
|
|
|
TriggerServerEvent('hospital:server:SetArmor', v)
|
|
|
|
|
TriggerServerEvent('consumables:server:useArmor')
|
2024-10-02 11:49:59 -07:00
|
|
|
SetPedArmour(PlayerPedId(), v)
|
2024-10-01 16:09:49 -07:00
|
|
|
elseif k == 'speed' then
|
|
|
|
|
TriggerEvent('md-drugs:client:recievebuff', k, v)
|
|
|
|
|
elseif k == 'strength' then
|
|
|
|
|
TriggerEvent('md-drugs:client:recievebuff', k, v)
|
|
|
|
|
end
|
2024-05-02 18:34:14 -07:00
|
|
|
end
|
2024-12-16 03:53:59 -08:00
|
|
|
TriggerEvent('evidence:client:SetStatus', 'widepupils', 200)
|
|
|
|
|
TriggerEvent('md-drugs:client:applyFeeling', effect)
|
|
|
|
|
return true
|
2024-01-13 22:23:17 -08:00
|
|
|
end)
|
|
|
|
|
|
2024-10-01 16:09:49 -07:00
|
|
|
RegisterNetEvent('md-drugs:client:recievebuff', function(type, amount)
|
2024-11-25 19:57:26 -08:00
|
|
|
if type == 'speed' then
|
|
|
|
|
local count = 0
|
|
|
|
|
SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.49)
|
|
|
|
|
repeat
|
|
|
|
|
count = count + 1
|
|
|
|
|
Wait(1000)
|
|
|
|
|
until count == amount
|
|
|
|
|
SetRunSprintMultiplierForPlayer(PlayerPedId(), 1.00)
|
|
|
|
|
end
|
|
|
|
|
if type == 'strength' then
|
|
|
|
|
local strength = 0
|
|
|
|
|
SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
|
|
|
|
|
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0)
|
|
|
|
|
repeat
|
|
|
|
|
strength = strength + 1
|
|
|
|
|
Wait(1000)
|
|
|
|
|
until strength == amount
|
|
|
|
|
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 1.0)
|
|
|
|
|
end
|
2024-10-02 11:49:59 -07:00
|
|
|
end)
|
2024-12-16 03:53:59 -08:00
|
|
|
|
|
|
|
|
RegisterNetEvent('md-drugs:client:applyFeeling', function(effect)
|
|
|
|
|
if effect == "alien" then
|
|
|
|
|
AlienEffect()
|
|
|
|
|
elseif effect == "ecstacy" then
|
|
|
|
|
EcstasyEffect()
|
|
|
|
|
elseif effect == "meth" then
|
|
|
|
|
MethBagEffect()
|
|
|
|
|
elseif effect == "coke" then
|
|
|
|
|
CokeBaggyEffect()
|
|
|
|
|
elseif effect == "trevor" then
|
|
|
|
|
TrevorEffect()
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
end)
|