displayblod

sight problem

Recommended Posts

Take a look at the resource editor_main, there's a function called "setCrosshairState" in the script main.lua (line 580).

Edited by DNL291

Share this post


Link to post
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

Share this post


Link to post
-- Client side

setPlayerHudComponentVisible ( "crosshair", false )
-- or this to hide every HUD component
setPlayerHudComponentVisible ( "all", false )

 

Edited by King12

Share this post


Link to post
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++?

Share this post


Link to post
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

  1. <meta>
    <script src="client.lua" type="client"/>
    </meta>

Share this post


Link to post

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 by Khadeer143

Share this post


Link to post
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 O.o

 

addEventHandler("onClientResourceStart", resourceRoot,

function()

setPlayerHudComponentVisible( "crosshair", false )

end

)

otherwise how MTA will understand exactly what I want to do

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.