Her hangi bir client dosyasına
RegisterNetEvent('viber-base:dalgictupu')
AddEventHandler('viber-base:dalgictupu', function()
local playerPed = GetPlayerPed(-1)
exports['mythic_progbar']: Progress({
name = "dalgictupu",
duration = 7000,
label = 'Takıyorsun...',
useWhileDead = false,
canCancel = false,
controlDisables = {
disableMovement = false,
disableCarMovement = false,
disableMouse = false,
disableCombat = true,
},
}, function(cancelled)
if not cancelled then
local pCoords = GetEntityCoords(playerPed)
local boneIndex = GetPedBoneIndex(playerPed, 12844)
local boneIndex2 = GetPedBoneIndex(playerPed, 24818)
local mask = CreateObject(GetHashKey('p_s_scuba_mask_s'), pCoords.x, pCoords.y, pCoords.z - 3, 1, 1, 1)
local tank = CreateObject(GetHashKey('p_s_scuba_tank_s'), pCoords.x, pCoords.y, pCoords.z - 3, 1, 1, 1)
AttachEntityToEntity(tank, playerPed, boneIndex2, -0.30, -0.22, 0.0, 0.0, 90.0, 180.0, true, true, false, true, 1, true)
AttachEntityToEntity(mask, playerPed, boneIndex, 0.0, 0.0, 0.0, 0.0, 90.0, 180.0, true, true, false, true, 1, true)
SetPedDiesInWater(playerPed, false)
TriggerEvent('mythic_notify:client:SendAlert', { type = 'inform', text = 'Dalgıç tüpünü giydin.'})
Citizen.Wait(50000)
TriggerEvent('mythic_notify:client:SendAlert', { type = 'inform', text = 'Oksijen tüpünde kalan: %50'})
Citizen.Wait(25000)
TriggerEvent('mythic_notify:client:SendAlert', { type = 'inform', text = 'Oksijen tüpünde kalan: %25'})
Citizen.Wait(25000)
TriggerEvent('mythic_notify:client:SendAlert', { type = 'error', text = 'Oksijen tüpünde kalan: %0'})
SetPedDiesInWater(playerPed, true)
DeleteObject(mask)
DeleteObject(tank)
ClearPedSecondaryTask(playerPed)
end
end)
end)
her hangi bir server side a
ESX.RegisterUsableItem('dalgictupu', function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('dalgictupu', 1)
TriggerClientEvent('viber-base:dalgictupu', source)
end)