Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddEventHandler('onClientMapStart', function()
- exports.spawnmanager:spawnPlayer()
- Wait(5000)
- exports.spawnmanager:setAutoSpawn(false)
- end)
- CreateThread(function()
- local scaleform, X, Y, W; H = 0.0125
- local CheckPoint
- RequestScriptAudioBank('MP_WASTED', 0)
- while true do
- Wait(0)
- if not HasNamedScaleformMovieLoaded('MP_BIG_MESSAGE_FREEMODE') then
- scaleform = RequestScaleformMovie('MP_BIG_MESSAGE_FREEMODE')
- while not HasNamedScaleformMovieLoaded('MP_BIG_MESSAGE_FREEMODE') do
- Wait(0)
- end
- end
- if not HasStreamedTextureDictLoaded('timerbars') then
- RequestStreamedTextureDict('timerbars')
- while not HasStreamedTextureDictLoaded('timerbars') do
- Wait(0)
- end
- end
- if IsPlayerDead(PlayerId()) then
- ClearHelp(1)
- local PedKiller = GetPedSourceOfDeath(PlayerPedId()); DeathCauseHash = GetPedCauseOfDeath(PlayerPedId()); Hidden = false
- local Killer, DeathReasonVictim, DeathReasonOthers, DeathReasonKiller, INT
- if IsEntityAPed(PedKiller) and IsPedAPlayer(PedKiller) then
- Killer = NetworkGetPlayerIndexFromPed(PedKiller)
- elseif IsEntityAVehicle(PedKiller) and IsEntityAPed(GetPedInVehicleSeat(PedKiller, -1)) and IsPedAPlayer(GetPedInVehicleSeat(PedKiller, -1)) then
- Killer = NetworkGetPlayerIndexFromPed(GetPedInVehicleSeat(PedKiller, -1))
- end
- if (Killer == PlayerId()) then
- DeathReasonVictim = 'DM_U_SUIC'
- DeathReasonOthers = 'DM_O_SUIC'
- elseif (Killer == nil) then
- DeathReasonVictim = 'DM_TK_YD1'
- DeathReasonOthers = 'TICK_DIED'
- else
- DeathReasonKiller, DeathReasonVictim, DeathReasonOthers = GetReason()
- end
- if N_0x35fb78dc42b7bd21() then
- StartScreenEffect('DeathFailMPDark', 0, 0)
- else
- StartScreenEffect('DeathFailMPIn', 0, 0)
- end
- SetCamEffect(1)
- TriggerServerEvent(GetCurrentResourceName() .. ':SendDeathMessage', PlayerId(), Killer, DeathReasonVictim, DeathReasonOthers, DeathReasonKiller)
- Wait(750)
- PlaySoundFrontend(-1, 'MP_Flash', 'WastedSounds', 1)
- PushScaleformMovieFunction(scaleform, 'SHOW_SHARD_WASTED_MP_MESSAGE')
- PushScaleformMovieFunctionParameterString(GetLabelText('RESPAWN_W'))
- if DeathReasonVictim ~= 'DM_TK_YD1' then
- PushScaleformMovieFunctionParameterString(GetLabelText(DeathReasonVictim):gsub('~a~', '~bold~' .. GetPlayerName(Killer) .. '~bold~'))
- end
- PopScaleformMovieFunctionVoid()
- local timer = GetGameTimer()
- while IsPlayerDead(PlayerId()) do
- Wait(0)
- DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255)
- if Killer and Killer ~= PlayerId() then
- local ScaleformMovie = RequestScaleformMovie('instructional_buttons')
- DrawScaleformMovieFullscreen(ScaleformMovie, 255, 255, 255, 0)
- PushScaleformMovieFunction(ScaleformMovie, 'CLEAR_ALL')
- PopScaleformMovieFunctionVoid()
- PushScaleformMovieFunction(ScaleformMovie, 'SET_CLEAR_SPACE')
- PushScaleformMovieFunctionParameterInt(200)
- PopScaleformMovieFunctionVoid()
- PushScaleformMovieFunction(ScaleformMovie, 'SET_DATA_SLOT')
- PushScaleformMovieFunctionParameterInt(0)
- if GetLastInputMethod(2) then
- PushScaleformMovieFunctionParameterInt(100)
- else
- PushScaleformMovieFunctionParameterInt(30)
- end
- BeginTextCommandScaleformString('STRING')
- AddTextComponentScaleform(GetLabelText('HUD_INPUT97'))
- EndTextCommandScaleformString()
- PopScaleformMovieFunctionVoid()
- PushScaleformMovieFunction(ScaleformMovie, 'DRAW_INSTRUCTIONAL_BUTTONS')
- PopScaleformMovieFunctionVoid()
- PushScaleformMovieFunction(ScaleformMovie, 'SET_BACKGROUND_COLOUR')
- PushScaleformMovieFunctionParameterInt(0)
- PushScaleformMovieFunctionParameterInt(0)
- PushScaleformMovieFunctionParameterInt(0)
- PushScaleformMovieFunctionParameterInt(60)
- PopScaleformMovieFunctionVoid()
- if ((GetLastInputMethod(2) and (IsControlJustPressed(1, 24) or IsDisabledControlJustPressed(1, 24))) or (not GetLastInputMethod(2) and
- (IsControlJustPressed(1, 21) or IsDisabledControlJustPressed(1, 21)))) and GetTimeDifference(GetGameTimer(), timer) < 9500 then
- PlaySoundFrontend(-1, 'Faster_Click', 'RESPAWN_ONLINE_SOUNDSET', 1)
- timer = GetTimeDifference(timer, 500)
- end
- if GetTimeDifference(GetGameTimer(), timer) < 10000 then
- W = (GetTimeDifference(GetGameTimer(), timer) * (0.085 / 10000))
- end
- local correction = ((1.0 - round(GetSafeZoneSize(), 2)) * 100) * 0.005
- X, Y = 0.9155 - correction, 0.94 - correction
- Set_2dLayer(0)
- DrawSprite('timerbars', 'all_black_bg', X, Y, 0.15, 0.030, 0.0, 255, 255, 255, 180)
- Set_2dLayer(1)
- DrawRect(X + 0.0275, Y, 0.085, 0.012, 100, 0, 0, 180)
- Set_2dLayer(2)
- DrawRect(X - 0.015 + (W / 2), Y, W, H, 150, 0, 0, 180)
- SetTextColour(255, 255, 255, 180)
- SetTextFont(0)
- SetTextScale(0.3, 0.3)
- SetTextCentre(true)
- SetTextEntry('STRING')
- AddTextComponentString(GetLabelText('KS_RESPAWN_B'))
- Set_2dLayer(3)
- DrawText(X - 0.06, Y - 0.012)
- if GetTimeDifference(GetGameTimer(), timer) >= 1000 then
- if IsEntityAPed(PedKiller) and IsPedAPlayer(PedKiller) then
- local RaycastToKiller = StartShapeTestRay(GetEntityCoords(PlayerPedId(), false), GetEntityCoords(PedKiller, false), -1, PlayerPedId(), 0)
- local Int, Hit, EndCoords, SurfaceNormal, EntityHit = GetShapeTestResult(RaycastToKiller)
- if not Hidden and (not Hit or (Hit and EntityHit == PedKiller)) then
- if NetworkIsInSpectatorMode() then
- for i = 0, 31 do
- EnableAllControlActions(i)
- end
- SetCamEffect(0)
- NetworkSetOverrideSpectatorMode(false)
- NetworkSetInSpectatorMode(false, PedKiller)
- SetCinematicModeActive(false)
- SetFocusEntity(PlayerPedId())
- end
- if IsPedInAnyVehicle(PedKiller) then
- SetGameplayPedHint(GetVehiclePedIsIn(PedKiller, false), 0.0, 0.0, 0.0, true, -1, 2000, 2000)
- else
- SetGameplayPedHint(PedKiller, 0.0, 0.0, 0.0, true, -1, 2000, 2000)
- end
- else
- Hidden = true
- if IsGameplayHintActive() then
- DoScreenFadeOut(500)
- StopGameplayHint(0)
- DoScreenFadeIn(500)
- end
- for i = 0, 31 do
- DisableAllControlActions(i)
- end
- SetCamEffect(2)
- NetworkSetOverrideSpectatorMode(true)
- NetworkSetInSpectatorMode(true, PedKiller)
- SetCinematicModeActive(true)
- SetFocusEntity(PedKiller)
- end
- end
- end
- if GetTimeDifference(GetGameTimer(), timer) >= 10000 then
- exports.spawnmanager:spawnPlayer()
- PlaySoundFrontend(-1, 'Faster_Bar_Full', 'RESPAWN_ONLINE_SOUNDSET', 1)
- end
- else
- if GetTimeDifference(GetGameTimer(), timer) >= 3500 then
- exports.spawnmanager:spawnPlayer()
- end
- end
- end
- if GetScreenEffectIsActive('DeathFailMPDark') then
- StopScreenEffect('DeathFailMPDark')
- elseif GetScreenEffectIsActive('DeathFailMPIn') then
- StopScreenEffect('DeathFailMPIn')
- end
- if IsGameplayCamShaking() then
- StopGameplayCamShaking(true)
- end
- if NetworkIsInSpectatorMode() then
- for i = 0, 31 do
- EnableAllControlActions(i)
- end
- NetworkSetOverrideSpectatorMode(false)
- NetworkSetInSpectatorMode(false, PedKiller)
- SetCinematicModeActive(false)
- end
- if IsGameplayHintActive() then
- StopGameplayHint(0)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement