This time i return with some own wrote lines
[CODE]local function Thinkeffect(ply)
for _, ply in pairs( player.GetAll() ) do
local NextTime = 0
if not ply:Alive() then
if (CurTime() >= NextTime) then
RunConsoleCommand("pp_texturize", "pp/texturize/plain.png")
NextTime = CurTime() + 1
end
else
RunConsoleCommand( "pp_texturize", "" )
end
end
end
hook.Add( "Think", "ScreenEffect.Think", Thinkeffect )[/CODE]
The problem is, that when a player on the server dies, everyone gets the screen effect until that died player respawns.
again, any advise and tips are welcome !
Make the function client sided? would that not work?
You might just want to use this hook.
[url]http://wiki.garrysmod.com/page/GM/RenderScreenspaceEffects[/url]
The client is easier to use, also the timer might lag the client with RunConsoleCommand every tick.
Try this instead:
[lua]
-- Clientside
-- Color stuff here .. if you want to fiddle with it
local tab =
{
["$pp_colour_addr"] = 0,
["$pp_colour_addg"] = 0,
["$pp_colour_addb"] = 0,
["$pp_colour_brightness"] = -0.04,
["$pp_colour_contrast"] = 1.35,
["$pp_colour_colour"] = 5,
["$pp_colour_mulr"] = 0,
["$pp_colour_mulg"] = 0,
["$pp_colour_mulb"] = 0
}
-- The function itself
local function PostProcess()
if LocalPlayer():Alive() then return end -- If the player is alive .. stop the script from running.
-- DrawColorModify( tab ) --Draws Color Modify effect -- If you want to play with this function remove the "--" infront
-- (Alpha,material)
DrawTexturize( 1, Material( "pp/texturize/plain.png" ) )
end
hook.Add( "RenderScreenspaceEffects", "weeeeeee", PostProcess )[/lua]
Thanks a lot for the help guys, it finally works like it should !!
Sorry, you need to Log In to post a reply to this thread.