MatreN Posted February 2, 2020 Share Posted February 2, 2020 Hello guys, I want to switch black and white screen, but I don't know how to do it, can you help me? I want it to work when we touch the marker. Link to comment
Moderators Patrick Posted February 2, 2020 Moderators Share Posted February 2, 2020 https://community.multitheftauto.com/index.php?p=resources&s=details&id=8466 Link to comment
MatreN Posted February 2, 2020 Author Share Posted February 2, 2020 I want to add a marker to this, but I don't know @stPatrick Link to comment
Moderators Patrick Posted February 2, 2020 Moderators Share Posted February 2, 2020 local screenX, screenY = guiGetScreenSize() local screenSource = dxCreateScreenSource(screenX, screenY) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() if getVersion ().sortable < "1.1.0" then outputChatBox("Resource is not compatible with this client.") return else blackWhiteShader, blackWhiteTec = dxCreateShader("fx/blackwhite.fx") if (not blackWhiteShader) then outputChatBox("Could not create shader. Please use debugscript 3.") else outputChatBox("shader " .. blackWhiteTec .. " was started.") end end end) function doBlackAndWhite() if (blackWhiteShader) then dxUpdateScreenSource(screenSource) dxSetShaderValue(blackWhiteShader, "screenSource", screenSource) dxDrawImage(0, 0, screenX, screenY, blackWhiteShader) end end local marker = createMarker(0, 0, 3, "cylinder", 2) addEventHandler("onClientMarkerHit", marker, function() addEventHandler("onClientPreRender", getRootElement(), doBlackAndWhite) end) addEventHandler("onClientMarkerLeave", marker, function() removeEventHandler("onClientPreRender", getRootElement(), doBlackAndWhite) end) Edit blackwhite.Lua Link to comment
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