Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/05/24 in all areas

  1. Hello, you need an event to trigger your function. You could use onPlayerDamage if your script is server side, or onClientPlayerDamage if its client side.
    1 point
  2. local SHADER_CODE = [===[ float3 g_f3Color = (float3)0.0; struct PSInput { float4 Position : POSITION0; float2 TexCoord : TEXCOORD0; }; float4 PixelShaderFunction ( PSInput PS ) : COLOR0 { return float4( g_f3Color, 1.0 - PS.TexCoord.x ); }; technique { pass P0 { PixelShader = compile ps_2_a PixelShaderFunction(); } } ]===]; local _dxDrawRectangle = dxDrawRectangle; local g_pShader = dxCreateShader( SHADER_CODE ); function dxDrawRectangle( fX, fY, fWidth, fHeight, pColor, bPostGUI, bLerpAlpha ) if ( not bLerpAlpha ) then _dxDrawRectangle( fX, fY, fWidth, fHeight, pColor, bPostGUI ); else dxSetShaderValue( g_pShader, "g_f3Color", pColor ); dxDrawImage( fX, fY, fWidth, fHeight, g_pShader, 0, 0, 0, -1, bPostGUI ); end end; addEventHandler( "onClientRender", root, function ( ) dxDrawRectangle( 600, 400, 256, 256, { 0, 0, 0 }, false, true ); end ); Please put a reaction to the message, it is on the bottom right. Don't be indifferent.
    1 point
×
×
  • Create New...