displayblod Posted December 26, 2017 Share Posted December 26, 2017 hi. for a long time I want to ask how to hide this sight? The thing is that I'm doing video creation using MTA, and this sight really hinders me. how to remove/hide it? Thank youhttps://imgur.com/6jy8llv Link to comment
DNL291 Posted December 26, 2017 Share Posted December 26, 2017 (edited) Take a look at the resource editor_main, there's a function called "setCrosshairState" in the script main.lua (line 580). Edited December 26, 2017 by DNL291 Link to comment
displayblod Posted December 27, 2017 Author Share Posted December 27, 2017 function setCrosshairState(state) if not g_showCrosshair then return end local color = tocolor(255,255,255,102) if state == CROSSHAIR_WORLD then color = tocolor(255,255,255,255) elseif state == CROSSHAIR_WATER then color = tocolor(80,203,227,255) elseif state == CROSSHAIR_MOUSEOVER then color = tocolor(191,203,134,255) elseif state == CROSSHAIR_SENSITIVE then color = tocolor(255,0,0,255) end dxDrawImage ( g_screenX/2 - 16, g_screenY/2 - 16, 32, 32, "client/images/crosshair.png",0,0,0,color,false) g_crosshairState = state end I actually found this code, but unfortunately I do not understand much about it and do not know what to do with it. if it can be edited then using what? ty Link to comment
King12 Posted December 27, 2017 Share Posted December 27, 2017 (edited) -- Client side setPlayerHudComponentVisible ( "crosshair", false ) -- or this to hide every HUD component setPlayerHudComponentVisible ( "all", false ) Edited December 27, 2017 by King12 Link to comment
displayblod Posted December 27, 2017 Author Share Posted December 27, 2017 19 minutes ago, King12 said: -- Client side setPlayerHudComponentVisible ( "crosshair", false ) -- or this to hide every HUD component setPlayerHudComponentVisible ( "all", false ) im sorry for noob question, I need to just write this down in "main.lua" (MTA San Andreas 1.5>server>mods>deathmatch>resources>[editor]>editor_main>client), in any empty place? if yes, after just save it on notepad++? Link to comment
King12 Posted December 27, 2017 Share Posted December 27, 2017 addEventHandler("onClientResourceStart", resourceRoot, function() setPlayerHudComponentVisible( "crosshair", false ) end ) and for the meta: <meta> <script src="client.lua" type="client"/> </meta> It's better to have the resource on a separate folder, I don't recommend adding it to editor gamemode. Link to comment
displayblod Posted December 27, 2017 Author Share Posted December 27, 2017 addEventHandler("onClientResourceStart", resourceRoot, function() setPlayerHudComponentVisible( "crosshair", false ) end ) I was finally confused this to "main.lua" in zip editor_main? and this to meta.xml in the same archive <meta> <script src="client.lua" type="client"/> </meta> Link to comment
Storm-Hanma Posted December 27, 2017 Share Posted December 27, 2017 (edited) Make a desperate folder add it in resource folder or gameplay folder and will work fine for example Folder name - hidecrosshair Now in hidecross folder add meta.XML and client file and upload in resource folder then enter server do/refresh then /start hidecrosshair simple for map editor also same do /start hidecrosshair Edited December 27, 2017 by Khadeer143 Link to comment
displayblod Posted December 28, 2017 Author Share Posted December 28, 2017 23 hours ago, Khadeer143 said: Make a desperate folder add it in resource folder or gameplay folder and will work fine for example Folder name - hidecrosshair Now in hidecross folder add meta.XML and client file and upload in resource folder then enter server do/refresh then /start hidecrosshair simple for map editor also same do /start hidecrosshair what client file? as I understood all this must be done only after this addEventHandler("onClientResourceStart", resourceRoot, function() setPlayerHudComponentVisible( "crosshair", false ) end ) otherwise how MTA will understand exactly what I want to do 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