Freeeaky / GTALua

Scripting engine for GTA V in Lua
GNU General Public License v2.0
60 stars 25 forks source link

Added Screen Effect #74

Closed vincentducorps closed 9 years ago

vincentducorps commented 9 years ago

Thanks to Tiryll (http://gtaforums.com/topic/796638-screen-fx/)

For graphics.StartScreenEffect(name, play_lenght, loop) => play_lenght is how long to play the effect for in milliseconds. If 0, it plays the default length

Screen Effect List

    local screenEffect = {
      "SwitchHUDIn", "SwitchHUDOut", "FocusIn", "FocusOut", "MinigameEndNeutral", "MinigameEndTrevor", "MinigameEndFranklin", "MinigameEndMichael", "MinigameTransitionOut", "MinigameTransitionIn", "SwitchShortNeutralIn", "SwitchShortFranklinIn", "SwitchShortTrevorIn", "SwitchShortMichaelIn", "SwitchOpenMichaelIn", "SwitchOpenFranklinIn", "SwitchOpenTrevorIn", "SwitchHUDMichaelOut", "SwitchHUDFranklinOut", "SwitchHUDTrevorOut", "SwitchShortFranklinMid", "SwitchShortMichaelMid", "SwitchShortTrevorMid", "DeathFailOut", "CamPushInNeutral", "CamPushInFranklin", "CamPushInMichael", "CamPushInTrevor", "SwitchOpenMichaelIn", "SwitchSceneFranklin", "SwitchSceneTrevor", "SwitchSceneMichael", "SwitchSceneNeutral", "MP_Celeb_Win", "MP_Celeb_Win_Out", "MP_Celeb_Lose", "MP_Celeb_Lose_Out", "DeathFailNeutralIn", "DeathFailMPDark", "DeathFailMPIn", "MP_Celeb_Preload_Fade", "PeyoteEndOut", "PeyoteEndIn", "PeyoteIn", "PeyoteOut", "MP_race_crash", "SuccessFranklin", "SuccessTrevor", "SuccessMichael", "DrugsMichaelAliensFightIn", "DrugsMichaelAliensFight", "DrugsMichaelAliensFightOut", "DrugsTrevorClownsFightIn", "DrugsTrevorClownsFight", "DrugsTrevorClownsFightOut", "HeistCelebPass", "HeistCelebPassBW", "HeistCelebEnd", "HeistCelebToast", "MenuMGHeistIn", "MenuMGTournamentIn", "MenuMGSelectionIn", "ChopVision", "DMT_flight_intro", "DMT_flight", "DrugsDrivingIn", "DrugsDrivingOut", "SwitchOpenNeutralFIB5", "HeistLocate", "MP_job_load", "RaceTurbo", "MP_intro_logo", "HeistTripSkipFade", "MenuMGHeistOut", "MP_corona_switch", "MenuMGSelectionTint", "SuccessNeutral", "ExplosionJosh3", "SniperOverlay", "RampageOut", "Rampage", "Dont_tazeme_bro", "DeathFailOut"
    }

TRY ME

In your Run() function

    local screenEffect = {
      "SwitchHUDIn", "SwitchHUDOut", "FocusIn", "FocusOut", "MinigameEndNeutral", "MinigameEndTrevor", "MinigameEndFranklin", "MinigameEndMichael", "MinigameTransitionOut", "MinigameTransitionIn", "SwitchShortNeutralIn", "SwitchShortFranklinIn", "SwitchShortTrevorIn", "SwitchShortMichaelIn", "SwitchOpenMichaelIn", "SwitchOpenFranklinIn", "SwitchOpenTrevorIn", "SwitchHUDMichaelOut", "SwitchHUDFranklinOut", "SwitchHUDTrevorOut", "SwitchShortFranklinMid", "SwitchShortMichaelMid", "SwitchShortTrevorMid", "DeathFailOut", "CamPushInNeutral", "CamPushInFranklin", "CamPushInMichael", "CamPushInTrevor", "SwitchOpenMichaelIn", "SwitchSceneFranklin", "SwitchSceneTrevor", "SwitchSceneMichael", "SwitchSceneNeutral", "MP_Celeb_Win", "MP_Celeb_Win_Out", "MP_Celeb_Lose", "MP_Celeb_Lose_Out", "DeathFailNeutralIn", "DeathFailMPDark", "DeathFailMPIn", "MP_Celeb_Preload_Fade", "PeyoteEndOut", "PeyoteEndIn", "PeyoteIn", "PeyoteOut", "MP_race_crash", "SuccessFranklin", "SuccessTrevor", "SuccessMichael", "DrugsMichaelAliensFightIn", "DrugsMichaelAliensFight", "DrugsMichaelAliensFightOut", "DrugsTrevorClownsFightIn", "DrugsTrevorClownsFight", "DrugsTrevorClownsFightOut", "HeistCelebPass", "HeistCelebPassBW", "HeistCelebEnd", "HeistCelebToast", "MenuMGHeistIn", "MenuMGTournamentIn", "MenuMGSelectionIn", "ChopVision", "DMT_flight_intro", "DMT_flight", "DrugsDrivingIn", "DrugsDrivingOut", "SwitchOpenNeutralFIB5", "HeistLocate", "MP_job_load", "RaceTurbo", "MP_intro_logo", "HeistTripSkipFade", "MenuMGHeistOut", "MP_corona_switch", "MenuMGSelectionTint", "SuccessNeutral", "ExplosionJosh3", "SniperOverlay", "RampageOut", "Rampage", "Dont_tazeme_bro", "DeathFailOut"
    }

    local screenEffectIndex = 1

In your loop (while self:IsRunning() do)

if IsKeyDown(KEY_F9) then
            local newScreenEffect = screenEffect[screenEffectIndex]
            local oldScreenEffect = screenEffect[screenEffectIndex - 1]

            if graphics.ScreenEffectIsActive(oldScreenEffect or "") then
                graphics.StopScreenEffect(oldScreenEffect)
                gui.NotifyAboveMap("Disable " .. oldScreenEffect)
            end

            graphics.StartScreenEffect(screenEffect[screenEffectIndex])
            gui.NotifyAboveMap("Enable " .. screenEffect[screenEffectIndex])

            screenEffectIndex = screenEffectIndex + 1
            if screenEffectIndex > #screenEffect then screenEffectIndex = 1 end
        end
Freeeaky commented 9 years ago

Awesome! Thanks alot!