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

Wysłany: 2018-03-31, 03:07


Vintage







Wiek: 23
Na forum: 3555 dni
Posty: 64

Piwa: 1

Respekt: 45,8

witam robie ammunation shop i chcia?em zrobi? marker z gui i nie pokazuje mi gui po wej?ciu w marker

C_SIDE



pracaPanelGUI false

function pracaGUI()

        dxDrawRectangle(498207415403tocolor(000200), false)
  --      dxDrawImage(524320389285":guied/images/AK47.png"000tocolor(255255255255), false)
        dxDrawText("AK-47 CENA 5000 PLN"497207913296tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)

    
end

    
addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
    if not pracaPanelGUI then return end
        if Mysz(xyxythen
        outputChatBox("Rozpocz??e? prac?")
        ukryjGUI(localPlayer)
        end
    end
end)
    
addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if Mysz(xyxythen
        showCursor(false)
        removeEventHandler("onClientRender",root,pracaGUI)
        end
    end
end)
    
function pokazGUI(plr)
if plr ~= localPlayer then return end
addEventHandler("onClientRender",root,pracaGUI)
showCursor(true,true)
pracaPanelGUI true
end
addEvent("pracaPanelGUI:pokaz",true)
addEventHandler("pracaPanelGUI:pokaz",root,pokazGUI)

function ukryjGUI(plr)
if plr ~= localPlayer then return end
removeEventHandler("onClientRender",root,pracaGUI)
showCursor(false)
pracaPanelGUI false
end
addEvent("pracaPanelGUI:schowaj",true)
addEventHandler("pracaPanelGUI:schowaj",root,ukryjGUI)

function Mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end


S_SIDE



local markerPraca createMarker(296.08, -80.811001.52-0.9 ,"cylinder"12550,0)
setElementInterior(markerPraca4)
function markerPracaWejdz(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(elementthen return end
triggerClientEvent(element,"pracaPanelGUI:pokaz",element)
end
addEventHandler("onMarkerHit",markerPraca,markerPracaWejdz)


function markerPracaOpusc(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(elementthen return end
triggerClientEvent(element,"pracaPanelGUI:schowaj",element)
end
addEventHandler("onMarkerLeave",markerPraca,markerPracaOpusc)



DB3 :

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-31, 10:30


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

HerbatnikTv, Czy nie lepiej marker umie?ci? po stronie clienta i tam dodawa? eventHandler?
Wtedy kod wygl?da?by tak:


addEventHandler("onClientMarkerHit",resourceRoot,function(el,dim)
if el ~= localPlayer and dim then return end
if getElementType(el) ~= "player" then return end



Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-16, 17:24


Vintage







Wiek: 23
Na forum: 3555 dni
Posty: 64

Piwa: 1

Respekt: 45,8

Atroth, nie wiem co? mi nie wychodzi

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-16, 17:28


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

jak restartujesz kod to od razu wchodzisz w ten marker? eventy potrzebuja X milisekund zeby sie stworzyc, a sam b??d wskazuje na to, ze nie istnieje w ogole taki event.

+ podmien te funkcje


function pokazGUI()
addEventHandler("onClientRender",root,pracaGUI)
showCursor(true,true)
pracaPanelGUI true
addEvent("pracaPanelGUI:pokaz",true)
addEventHandler("pracaPanelGUI:pokaz",root,pokazGUI)


Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-23, 15:24


Qwertick

Coming soon...






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

Piwa: 2726

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

Zobacz to
triggerClientEvent(element,"pracaPanelGUI:pokaz",root)


Postaw piwo autorowi tego posta
 

 
Tagi: gui :: się :: nie :: pokazuje
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