Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2019-08-15, 22:21


TheBAMBO

restMTA






Wiek: 22
Na forum: 2812 dni
Posty: 73
Nick w MP: zexty

Piwa: 12110

Respekt: 75,8

Witam, napisa?em panel F1, lecz gdy go wlaczam nie dzia?aj? ?adne elementy w cgui, za pomoc stawiam :piwo:


Kod:


--[[

@AutorTheNoobisty

Zabrania siedytowania skryptu bez zgody jego autora -

]]--


zakladka guiCreateLabel(0.020.090.710.84""true)
local font0_normal guiCreateFont(":pd_gui/fonts/normal.ttf"13)
guiSetFont(zakladkafont0_normal)
guiLabelSetHorizontalAlign(zakladka"center"false)
guiLabelSetVerticalAlign(zakladka"center")


label guiCreateLabel(0.020.020.700.07""true)
local font1_gtav guiCreateFont(":pd_gui/fonts/gtav.ttf"39)
guiSetFont(labelfont1_gtav)
guiLabelSetHorizontalAlign(label"center"false)
guiLabelSetVerticalAlign(label"center")


local screenWscreenH guiGetScreenSize()
F1 false

function cursorPosition(xywh) 
if (not isCursorShowing()) then 
return false 
end 
local mxmy getCursorPosition() 
local fullxfully guiGetScreenSize() 
cursorxcursory mx*fullxmy*fully 
if cursorx and cursorx and cursory and cursory h then 
return true 
else 
return false 
end 
end 


-- Zakladki
Przewodnik "Przewodnik"
Prace "Prace"
Komendy "Komendy"
Bindy "Bindy"
Premium "Premium"



local dxfont0_gtav dxCreateFont(":pd_gui/fonts/gtav.ttf"49)
local dxfont1_normal dxCreateFont(":pd_gui/fonts/normal.ttf"12)

