Files

145 lines
4.7 KiB
Lua
Raw Permalink Normal View History

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)
2025-09-05 21:28:04 -07:00
if not ps.progressbar(progresstext .. ps.getLabel(item).. "!", time, anim ) then return end
2025-08-09 03:10:00 -06:00
for k, v in pairs (status) do
2024-10-01 16:09:49 -07:00
if k == 'health' then
local cur = GetEntityHealth(PlayerPedId())
SetEntityHealth(PlayerPedId(), cur + v)
2025-09-05 21:28:04 -07:00
elseif k == 'thirst' or k == 'stress' or k == 'hunger' then
TriggerServerEvent('md-drugs:server:updatestatus', k, v)
2024-10-01 16:09:49 -07:00
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
2025-09-05 21:28:04 -07:00
if type == 'strength' then
2024-11-25 19:57:26 -08:00
local strength = 0
SetCurrentPedWeapon(PlayerPedId(), 'weapon_unarmed', true)
SetWeaponDamageModifier(GetHashKey("WEAPON_UNARMED"), 50.0)
repeat
strength = strength + 1
2025-09-05 21:28:04 -07:00
Wait(1000)
2024-11-25 19:57:26 -08:00
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
2025-09-05 21:28:04 -07:00
local function EcstasyEffect()
local startStamina = 50
SetFlash(0, 0, 500, 20000, 500)
while startStamina > 0 do
Wait(1000)
startStamina = startStamina - 1
RestorePlayerStamina(PlayerId(), 1.0)
if math.random(1, 100) < 51 then
SetFlash(0, 0, 500, 7000, 500)
ShakeGameplayCam('SMALL_EXPLOSION_SHAKE', 0.08)
end
end
if IsPedRunning(PlayerPedId()) then
SetPedToRagdoll(PlayerPedId(), math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
end
startStamina = 0
end
local function TrevorEffect()
StartScreenEffect("DrugsTrevorClownsFightIn", 3.0, 0)
Wait(3000)
StartScreenEffect("DrugsTrevorClownsFight", 3.0, 0)
Wait(3000)
StartScreenEffect("DrugsTrevorClownsFightOut", 3.0, 0)
StopScreenEffect("DrugsTrevorClownsFight")
StopScreenEffect("DrugsTrevorClownsFightIn")
StopScreenEffect("DrugsTrevorClownsFightOut")
end
local function MethBagEffect()
local startStamina = 30
TrevorEffect()
SetRunSprintMultiplierForPlayer(PlayerId(), 1.49)
while startStamina > 0 do
Wait(1000)
if math.random(5, 100) < 10 then
RestorePlayerStamina(PlayerId(), 1.0)
end
startStamina = startStamina - 1
if math.random(5, 100) < 51 then
TrevorEffect()
end
end
startStamina = 0
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
end
local function AlienEffect()
StartScreenEffect("DrugsMichaelAliensFightIn", 3.0, 0)
Wait(math.random(5000, 8000))
StartScreenEffect("DrugsMichaelAliensFight", 3.0, 0)
Wait(math.random(5000, 8000))
StartScreenEffect("DrugsMichaelAliensFightOut", 3.0, 0)
StopScreenEffect("DrugsMichaelAliensFightIn")
StopScreenEffect("DrugsMichaelAliensFight")
StopScreenEffect("DrugsMichaelAliensFightOut")
end
local function CokeBaggyEffect()
local startStamina = 20
local ped = PlayerPedId()
AlienEffect()
SetRunSprintMultiplierForPlayer(PlayerId(), 1.1)
while startStamina > 0 do
Wait(1000)
if math.random(1, 100) < 20 then
RestorePlayerStamina(PlayerId(), 1.0)
end
startStamina = startStamina - 1
if math.random(1, 100) < 10 and IsPedRunning(ped) then
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
end
if math.random(1, 300) < 10 then
AlienEffect()
Wait(math.random(3000, 6000))
end
end
if IsPedRunning(ped) then
SetPedToRagdoll(ped, math.random(1000, 3000), math.random(1000, 3000), 3, 0, 0, 0)
end
startStamina = 0
SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
end
2024-12-16 03:53:59 -08:00
RegisterNetEvent('md-drugs:client:applyFeeling', function(effect)
2025-09-05 21:28:04 -07:00
if effect == "alien" then
AlienEffect()
2024-12-16 03:53:59 -08:00
elseif effect == "ecstacy" then
EcstasyEffect()
2025-09-05 21:28:04 -07:00
elseif effect == "meth" then
MethBagEffect()
elseif effect == "coke" then
CokeBaggyEffect()
elseif effect == "trevor" then
TrevorEffect()
2024-12-16 03:53:59 -08:00
end
end)