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

Wysłany: 2018-03-29, 23:18


Insider







Wiek: 26
Na forum: 3000 dni
Posty: 5
Nick w MP: Yoshi

Piwa: 14

Respekt: 10,5

witam, chcia? bym do prac na serwerze doda? gui ?e jak wejdzie si? w marker to ?eby wy?wietla?o si? gui z rozpocz?ciem pracy oraz odbieraniem wyp?aty
za pomoc daje :piwo: oraz R* Z G?RY DZI?KUJE





NetLife - 10%
[/center]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-29, 23:27


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Po pierwsze utw?rz GUI po stronie clienta,

pracaPanelGUI false

function pracaGUI()

-- GUI
    
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


Po czym po stronie servera utw?rz marker po kt?rym otworzy si? GUI,

local markerPraca createMarker(xy,"cylinder"1255255255255)

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)


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Insider
Wysłany: 2018-03-30, 00:45


Insider







Wiek: 26
Na forum: 3000 dni
Posty: 5
Nick w MP: Yoshi

Piwa: 14

Respekt: 10,5

"Ciastuu?" napisał/a:

Po pierwsze utw?rz GUI po stronie clienta,

pracaPanelGUI false

function pracaGUI()

-- GUI
    
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


Po czym po stronie servera utw?rz marker po kt?rym otworzy si? GUI,

local markerPraca createMarker(xy,"cylinder"1255255255255)

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)




ju? tylko jak zrobi? button po kt?rym jak sie dopiero kliknie rozpoczyna sie praca bo jak wchodze w marker to tepa mn do pojazdu i pokazuje sie gui :/
chcesz mi pom?c stworzy? projekt serwera rpg?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-30, 01:01


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"Insider" napisał/a:

"Ciastuu?" napisał/a:

Po pierwsze utw?rz GUI po stronie clienta,

pracaPanelGUI false

function pracaGUI()

-- GUI
    
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


Po czym po stronie servera utw?rz marker po kt?rym otworzy si? GUI,

local markerPraca createMarker(xy,"cylinder"1255255255255)

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)




ju? tylko jak zrobi? button po kt?rym jak sie dopiero kliknie rozpoczyna sie praca bo jak wchodze w marker to tepa mn do pojazdu i pokazuje sie gui :/
chcesz mi pom?c stworzy? projekt serwera rpg?


Na pewno poradzisz Sobie w dalszych krokach. Za Ciebie zrobi?em i tak du?o. Niestety, nie mam na takie rzeczy czasu. Powodzenia w prowadzeniu serwera :)

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-30, 01:25


Insider







Wiek: 26
Na forum: 3000 dni
Posty: 5
Nick w MP: Yoshi

Piwa: 14

Respekt: 10,5

"Ciastuu?" napisał/a:

"Insider" napisał/a:

"Ciastuu?" napisał/a:

Po pierwsze utw?rz GUI po stronie clienta,

pracaPanelGUI false

function pracaGUI()

-- GUI
    
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


Po czym po stronie servera utw?rz marker po kt?rym otworzy si? GUI,

local markerPraca createMarker(xy,"cylinder"1255255255255)

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)




ju? tylko jak zrobi? button po kt?rym jak sie dopiero kliknie rozpoczyna sie praca bo jak wchodze w marker to tepa mn do pojazdu i pokazuje sie gui :/
chcesz mi pom?c stworzy? projekt serwera rpg?


Na pewno poradzisz Sobie w dalszych krokach. Za Ciebie zrobi?em i tak du?o. Niestety, nie mam na takie rzeczy czasu. Powodzenia w prowadzeniu serwera :)



ja dopiero pocz?tkuj?cy w skryptowaniu w przerabianiu dobrze juz ale nie zabardzo rozumiem co mam dalej zrobic :( :(

[ Dodano: 2018-03-30, 01:27 ]
[quote="Ciastuu?"][quote="Insider"][quote="Ciastuu?"][/quote]

w to miejsce gdzie jest --GUI mam cos wpisa? ?

function pracaGUI()

-- GUI

end

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-30, 01:44


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Owszem. Tam musisz wklei? kod wizualny gui

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-30, 08:40


xJakob







Wiek: 31
Na forum: 3661 dni
Posty: 164
Nick w MP: tylkoyolo

Piwa: 984

Respekt: 155,3
Respekt: 155,3Respekt: 155,3

Insider, robisz gui w guieditor i wtedy tam wklepujesz to gui. Chyba ?e nie wiesz co to gui ani guieditor to wtedy polecam si? pouczy? i dopiero zaczyna? prace w lua.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-03-30, 13:58


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"xJakob" napisał/a:

Insider, robisz gui w guieditor i wtedy tam wklepujesz to gui. Chyba ?e nie wiesz co to gui ani guieditor to wtedy polecam si? pouczy? i dopiero zaczyna? prace w lua.


Je?eli b?dzie mia? z tym problem mog? mu podes?a? na funkcjach dx[...] proste gui, kt?rym b?dzie m?g? si? wzorowa? w dalszych naukach lua :)

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Tagi: jak :: dodać :: gui :: prac?
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