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

Wysłany: 2018-09-01, 15:46


JakisPolak199

wieczny student






Wiek: 21
Na forum: 3651 dni
Posty: 131
Nick w MP: bover.

Piwa: 906

Respekt: 150
Respekt: 150Respekt: 150

Witam, ponownie przychodze z problemem, ze gui sie nie chce wyswietlic tym razem po wejsciu w marker oto kod:


teoriaAPokaz = false
teoriaBPokaz = false
teoriaCPokaz = false
local screenW, screenH = guiGetScreenSize()

local teoriaA = createMarker (2489.12, -1686.21, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaA, 1)
local textA = createElement("text")
setElementData(textA, "name", "Cz??? teoretyczna prawa jazdy kat.A")
setElementPosition(textA, 2489.12, -1686.21, 51.95)
setElementInterior(textA, 1)

local teoriaB = createMarker (2471.55, -1676.93, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaB, 1)
local textB = createElement("text")
setElementData(textB, "name", "Cz??? teoretyczna prawa jazdy kat.B")
setElementPosition(textB, 2471.55, -1676.93, 51.95)
setElementInterior(textB, 1)

local teoriaC = createMarker (2499.44, -1672.87, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaC, 1)
local textC = createElement("text")
setElementData(textC, "name", "Cz??? teoretyczna prawa jazdy kat.C")
setElementPosition(textC, 2499.44, -1672.87, 51.95)
setElementInterior(textC, 1)

addEventHandler("onMarkerLeave", teoriaA, function(plr)
if teoriaAPokaz == true then
    teoriaAPokaz = false
    removeEventHandler("onClientRender", root, teoriaAGui)
end
end)

addEventHandler("onMarkerHit", teoriaA, function(plr)
if teoriaAPokaz == false then
    teoriaAPokaz = true
    addEventHandler("onClientRender", root, teoriaAGui)
end
end)

function teoriaAGui()
    if teoriaAPokaz then
        dxDrawRectangle(screenW * 0.3661, screenH * 0.0004, screenW * 0.2690, screenH * 0.9999, tocolor(0, 0, 0, 168), false)
    end
end


Podpis
Kontakt mailowo: [email protected]
Kontakt Discord: bover.

Portfolio: https://boversoneg.github.io/

socialproject.pl // discord.gg/socialproject
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-01, 16:48


Mikołajj







Wiek: 23
Na forum: 3026 dni
Posty: 303
Nick w MP: Mikołaj

Piwa: 132

Respekt: 91

To jest na pewno client-side?
Spr?buj tak:

local screenW, screenH = guiGetScreenSize()

local teoriaAPokaz = false
local teoriaBPokaz = false
local teoriaCPokaz = false

local teoriaA = createMarker (2489.12, -1686.21, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
    setElementInterior(teoriaA, 1)
local textA = createElement("text")
    setElementData(textA, "name", "Cz??? teoretyczna prawa jazdy kat.A")
    setElementPosition(textA, 2489.12, -1686.21, 51.95)
    setElementInterior(textA, 1)

local teoriaB = createMarker (2471.55, -1676.93, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
    setElementInterior(teoriaB, 1)
local textB = createElement("text")
    setElementData(textB, "name", "Cz??? teoretyczna prawa jazdy kat.B")
    setElementPosition(textB, 2471.55, -1676.93, 51.95)
    setElementInterior(textB, 1)

local teoriaC = createMarker (2499.44, -1672.87, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
    setElementInterior(teoriaC, 1)
local textC = createElement("text")
    setElementData(textC, "name", "Cz??? teoretyczna prawa jazdy kat.C")
    setElementPosition(textC, 2499.44, -1672.87, 51.95)
    setElementInterior(textC, 1)

addEventHandler("onClientRender", root, function()
    if teoriaAPokaz == true then
        dxDrawRectangle(screenW * 0.3661, screenH * 0.0004, screenW * 0.2690, screenH * 0.9999, tocolor(0, 0, 0, 168), false)
    end
end)

addEventHandler("onClientMarkerHit", teoriaA, function(el)
    if el ~= localPlayer then return end
        if teoriaAPokaz == false then
            teoriaAPokaz = true
    end
end)


Ostatnio zmieniony przez Mikołajj 2018-09-01, 17:03, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-01, 16:53


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wykorzystaj event onClientMarkerHit oraz onClientMarkerLeave, w ko?cu to client-side tak?
onMarkerHit oraz onMarkerLeave jest u?ywany do server-side.

https://wiki.multitheftauto.com/wiki/OnClientMarkerHit

https://wiki.multitheftauto.com/wiki/OnClientMarkerLeave

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-01, 17:00


Qwertick

Coming soon...






Wiek: 23
Na forum: 3718 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2727

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

teoriaAPokaz = false
teoriaBPokaz = false
teoriaCPokaz = false
local screenW, screenH = guiGetScreenSize()

local teoriaA = createMarker (2489.12, -1686.21, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaA, 1)
local textA = createElement("text")
setElementData(textA, "name", "Cz??? teoretyczna prawa jazdy kat.A")
setElementPosition(textA, 2489.12, -1686.21, 51.95)
setElementInterior(textA, 1)

local teoriaB = createMarker (2471.55, -1676.93, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaB, 1)
local textB = createElement("text")
setElementData(textB, "name", "Cz??? teoretyczna prawa jazdy kat.B")
setElementPosition(textB, 2471.55, -1676.93, 51.95)
setElementInterior(textB, 1)

local teoriaC = createMarker (2499.44, -1672.87, 51.95-1, "cylinder", 1.5, 255, 255, 255, 150)
setElementInterior(teoriaC, 1)
local textC = createElement("text")
setElementData(textC, "name", "Cz??? teoretyczna prawa jazdy kat.C")
setElementPosition(textC, 2499.44, -1672.87, 51.95)
setElementInterior(textC, 1)

addEventHandler("onClientMarkerLeave", teoriaA, function(plr)
if teoriaAPokaz == true then
    teoriaAPokaz = false
    removeEventHandler("onClientRender", root, teoriaAGui)
end
end)

addEventHandler("onClientMarkerHit", teoriaA, function(plr)
if teoriaAPokaz == false then
    teoriaAPokaz = true
    addEventHandler("onClientRender", root, teoriaAGui)
end
end)

function teoriaAGui()
    if teoriaAPokaz then
        dxDrawRectangle(screenW * 0.3661, screenH * 0.0004, screenW * 0.2690, screenH * 0.9999, tocolor(0, 0, 0, 168), false)
    end
end


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-01, 17:26


JakisPolak199

wieczny student






Wiek: 21
Na forum: 3651 dni
Posty: 131
Nick w MP: bover.

Piwa: 906

Respekt: 150
Respekt: 150Respekt: 150

Dzia?a mo?na zamyka? @lock

Podpis
Kontakt mailowo: [email protected]
Kontakt Discord: bover.

Portfolio: https://boversoneg.github.io/

socialproject.pl // discord.gg/socialproject
Postaw piwo autorowi tego posta
 

 
Tagi: gui :: sie :: nie :: wyswietla
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