Jump to content

help


WASSIm.

Recommended Posts

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 by Guest
Link to comment

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) 

Link to comment
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

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...