Volltron Posted June 17, 2020 Share Posted June 17, 2020 (edited) I'm trying to change the whole sniper crosshair and scope but I get black bars instead of an empty screen when i aim with sniper Is there any way i can get rid of the black bars ? local shader = dxCreateShader("textureS.fx"); local texture = dxCreateTexture("empty.png"); dxSetShaderValue(shader, "crosshair_sniper", texture); engineApplyShaderToWorldTexture(shader, "snipercrosshair"); engineApplyShaderToWorldTexture(shader, "cameracrosshair"); https://i.imgur.com/gwD8ovY.png Edited June 17, 2020 by Volltron Link to comment
RekZ Posted June 18, 2020 Share Posted June 18, 2020 For what i see in others servers, people use this to create a new crossair and change it when the player want function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then local sW,sH = guiGetScreenSize() dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end end addEventHandler("onClientRender",root,onClientRender) Link to comment
Volltron Posted June 18, 2020 Author Share Posted June 18, 2020 11 hours ago, RekZ said: For what i see in others servers, people use this to create a new crossair and change it when the player want function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then local sW,sH = guiGetScreenSize() dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) end end end addEventHandler("onClientRender",root,onClientRender) Yes that's what I tried but the problem is the black bars and I was wondering if there's any way of just getting rid of them or if I have to get used to that and work with it https://i.imgur.com/2Vgw4w8.png Link to comment
Trust aka Tiffergan Posted June 18, 2020 Share Posted June 18, 2020 3 hours ago, Volltron said: Yes that's what I tried but the problem is the black bars and I was wondering if there's any way of just getting rid of them or if I have to get used to that and work with it https://i.imgur.com/2Vgw4w8.png i dont think you can delete this bars, but you can change resolution of crosshair.png and you shloud get nice crosshair 1 Link to comment
RekZ Posted June 18, 2020 Share Posted June 18, 2020 (edited) 4 hours ago, Volltron said: Yes that's what I tried but the problem is the black bars and I was wondering if there's any way of just getting rid of them or if I have to get used to that and work with it https://i.imgur.com/2Vgw4w8.png local sW,sH = guiGetScreenSize() -- Get Windows Resolution dont need to be render function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then if isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",false) end dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end end addEventHandler("onClientRender",root,onClientRender) Edited June 18, 2020 by RekZ 1 Link to comment
Volltron Posted June 18, 2020 Author Share Posted June 18, 2020 1 hour ago, RekZ said: local sW,sH = guiGetScreenSize() -- Get Windows Resolution dont need to be render function onClientRender () if (getPedWeapon(localPlayer) == 34) then if ((getPedTask(localPlayer, "secondary", 0) == "TASK_SIMPLE_USE_GUN") and getPedControlState("aim_weapon")) then if isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",false) end dxDrawImage(0, 0, sW, sH, "crosshair.png", 0, 0, 0, tocolor(255, 255, 255, 255), true) else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end else if not isPlayerHudComponentVisible("crosshair") then setPlayerHudComponentVisible("crosshair",true) end end end addEventHandler("onClientRender",root,onClientRender) Same thing happens, but thank you anyway. I think there's just no way of getting rid of the black side bars when zooming in with the sniper Link to comment
MrKAREEM Posted June 18, 2020 Share Posted June 18, 2020 see this topic it will help you Link to comment
Volltron Posted June 19, 2020 Author Share Posted June 19, 2020 On 18/06/2020 at 21:01, MrKAREEM said: see this topic it will help you I know, I've looked at it before this but it's not what i was looking for. I fixed it anyway by making an empty sniper scope with no crosshair and added a crosshair over it 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