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

Wysłany: 2017-06-24, 19:52


admiral123







Wiek: 29
Na forum: 3417 dni
Posty: 16

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Witam mam problem z dxDrawText. Po wej?ciu do auta, kt?re ma w sobie po stronie servera w pracy: setElementData(source, "pojazd") nie pokazuje si? nic. Jak to naprawi? za pomoc piwko!



kod:

local screenW, screenH = guiGetScreenSize()    
if getElementData(localPlayer, "pojazd") then
        exports["nm-blur"]:dxDrawBluredRectangle(screenW * 0.7438, screenH * 0.1289, screenW * 0.2379, screenH * 0.0599, tocolor(150, 150, 150, 255))
        dxDrawRectangle(screenW * 0.7387, screenH * 0.1289, screenW * 0.0051, screenH * 0.0599, tocolor(25, 75, 125, 155), false)
        local poziom = getElementData(localPlayer, "mlvl")
        local exp = getElementData(localPlayer, "mexp")
        dxDrawText("Tw?j poziom: "..poziom, (screenW * 0.7511) + 1, (screenH * 0.1289) + 1, (screenW * 0.8631) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j poziom: "..poziom, screenW * 0.7511, screenH * 0.1289, screenW * 0.8631, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j exp: "..exp, (screenW * 0.8697) + 1, (screenH * 0.1289) + 1, (screenW * 0.9817) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j exp: "..exp, screenW * 0.8697, screenH * 0.1289, screenW * 0.9817, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
    end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 19:54


Makay

Tryb .lua






Wiek: 26
Na forum: 3429 dni
Posty: 38
Nick w MP: Makay

Piwa: 774

Respekt: 40,5

Ostrzeżeń: 100%
admiral123, To jest chyba tylko do pracy magazyniera.

Podpis
Początkowy Programista LUA

[lua]if getElementData(source, "gracz:Makay") then
setPlayerName(source, "Makauś")
else
setPlayerName(source, ".lua")
end[/lua]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 20:02


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

na pewno localPlayer?

getElementData(localPlayer, "pojazd")


Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 21:10


admiral123







Wiek: 29
Na forum: 3417 dni
Posty: 16

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
amited, Tak, to jest po stronie klienta w gui.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-24, 22:00


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

admiral123, m?wisz ?e pojazd ma elementDat? "pojazd" a nie gracz, chyba ?e ?le zrozumia?em

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-25, 10:35


NeX.

Calm Story






Wiek: 26
Na forum: 3785 dni
Posty: 56
Nick w MP: NeX

Piwa: 36

Respekt: 140
Respekt: 140

Skoro jest to po stronie clienta w 'gui', to gui pojawia si? w tym przypadku tylko na jedn? setn? sekundy i nagle znika.


local screenW, screenH = guiGetScreenSize()
function render()
if getElementData(localPlayer, "pojazd") then
        exports["nm-blur"]:dxDrawBluredRectangle(screenW * 0.7438, screenH * 0.1289, screenW * 0.2379, screenH * 0.0599, tocolor(150, 150, 150, 255))
        dxDrawRectangle(screenW * 0.7387, screenH * 0.1289, screenW * 0.0051, screenH * 0.0599, tocolor(25, 75, 125, 155), false)
        local poziom = getElementData(localPlayer, "mlvl")
        local exp = getElementData(localPlayer, "mexp")
        dxDrawText("Tw?j poziom: "..poziom, (screenW * 0.7511) + 1, (screenH * 0.1289) + 1, (screenW * 0.8631) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j poziom: "..poziom, screenW * 0.7511, screenH * 0.1289, screenW * 0.8631, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j exp: "..exp, (screenW * 0.8697) + 1, (screenH * 0.1289) + 1, (screenW * 0.9817) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        dxDrawText("Tw?j exp: "..exp, screenW * 0.8697, screenH * 0.1289, screenW * 0.9817, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
    end
end
addEventHandler("onClientRender",getRootElement(),render)


Podpis
Wykonuję zasoby programistyczne w języku lua. Osoby zainteresowane proszone są o kontakt.
[email protected]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-25, 22:20


Jacob

Głupiomądry






Wiek: 28
Na forum: 5644 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Koledze chodzi?o o to, ?e w pierwszym po?cie napisa?e?, ?e t? date posiada pojazd, a nie bezpo?rednio grasz. Wi?c wnioskuj?c po tym:
function render()
    if isPedInVehicle(localPlayer) then
        if getElementData(getPedOccupiedVehicle(localPlayer), "pojazd") then
            exports["nm-blur"]:dxDrawBluredRectangle(screenW * 0.7438, screenH * 0.1289, screenW * 0.2379, screenH * 0.0599, tocolor(150, 150, 150, 255))
            dxDrawRectangle(screenW * 0.7387, screenH * 0.1289, screenW * 0.0051, screenH * 0.0599, tocolor(25, 75, 125, 155), false)
            local poziom = getElementData(localPlayer, "mlvl")
            local exp = getElementData(localPlayer, "mexp")
            dxDrawText("Tw?j poziom: "..poziom, (screenW * 0.7511) + 1, (screenH * 0.1289) + 1, (screenW * 0.8631) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
            dxDrawText("Tw?j poziom: "..poziom, screenW * 0.7511, screenH * 0.1289, screenW * 0.8631, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
            dxDrawText("Tw?j exp: "..exp, (screenW * 0.8697) + 1, (screenH * 0.1289) + 1, (screenW * 0.9817) + 1, (screenH * 0.1888) + 1, tocolor(0, 0, 0, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
            dxDrawText("Tw?j exp: "..exp, screenW * 0.8697, screenH * 0.1289, screenW * 0.9817, screenH * 0.1888, tocolor(255, 255, 255, 255), 1.00, wFont2, "left", "center", false, false, false, false, false)
        end
    end
end
addEventHandler("onClientRender",getRootElement(),render)


Postaw piwo autorowi tego posta
 

 
Tagi: dxdrawtext
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » dxDrawText 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