Jump to content

DEIXA MIRA PADRÃO DO GTA:SA


Recommended Posts

BOA TARDE, estou em fretando um problema com sistemas de mira. Quando eu aplicado a mira que eu quero ela funciona, porem quero deixar a mira padrão que tem no SERVIDOR / GTA:SA que pode ser modificada pelo GTA.

 

bindKey ( "aim_weapon", "both", function()
	if not getElementData(getLocalPlayer(),"logedin") then return end
    Crosshair_table = {}
	if (getElementData(getLocalPlayer(),"fanbox") or 0 == 0) then
		default = dxCreateTexture("tools/shaders/miras/"..(getElementData(getLocalPlayer(),"fanbox"))..".png")
        Crosshair_table = dxCreateShader("tools/shaders/fx/texreplace.fx")
        engineApplyShaderToWorldTexture(Crosshair_table, "siteM16")
        dxSetShaderValue(Crosshair_table, "gTexture", default)
    end		
end)


-------------------------------------------
-- FUNÇÃO QUE APLICA A MIRA SELECIONADA

    listMiras = guiGridListAddColumn(grilistMiras, "MIRAS:", 0.8)
    ImgButtums = guiCreateStaticImage(410, 100, 100, 100, "tools/shaders/miras/false2.png", false,tabMiras1)
    ImgButtums2 = guiCreateStaticImage(410, 100, 100, 100, "tools/shaders/miras/0.png", false,tabMiras1)
    buttonSystemMiras = guiCreateButton(400, 230, 120, 20, "APLICAR", false,tabMiras1)
    buttonSystemMirasPadrao = guiCreateButton(400, 260, 120, 20, "Crosshair Padrão", false,tabMiras1)

addEventHandler("onClientGUIClick",getRootElement(),function()
    if source == grilistMiras then
        local selectsight = guiGridListGetItemText(grilistMiras,guiGridListGetSelectedItem(grilistMiras),1)
        for _, data in ipairs(tableSight) do
            if data[1] == selectsight then
                guiStaticImageLoadImage(ImgButtums2, data[2])
                break
            end
        end	
	elseif source == buttonSystemMirasPadrao then
    	setElementData(getLocalPlayer(),"sight",nil)
        setElementData(getLocalPlayer(),"fanbox",0)
        if isElement(Crosshair_table) then
            engineRemoveShaderFromWorldTexture(Crosshair_table, "siteM16")
            destroyElement( Crosshair_table )
            Crosshair_table = nil
        end
	elseif source == buttonSystemMiras then
		local selectsight = guiGridListGetItemText(grilistMiras,guiGridListGetSelectedItem(grilistMiras),1)
		for _, data in ipairs(tableSight) do
            if data[1] == selectsight then
                setElementData(getLocalPlayer(),"sight",data[2])
                setElementData(getLocalPlayer(),"fanbox",data[3])
                break
            end
        end	
      end
    end
end)

 

Link to comment

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.
×
×
  • Create New...