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 oraz Z G?RY DZI?KUJE
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(x, y, x, y) then
outputChatBox("Rozpocz??e? prac?")
ukryjGUI(localPlayer)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if Mysz(x, y, x, y) then
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(x, y, z ,"cylinder", 1, 255, 255, 255, 255)
function markerPracaWejdz(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then return end
triggerClientEvent(element,"pracaPanelGUI:pokaz",element)
end
addEventHandler("onMarkerHit",markerPraca,markerPracaWejdz)
function markerPracaOpusc(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then 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?
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(x, y, x, y) then
outputChatBox("Rozpocz??e? prac?")
ukryjGUI(localPlayer)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if Mysz(x, y, x, y) then
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(x, y, z ,"cylinder", 1, 255, 255, 255, 255)
function markerPracaWejdz(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then return end
triggerClientEvent(element,"pracaPanelGUI:pokaz",element)
end
addEventHandler("onMarkerHit",markerPraca,markerPracaWejdz)
function markerPracaOpusc(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then 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
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(x, y, x, y) then
outputChatBox("Rozpocz??e? prac?")
ukryjGUI(localPlayer)
end
end
end)
addEventHandler("onClientClick", root, function(btn,state)
if btn=="left" and state=="down" then
if Mysz(x, y, x, y) then
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(x, y, z ,"cylinder", 1, 255, 255, 255, 255)
function markerPracaWejdz(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then return end
triggerClientEvent(element,"pracaPanelGUI:pokaz",element)
end
addEventHandler("onMarkerHit",markerPraca,markerPracaWejdz)
function markerPracaOpusc(element)
if getElementType(element) ~= "player" then return end
if getPedOccupiedVehicle(element) then 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
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.
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
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