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

Wysłany: 2021-01-21, 12:48


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3200 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Siemka mam problem, chc? zrobi? aby po wej?ciu w marker pokazywa?o si? gui ale niestety nie dzia?a.
Jak zrobie po samym cliencie to pokazuje si? ka?demu a chce aby pokazywa?o si? temu co wejdzie w ten marker

client:
gui = false

function panel()
    dxDrawImage(0/zoom, 0/zoom, 1920/zoom, 1080/zoom, "tlo.png")
    dxDrawText("Napis", 0/zoom, 10/zoom, 1920/zoom, 1080/zoom, tocolor(255, 255, 255), 2, "pricedown", "center", "top")
end

addEvent("pokaz:gui", true)
addEventHandler("pokaz:gui", root, function()
    gui = true
    showCursor(true)
    addEventHandler("onClientRender", root, panel)
end)


server:
local marker = createMarker(1432.24, 1241.20, 14.43, "cylinder", 1, 120, 50, 30, 200)
setElementDimension(marker, 11)

addEventHandler("onMarkerHit", marker, function(el, md)
    if getElementType(el) ~= "player" then return end
    if isPedInVehicle(el) then return end
    if not md then return end
        triggerClientEvent(el, "pokaz:gui", el)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-21, 13:32


Mikołajj







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

Piwa: 132

Respekt: 91

Spr?buj zmieni? server na:

local marker = createMarker(1432.24, 1241.20, 14.43, "cylinder", 1, 120, 50, 30, 200)
setElementDimension(marker, 11)

addEventHandler("onPlayerMarkerHit", root, function(mar, md)
    if mar == marker and md then
    if isPedInVehicle(source) then return end
        triggerClientEvent(source, "pokaz:gui", source)
    end
end)


i client:

gui = false

function panel()
    dxDrawImage(0/zoom, 0/zoom, 1920/zoom, 1080/zoom, "tlo.png")
    dxDrawText("Napis", 0/zoom, 10/zoom, 1920/zoom, 1080/zoom, tocolor(255, 255, 255), 2, "pricedown", "center", "top")
end

addEvent("pokaz:gui", true)
addEventHandler("pokaz:gui", root, function()
    gui = true
    showCursor(true)
    addEventHandler("onClientRender", localPlayer, panel)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-21, 15:05


Yami

Mapper / Uczeń LUA






Wiek: 25
Na forum: 3200 dni
Posty: 379

Piwa: 97

Respekt: 235
Respekt: 235Respekt: 235

Niestety dalej to samo :/
Nic si? nie dzieje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-21, 17:10


Mikołajj







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

Piwa: 132

Respekt: 91

m?j b??d, client:

gui = false

function panel()
    dxDrawImage(0/zoom, 0/zoom, 1920/zoom, 1080/zoom, "tlo.png")
    dxDrawText("Napis", 0/zoom, 10/zoom, 1920/zoom, 1080/zoom, tocolor(255, 255, 255), 2, "pricedown", "center", "top")
end

addEvent("pokaz:gui", true)
addEventHandler("pokaz:gui", localPlayer, function()
    gui = true
    showCursor(true)
    addEventHandler("onClientRender", root, panel)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-21, 21:15


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Albo najzwyklejszy kod po kliencie, upewnij si? ?e definiujesz zmienn? "zoom":

local script = {}
script.marker = createMarker(1432.24, 1241.20, 14.43, "cylinder", 1, 120, 50, 30, 200)
setElementDimension(script.marker, 11)

script.dxDraw = function()
    dxDrawImage(0/zoom, 0/zoom, 1920/zoom, 1080/zoom, "tlo.png")
    dxDrawText("Napis", 0/zoom, 10/zoom, 1920/zoom, 1080/zoom, tocolor(255, 255, 255), 2, "pricedown", "center", "top")
end

addEventHandler("onClientMarkerHit", marker, function(thePlayer, matchingDimension)
    if (thePlayer ~= getLocalPlayer()) or (getElementType(thePlayer) ~= "player") or (not matchingDimension) or (getPedOccupiedVehicle(thePlayer)) then
        return
    end
    showCursor(true)
    addEventHandler("onClientRender", getLocalPlayer(), script.dxDraw)
end)


Postaw piwo autorowi tego posta
 

 
Tagi: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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