Jump to content

bonbom

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by bonbom

  1. hey Ive been trying to make saving system to save my settings gui checkbox state, but without any luck. I would be more than happy if someone could make me one. Example: you open settings gui with f4 press realistic water checkbox on leave server come back and it is in same state.
  2. Sry if i didint expain so clearly I meant I dont know what should i put there like example addeventhandler ("what client event!?) and so on..... so when player checks checkbox water shader would start And I cant finnish this becose of this part of script so im asking help here.
  3. I have been scripting settings GUI with my beginner scripting skills ^^ and I was wondering what should i type here (spots where read (blablabla) if ( source ) == checkBox1 then if ( guiCheckBoxGetSelected (source) ) then (blablabla start this function) else (blablabla remove this function) end
  4. Hello! I made this script as my second script and it wont work. Could someone find out where is problem and post here fixed one? Thx! function CreateWindow() guiCreateWindow(2,262,188,374,"Settings",false) end function waterShader() guiCreateCheckBox(9,97,15,16,"water Shader",false,false if ( getElementType(source) == "gui-checkbox" ) then -- Is the element clicked a checkbox? if ( guiCheckBoxGetSelected(source) ) then waterTimer = setTimer ( checkWaterColor, 1000, 0 ) engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) outputChatBox ( "Water shader enabled" ) else killTimer ( waterTimer ) engineRemoveShaderFromWorldTexture ( myShader, "waterclear256" ) outputChatBox ( "Water shader disabled" ) end end end addEventHandler("onClientGUIClick", root, checkboxBleepWhenClicked, false) addEventHandler( "onClientResourceStart", resourceRoot, end ); function() -- Version check if getVersion ().sortable < "1.1.0" then outputChatBox( "Resource is not compatible with this client." ) return end -- Create shader myShader, tec = dxCreateShader ( "water.fx" ) if not myShader then outputChatBox( "Could not create shader. Please use debugscript 3" ) else -- Set textures local textureVol = dxCreateTexture ( "images/smallnoise3d.dds" ); local textureCube = dxCreateTexture ( "images/cube_env256.dds" ); dxSetShaderValue ( myShader, "microflakeNMapVol_Tex", textureVol ); dxSetShaderValue ( myShader, "showroomMapCube_Tex", textureCube ); -- Apply to global txd 13 engineApplyShaderToWorldTexture ( myShader, "waterclear256" ) -- Update water color incase it gets changed by persons unknown setTimer( function() if myShader then local r,g,b,a = getWaterColor() dxSetShaderValue ( myShader, "gWaterColor", r/255, g/255, b/255, a/255 ); end end ,100,0 ) end end ) enabled = false function chromecars () guiCreateCheckBox(9,58,17,21,"",false,false end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),waterShader) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),createWindow)
×
×
  • Create New...