WASSIm. Posted April 21, 2013 Posted April 21, 2013 (edited) hi guys. how make show shader if player dead ? local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local blurStrength = 0.000 local noiseStrength = 0.000 addEventHandler("onClientResourceStart", resourceRoot, function() if getVersion ().sortable < "1.1.0" then outputChatBox("Resource is not compatible with this client.") return else createShader() end end) function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") if (not oldFilmShader) then outputChatBox("Could not create oldFilmShader. Please use debugscript 3") else outputChatBox("Using technique " .. oldFilmTec) end end function updateShader() upDateScreenSource(thePlayer) if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxSetShaderValue(oldFilmShader, "Blurring", blurStrength); dxSetShaderValue(oldFilmShader, "Noise", noiseStrength); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end addEventHandler("onClientPreRender", root, updateShader) function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end Edited April 21, 2013 by Guest
Jaysds1 Posted April 21, 2013 Posted April 21, 2013 try this: local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local blurStrength = 0.000 local noiseStrength = 0.000 local oldFilmShader, oldFilmTec function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") if not oldFilmShader then outputChatBox("Could not create oldFilmShader. Please use debugscript 3") else outputChatBox("Using technique " .. oldFilmTec) end end addEventHandler("onClientResourceStart", resourceRoot,function() if getVersion ().sortable < "1.1.0" then outputChatBox("Resource is not compatible with this client.") return end createShader() end) function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function updateScreen() upDateScreenSource() if oldFilmShader then --check localPlayers health local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource) dxSetShaderValue(oldFilmShader, "Flickering", flickering) dxSetShaderValue(oldFilmShader, "Blurring", blurStrength) dxSetShaderValue(oldFilmShader, "Noise", noiseStrength) dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end addEventHandler("onClientPlayerWasted",localPlayer,function() addEventHandler("onClientPreRender", root,updateScreen) end) addEventHandler("onClientPlayerSpawn",localPlayer,function() removeEventHandler("onClientPreRender",root,updateScreen) end) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
WASSIm. Posted April 21, 2013 Author Posted April 21, 2013 try this:local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local blurStrength = 0.000 local noiseStrength = 0.000 local oldFilmShader, oldFilmTec function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") if not oldFilmShader then outputChatBox("Could not create oldFilmShader. Please use debugscript 3") else outputChatBox("Using technique " .. oldFilmTec) end end addEventHandler("onClientResourceStart", resourceRoot,function() if getVersion ().sortable < "1.1.0" then outputChatBox("Resource is not compatible with this client.") return end createShader() end) function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function updateScreen() upDateScreenSource() if oldFilmShader then --check localPlayers health local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource) dxSetShaderValue(oldFilmShader, "Flickering", flickering) dxSetShaderValue(oldFilmShader, "Blurring", blurStrength) dxSetShaderValue(oldFilmShader, "Noise", noiseStrength) dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end addEventHandler("onClientPlayerWasted",localPlayer,function() addEventHandler("onClientPreRender", root,updateScreen) end) addEventHandler("onClientPlayerSpawn",localPlayer,function() removeEventHandler("onClientPreRender",root,updateScreen) end) nothing
Castillo Posted April 21, 2013 Posted April 21, 2013 Errors? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted April 21, 2013 Posted April 21, 2013 Works perfect here, it enables it when I die, and disables when I respawn. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
WASSIm. Posted April 21, 2013 Author Posted April 21, 2013 Works perfect here, it enables it when I die, and disables when I respawn. yes i want that but nothing
Castillo Posted April 21, 2013 Posted April 21, 2013 Just copy Jaysd code and replace yours with it, it works fine. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
WASSIm. Posted April 21, 2013 Author Posted April 21, 2013 Just copy Jaysd code and replace yours with it, it works fine. i copy and restart script x100000000 and reopened server but nothing
WASSIm. Posted April 21, 2013 Author Posted April 21, 2013 "OldFilmShader" description="Old Film Shader v1" author ="Sam@ke" version="1.0.0" type="script" />
Jaysds1 Posted April 21, 2013 Posted April 21, 2013 there's no type for file tags: meta.xml try this: > name ="OldFilmShader" description="Old Film Shader v1" author ="Sam@ke" version="1.0.0" type="script" /> ="shader.lua" type="client"/> src="shaders/old_film.fx"/>> My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
WASSIm. Posted April 21, 2013 Author Posted April 21, 2013 there's no type for file tags: meta.xmltry this: > name ="OldFilmShader" description="Old Film Shader v1" author ="Sam@ke" version="1.0.0" type="script" /> ="shader.lua" type="client"/> src="shaders/old_film.fx"/>> thxx
Jaysds1 Posted April 21, 2013 Posted April 21, 2013 np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now