function render()
        dxDrawRectangle(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000tocolor(656565225), false)

 
        if cursorPosition(screenW 0.9440screenH 0.1629screenW 0.0560screenH 0.0219then
        dxDrawRectangle(screenW 0.9440screenH 0.1629screenW 0.0560screenH 0.0219tocolor(35,35,35,225), false)
        else
        dxDrawRectangle(screenW 0.9440screenH 0.1629screenW 0.0560screenH 0.0219tocolor(65,65,65,225), false)
        end

        if cursorPosition(screenW 0.9440screenH 0.1905screenW 0.0560screenH 0.0219then
        dxDrawRectangle(screenW 0.9440screenH 0.1905screenW 0.0560screenH 0.0219tocolor(35,35,35,225), false)
        else
        dxDrawRectangle(screenW 0.9440screenH 0.1905screenW 0.0560screenH 0.0219tocolor(65,65,65,225), false)
        end

          if cursorPosition(screenW 0.9440screenH 0.2162screenW 0.0560screenH 0.0219then
        dxDrawRectangle(screenW 0.9440screenH 0.2162screenW 0.0560screenH 0.0219tocolor(35,35,35,225), false)
        else
        dxDrawRectangle(screenW 0.9440screenH 0.2162screenW 0.0560screenH 0.0219tocolor(65,65,65,225), false)
        end

        if cursorPosition(screenW 0.9440screenH 0.2429screenW 0.0560screenH 0.0219then
        dxDrawRectangle(screenW 0.9440screenH 0.2429screenW 0.0560screenH 0.0219tocolor(35,35,35,225), false)
        else
        dxDrawRectangle(screenW 0.9440screenH 0.2429screenW 0.0560screenH 0.0219tocolor(65,65,65,225), false)
        end


        if cursorPosition(screenW 0.9440screenH 0.2686screenW 0.0560screenH 0.0219then
        dxDrawRectangle(screenW 0.9440screenH 0.2686screenW 0.0560screenH 0.0219tocolor(35,35,35,225), false)
        else
        dxDrawRectangle(screenW 0.9440screenH 0.2686screenW 0.0560screenH 0.0219tocolor(65,65,65,225), false)
        end


        --dxDrawText("Panel Pomocy"screenW 0.7315screenH 0.0133screenW 0.9940screenH 0.1029tocolor(255255255255), 1.00dxfont0_gtav"center""center"falsefalsetruefalsefalse)
        dxDrawText("Przewodnik"screenW 0.9446screenH 0.1638screenW 0.9940screenH 0.1857tocolor(255255255255), 1.00dxfont1_normal"right""center"falsefalsetruefalsefalse)
        dxDrawText("Prace"screenW 0.9446screenH 0.1905screenW 0.9940screenH 0.2124tocolor(255255255255), 1.00dxfont1_normal"right""center"falsefalsetruefalsefalse)
        dxDrawText("Bindy"screenW 0.9446screenH 0.2429screenW 0.9940screenH 0.2648tocolor(255255255255), 1.00dxfont1_normal"right""center"falsefalsetruefalsefalse)
        dxDrawText("Komendy"screenW 0.9446screenH 0.2162screenW 0.9940screenH 0.2381tocolor(255255255255), 1.00dxfont1_normal"right""center"falsefalsetruefalsefalse)
        dxDrawText("Premium"screenW 0.9446screenH 0.2695screenW 0.9940screenH 0.2914tocolor(255255255255), 1.00dxfont1_normal"right""center"falsefalsetruefalsefalse)



end

addEventHandler("onClientClick"getRootElement(), function(buttonstate)
    if button == "left" and state == "down" then
        if cursorPosition(screenW 0.9440screenH 0.1629screenW 0.0560screenH 0.0219then
            guiSetVisible(labeltrue)
            guiSetVisible(zakladkatrue)
            guiSetText(zakladka"1")
            guiSetText(labelPrzewodnik)
        elseif cursorPosition(screenW 0.9440screenH 0.1905screenW 0.0560screenH 0.0219then
            guiSetVisible(labeltrue)
            guiSetVisible(zakladkatrue)
            guiSetText(zakladka"2")
            guiSetText(labelPrace)
        elseif cursorPosition(screenW 0.9440screenH 0.2162screenW 0.0560screenH 0.0219then
            guiSetVisible(labeltrue)
            guiSetVisible(zakladkatrue)
            guiSetText(zakladka"3")
            guiSetText(labelKomendy)
        elseif cursorPosition(screenW 0.9440screenH 0.2429screenW 0.0560screenH 0.0219then
            guiSetVisible(labeltrue)
            guiSetVisible(zakladkatrue)
            guiSetText(zakladka"4")
            guiSetText(labelBindy)
        elseif cursorPosition(screenW 0.9440screenH 0.2686screenW 0.0560screenH 0.0219then
            guiSetVisible(labeltrue)
            guiSetVisible(zakladkatrue)
            guiSetText(zakladka"5")
            guiSetText(labelPremium)
    end
end
end)

function F1()
    if F1 == false then
        if getElementData(localPlayer"dashboard"then return end
        if getElementData(localPlayer"player:radar:ko?owy"then
        setPlayerHudComponentVisible("radar",false)
        setElementData(localPlayer"nimaradaru"true)
        end
        addEventHandler("onClientRender"getRootElement(), render)
        guiSetVisible(labeltrue)
        guiSetVisible(zakladkatrue)
        guiSetText(zakladka"Witaj na BackToRPG!")
        guiSetText(label"Panel Pomocy")
        setElementData(localPlayer"notshowhud"true)
        setElementData(localPlayer"f1"true)
        showCursor(true)
        showChat(false)
        F1=true
    else
        if getElementData(localPlayer"player:radar:ko?owy"then
        setPlayerHudComponentVisible("radar",true)
        setElementData(localPlayer"nimaradaru"false)
        end
        removeEventHandler("onClientRender"getRootElement(), render)
        guiSetVisible(labelfalse)
        guiSetVisible(zakladkafalse)
        showCursor(false)
        showChat(true)
        setElementData(localPlayer"notshowhud"false)
        setElementData(localPlayer"f1"false)
        F1=false
    end
end
bindKey("F1""down"F1)


function convertNumber number )  
    local formatted number  
    while true do      
        formattedstring.gsub(formatted"^(-?%d+)(%d%d%d)"'%1,%2')    
        if ( k==then      
            break   
        end  
    end  
    return formatted
end



Podpis

Discord
zexty00
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-16, 00:23


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Jakie? b??dy?
Co masz na my?li m?wi?c, ?e nie dzia?a? Nie wy?wietla si?, jak klikasz to nic si? nie dzieje?

Czy elementy CeGUI tworz? si? nad elementami DX?
Pr?bowa?e? uruchomi? skrypt ale bez wszystkich element?w DX?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-08-16, 00:35


TheBAMBO

restMTA






Wiek: 22
Na forum: 2812 dni
Posty: 73
Nick w MP: zexty

Piwa: 12110

Respekt: 75,8

Wilq, gdy skrypt jest wlaczony, kazde inne gui itd w CGUI nie dzia?a, nie wiem w czym problem.

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: (dxdraw) :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku