Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: gui
121. Poruszanie się po GUI
Witam, chcia?bym zapyta? w jaki spos?b zrobi? poruszanie si? strza?kami w d?? i w g?r? po GUI, za pomoc daje piwo.
122. 3D gui
Witam, przychodz? z takim pytankiem i? zabieram si? za robienie rzeczy 3d. Nie wiem czy tak to mog? nazwa?, ale chcia?bym zrobi? co? w stylu tego:
[img]https://i.imgur.com/KtVCXgK.png[/img]

Je?eli kto? by m?g? mnie nakierowa? co i jak to odwdzi?cz? si? piwkiem. :)

Spr?bowa?em co? takiego ale nic si? nie dzieje... ;/

[lua]
function getPositionFromElementOffset(element,offX,offY,offZ)
local m = getElementMatrix ( element ) -- Get the matrix
local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform
local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2]
local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3]
return x, y, z -- Return the transformed point
end

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function()
render = dxCreateRenderTarget( 796, 512, true )
addEventHandler('onClientRender', root, draw3DMenu )
end)

function draw3DMenu()
x, y, z = getPositionFromElementOffset(localPlayer,0,1,1.2)
x2, y2, z2 = getPedBonePosition( localPlayer, 8 )
dxSetRenderTarget( render, true )
dxDrawRectangle( 0, 0, 796, 512, tocolor(0,0,0,150))
dxDrawText('test', 32, 32, 764, 64, tocolor( 255, 255, 255, 255), 2.4, 'sans', 'left', 'center', true, true)
dxSetRenderTarget()
dxDrawMaterialLine3D( x, y, z, x, y, z, render, 2.4, tocolor(255...
123. GUI
Siema
Ot?? mam taki problem ?e nie wiem gdy stworz? sobie GUI to chcia?bym aby pokaza?o si? ono gdy wejde w marker, natomiast mi to nie wychodzi

Za pmoc daje :piwo:
124. Cegui zmiana na normalne gui
Tak jak w temacie
Zrobi?em gui oparte o cegui aczkolwiek chcia?bym teraz zmieni? to pod normalne gui, wiem jak aczkolwiek nie do ko?ca.
[lua]addEventHandler("onClientResourceStart", resourceRoot,
function()
rh = guiCreateWindow(282, 559, 220, 184, "Zawieszenie pneumatyczne", false)
guiWindowSetSizable(rh, false)
guiWindowSetMovable(rh, true)

gora = guiCreateButton(9, 23, 200, 61, "Podwy?sz", false, rh)
dol = guiCreateButton(9, 103, 200, 61, "Obni?", false, rh)
guiSetVisible(rh, false)
end
)
addEventHandler("onClientGUIClick", resourceRoot, function(btn)
local veh = getPedOccupiedVehicle(localPlayer)
if source == gora then
triggerServerEvent("rh:p", root, veh)
elseif source == dol then
triggerServerEvent("rh:o", root, veh)
end
end)

function patch()
local veh = getPedOccupiedVehicle(localPlayer)
if not veh then
if rh and ( guiGetVisible ( rh ) == true ) then
guiSetVisible(rh, false)
end
end
end
addEventHandler("onClientRender", root, patch)

function show()
guiSetVisible(rh, true)
end
addEvent( "rhshow", true )
addEventHandler( "rhshow", root, show )
fileDelete("c.lua")[/lua]

[lua] rh = guiCreateWindow(282, 559, 220, 184, "Zawieszenie pneumatyczne", false)[/lua]
Chc? zast?pi? dxdrawimage, a
[lua] gora = guiCreateButton(9, 23, 200, 61, "Podw...
125. Gui pokazuje sie dla wszystkich
Witam mam taki problem, ?e gui pokazuje si? dla wszystkich. kod jest po stronie clienta kod:
[lua]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)

ad...
126. Gui sie nie wyswietla 2
Witam, ponownie przychodze z problemem, ze gui sie nie chce wyswietlic tym razem po wejsciu w marker oto kod:

[lua]
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)
...
127. Gui się nie wyświetla
witam pisze skrypt na osiagniecia ale gui nie chce sie wyswietlic oto kod:


--[[
Autor Skryptubover.
PrawaCreative commons
]]--
local screenWscreenH guiGetScreenSize()]
tak false

addCommandHandler
("og", function(plr)
if 
tak == true then
    tak 
false
else
    
tak true
end
end
)

function 
pokaz(plr
if 
tak == false then return end
dxDrawRectangle
(screenW 0.3661screenH 0.0004screenW 0.2690screenH 0.9999tocolor(000168), false)
end


Stawiam :piwo: i R* za pomoc
128. Gui
Witajcie u?ytkownicy forum gtao.pl chcia?bym spyta? jak po??czy? prac? z gui czyli wchodzimy w marker pokazuje si? gui z napisem rozpocznij po czym naciska si? rozpocznij i gracz wykonuje prace

local pokazgui createMarker(2110.45776367191666.298583984410.8203125-0.9"cylinder"100255100)

    
local panel guiCreateWindow(400,193,566,382,"Praca nr1",false)
    
guiWindowSetSizable(panel,false)

    
local rozpocznij guiCreateButton(167,118,248,55,"Rozpocznij",false,panel)

function 
Pokazpanel()
    
guiSetVisible(panel,true)
    
showCursor(true)
end
addEventHandler
("onClientMarkerHit",pokazgui,Pokazpanel)

function 
Schowajpanel()
    
guiSetVisible(panel,false)
    
showCursor(false)
end
addEventHandler
("onClientMarkerLeave",pokazgui,Schowajpanel)
129. jak zrobić żeby gui się włączało
GUIEditor = {
    
staticimage = {}
}
    function 
tuning()
        
GUIEditor.staticimage[1] = guiCreateStaticImage(387167554410":K_pojazdy-tuning/TLO/tlo.png"true)
        
GUIEditor.staticimage[2] = guiCreateStaticImage(2924138134":K_pojazdy-tuning/US/ulepszsilnik.png"true
        
GUIEditor.staticimage[3] = guiCreateStaticImage(39024139136":K_pojazdy-tuning/NAPED/AWD.png"true)
        
GUIEditor.staticimage[4] = guiCreateStaticImage(30254137135":K_pojazdy-tuning/NAPED/FWD.png"true
        
GUIEditor.staticimage[5] = guiCreateStaticImage(390254137136":K_pojazdy-tuning/NAPED/RWD.png"true
        
GUIEditor.staticimage[6] = guiCreateStaticImage(2401687574":K_pojazdy-tuning/EXIT/EXIT.png"true)
    
end
marker 
createMarker ( -2328.54297, -168.0212933.83862"cylinder"3.000180200 )

addEventHandler("onClientMarkerHit"marker, function()
    
guiSetVisible(GUIEditor.staticimage[1], true)
    
guiSetVisible(GUIEditor.staticimage[2], true)
    
guiSetVisible(GUIEditor.staticimage[3], true)
    
guiSetVisible(GUIEditor.staticimage[4], true)
    
guiSetVisible(GUIEditor.staticimage[5], true)
    
guiSetVisible(GUIEditor.staticimage[6], true)
    
showCursor(false)
end)


nie wiem jak to zrobi? jak kto? wie to pomo?e kto??
130. Gui wyskakuje wszystkim
server:
[lua]
addEvent("ZmienHandling2", true)
addEventHandler("ZmienHandling2", root, function()
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 1500)
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

setVehicleHandling(pojazd, "maxVelocity", 200.0 )--MK1 Pr?dko??
setVehicleHandling(pojazd, "maxVelocity", velocity)
end
)


addEvent("ZmienHandling", true)
addEventHandler("ZmienHandling", root, function()
pojazd = getPedOccupiedVehicle(source)--MK 1 Przy?pieszenie
if not pojazd then return end
takePlayerMoney ( source, 3000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

local acceleration = 15.0
setVehicleHandling(pojazd, "engineAcceleration", acceleration )
end
)


addEvent("ZmienHandling5", true)
addEventHandler("ZmienHandling5", root, function()--MK2 Pr?dko??
pojazd = getPedOccupiedVehicle(source)
if not pojazd then return end
takePlayerMoney ( source, 10000 )
outputChatBox("Pomy?lnie Zamontowano tuning.", source,true)

setVehicleHandling(pojazd, "maxVelocity", 250.0 )
setVehicleHandling(pojazd, "maxVelocity", velocity)
end
)

addEvent("ZmienHandling4", true)
addEventHandler("ZmienHandling4", root, function()--MK2 Przy?pieszenie
pojazd = getPedOccupiedVehicle(source)
if not poja...
131. Marker łapie GUI gdy jestem na drugim piętrze.
Witam, przychodz? z problemem gdy? po prostu mam 2 pi?trowy interior i gdy wchodze do g?ry to marker z do?u ?apie. Czy da si? to jako? naprawi??

Za pomoc stawiam :piwo:
132. nie pokazuje sie gui
witam pr?buj? odbugowa? paczke stories rpg i mam taki problem i? gdy? nie pojawia mi sie gui jak chce wystawic auto na gielde gdy auto jest zniszczone i wjade w market to jest napisane ze auto jest uszkodzone a jesli auto nie jest uszkodzone i wszystko jest okej gdy wje?d?am w marker nic sie nie pokazuje 0 reakcji tu macie kod


[quote]
local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local w,h=(screenW/1680), (screenH/1050)
local font=dxCreateFont("f.ttf", 11)
local font2=dxCreateFont("f.ttf", 12)
local font3=dxCreateFont("f.ttf", 14)
local img=dxCreateTexture("i/sale.png")


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
local pokapoka=false

function gui()
dxDrawImage(645*w, 293*h, 384*w, 451*h, "i/bggielda.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)


dxDrawText("Wpisz cene za jak? ma by? wystawiony tw?j pojazd.", 664*w, 368*h, 1013*w, 480*h, tocolor(255, 255, 255, 255), 1.00*w, font, "center", "center", false, false, false, false, false)


dxDrawImage(755*w, 688*h, 161*w, 46*h, "i/btn.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
...
133. GUI
Witam,posiadam taki problem ?e chcia?bym aby po wej?ciu w marker pojawia?o si? gui
niestety pr?bowa?em na r??ne sposoby i mi jako? nie wychodzi.
[lua]local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-ViewnZAROBEK:nOD 75PLN-150PLNnOPIS: Identyfikowanie mapy")
setElementPosition(b,-1990.74, 957.88, 45.45)


local zone = createColSphere(-1986.58, 955.03, 45.54,3 )
createBlip(-1984.40, 953.92, 45.45, 46,2,0,0,0,0,0,275)
local m1 = createMarker(-1990.74, 957.88, 45.45-1, "cylinder", 1.5, 35, 142, 35)
vehs = {}
local code = "StreetView"
veh_obj = {}

function removePreviousVehicles(plr)
for i,v in ipairs(getElementsByType("vehicle", resourceRoot)) do
local sby = getElementData(v, "zrespilGracz")
if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
destroyElement(v)
end
end
end

addEventHandler("onClientRender", root,
function siema()
dxDrawRectangle(387, 70, 524, 405, tocolor(48, 34, 35, 255), false)
end
)

addEventHandler("onMarkerHit", m1, function(el, md)
if getElementData(el, "vehicle_job_owner2") then
outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!", el)
return
end

if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(el) then return end
if getElementData(el,"player:...
134. Skrypt na gui
Witam, mam problem ze skryptem na gui serwera. Po uruchomieniu skryptu wywala errora.
Error: https://i.imgur.com/eYfV0JU.png?1

main_c.lua linijka 57:
local coords = {getScreenFromWorldPosition(bone[1], bone[2], bone[3]+checkLevel(v))}

Prosz? o pomoc, stawiam :piwo: i R*
135. Roleta - dźwięk przy kliknięciu przycisku w GUI
Cze??, zwracam si? do was z kolejnym problemem :/
Mam skrypt na rolety w poje?dzie wszystko dzia?a lecz,
doda?em funkcj? kt?ra odtwarza d?wi?ki podczas otwarcia i zamkni?cia. D?wi?k przy otwarciu gui odtwarza si? ale przy zamykaniu ju? nie. Je?li kto? wie dlaczego nie dzia?a b?d? bardzo wdzi?czny je?li kto? naprawi. Kod jest poni?ej

Kod:

function roleta(hitPlayer)
if hitPlayer == GUIEditor.button[13] then return end
if hitplayer == localPlayer then
playSound("tech_auf.wav")
end
end
addEventHandler ( "onClientGUIClick", root, roleta)
136. Pobieranie peda do GUI
Witam, przychodz? z pytaniem, gdy? pisz? sobie dashboard i wpad?em na pomys?, ?eby pobiera?o naszego peda i jego ID tzn."wkleja?o" do gui.
Kto? m?g?by mnie nakierowa? jak? funkcj? to zrobi? czy co??

Chodzi mi o co? takiego:
137. GUI
witajcie mam problem bo zrobi?em gui dzia?ajace i doda?em butony no i one s? w innej pozycji ni? ca?e gui ca?y panel .. i chcia?bym aby kto? pom?g? mi to zrobi? poprawnie tutaj udost?pniam kod i ss

kod [lua] local marker = createMarker ( 1034.4647216797,-1338.8609619141,13.7265625-1 , "cylinder" , 0.8,255,255,0)


Panel = guiCreateWindow(600, 300, 336, 207, "Automat z napojami", false)
guiWindowSetSizable(Panel, false)

AddKamizelka = guiCreateButton(9, 31, 137, 67, "Cola + 5 HP ", false)
AddUSPs = guiCreateButton(207, 36, 119, 62, "Lipton + 7 HP", false)
AddM4A1S = guiCreateButton(9, 121, 137, 76, "Mountain Dew + 10 HP ", false)
AddAK47 = guiCreateButton(203, 116, 123, 81, "Red Bull + 12 HP", false)
guiSetVisible(Panel, false)
guiSetVisible(Panel, false)
guiSetVisible(AddKamizelka, false)
guiSetVisible(AddUSPs, false)
guiSetVisible(AddM4A1S,false)
guiSetVisible(AddAK47,false)

addEventHandler("onClientGUIClick",root,function ()
if source == AddKamizelka then
setElementHealth ( localPlayer, getElementHealth(localPlayer) + 5 )
triggerServerEvent ("Cash", localPlayer, "take", 3)
outputChatBox (" Z maszyny wylatuje puszka napoju * Cola *")
outputChatBox (" Wypi?e? * Cola * zap?aci?e? 3$")
elseif source == AddUSPs then
setElementHealth ( localPlayer, getElementHealth(localPlayer) + 7 )
triggerServerEvent (&q...
138. GUI
Witam, przychodz? z pytaniem, takim i?; mam takie buttony



A grafik mi zrobi? nowe, i jak je podmieni? ? za odpowied? kt?r? zrozumiem stawiam piwo i repke.
139. Zbugowane gui
Siemka pisze do was z takim zapytaniem czy ktos by tutaj ogarnal by ktos to ?e jak wchodze w marker gui si? wyswietla wszystkim na serwerze, ale chcialbym zeby wyswietlal si? tylko mi.

Za pomoc daje piwko



GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(0.22, 0.34, 0.13, 0.33, "Panel", true)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.72)

GUIEditor.button[2] = guiCreateButton(10, 137, 147, 47, "Zamknij okno", false, GUIEditor.window[1])
end
)


addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)



function spod()
for i,v in ipairs(Marker) do
ta(v,rodzaj);
x, y, z = getElementPosition(v)
dxDrawOctagon3D(x,y,z+0.1, 0.8, 2, tocolor(0,0,255,150) )

end
end
addEventHandler("onClientRender", getRootElement(), spod)

function ta(TheElement,Image,distance,height,width,R,G,B,alpha)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local width = width or 1
local checkBuildings = checkBuildings or true
local checkVehicles = checkVehi...
140. Wyświetlanie gui
Witam was tym razem z kolejnym problemem. M?cz? si? nad nim ju? drugi dzie? i nie mam poj?cia co mo?e by? ?le.
Kod:
Client:
[lua]lokalnyGracz = getLocalPlayer()
logowaniePanel = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "images/PanelLogowania.png", true)
logowaniePoleLogin = guiCreateEdit(0.391, 0.581, 0.25, 0.07, ""..lokalnyGracz.."", true, logowaniePanel); guiSetProperty(logowaniePoleLogin, "AlwaysOnTop", "True"); guiEditSetMaxLength(logowaniePoleLogin, 30)
logowaniePoleHaslo = guiCreateEdit(0.391, 0.704, 0.25, 0.07, "", true, logowaniePanel); guiSetProperty(logowaniePoleHaslo, "AlwaysOnTop", "True"); guiEditSetMasked(logowaniePoleHaslo, true); guiEditSetMaxLength(logowaniePoleLogin, 30)
logowanieRejestracja = guiCreateButton(0.39, 0.85, 0.11, 0.08, "REJESTRACJA", true, logowaniePanel); guiSetProperty(logowanieRejestracja, "AlwaysOnTop", "True")
logowanieLogin = guiCreateButton(0.53, 0.85, 0.11, 0.08, "LOGOWANIE", true, logowaniePanel); guiSetProperty(logowanieLogin, "AlwaysOnTop", "True")
logowanieTrybAdmina = guiCreateCheckBox(0.39, 0.80, 0.14, 0.04, "Tryb Admina", false, true, logowaniePanel); guiSetProperty(logowanieTrybAdmina, "AlwaysOnTop", "True")

function panelLogowania()
guiSetVisible(logowaniePanel, true)
setPlayerHudComponentVisible("all", false)
showCursor(true)...
141. GUI
siemka m?cze sie z tym ju? godzinke .. dopiero sie ucze LUA i chce zrobi? takie cos ze jezeli gracz wejdzie w marker pokazuje mu gui w kt?rym bedzie m?gl np kupi? co? powiedzmy hamburger - i aby po zakupie bra?o mu pieniadze i dodawa?o HP jedyne co uda?o mi sie osiagn?c to zrobienie gui z podpisami ...

1. stworzy? marker ( m?j nie dzia?a )
2. ustawic aby za kupno zabiera?o pieniadze
3. i dodawa?o hp ..
4, oraz zrobic tak aby gui pokazywa?o sie po wejsciu w marker a nie odrazu po odpaleniu skryptu

pomo?e kto? ?

tutaj ss tego co mi wysz?o

https://imgur.com/a/mXpkZwh


a tutaj kod
[lua]
local GUI_START = createMarker (-212.72344970703, 979.70648193359, 19.329460144043, "cylinder", 1, 255, 255, 255)

local Panel = guiCreateWindow(600, 300, 336, 207, "Automat z napojami", false)
guiWindowSetSizable(Panel, false)

local AddKamizelka = guiCreateButton(9, 31, 137, 67, "Cola +5 HP ", false, Panel)
local AddUSPs = guiCreateButton(207, 36, 119, 62, "Lipton + 7 HP", false, Panel)
local AddM4A1S = guiCreateButton(9, 121, 137, 76, "mountain dew + 10 HP ", false, Panel)
local AddAK47 = guiCreateButton(203, 116, 123, 81, "red bull + 12 HP", false, Panel)



function Open_panel ()
guiSetVisible(Panel, true)
showCursor (true)
end
addEventHandler ("onClientMarkerHit", GUI_START, Open_panel)

function Close_panel ()
guiSetVisible ...
142. Przycisk "anuluj" w gui
Witam mam problem. Nie wiem jak zrobi? przycisk "anuluj". Za pomoc daje :piwo: i R* . Tak wygl?da kod

[lua]
x,y = guiGetScreenSize()
button = guiCreateButton(627/1440*x, 510/900*y, 209/1440*x, 123/900*y, "Uruchom Dzwonki", false)
guiSetProperty(button, "NormalTextColour", "FFAAAAAA")
guiSetVisible(button, false)

function drawSyrena()
dxDrawRectangle(600/1440*x, 278/900*y, 261/1440*x, 372/900*y, tocolor(0, 0, 33, 184), false)
dxDrawRectangle(590/1440*x, 265/900*y, 289/1440*x, 16/900*y, tocolor(187, 0, 0, 255), false)
dxDrawText("Dzwonki", 616/1440*x, 346/900*y, 851/1440*x, 445/900*y, tocolor(255, 255, 255, 255), 3.00, "default", "center", "center", false, false, false, false, false)
end

addEvent("showGUI", true)
addEventHandler("showGUI", getRootElement(), function()
guiSetVisible(button, true)
addEventHandler("onClientRender", getRootElement(), drawSyrena)
showCursor(true)
end)

addEventHandler("onClientGUIClick", button, function()
triggerServerEvent("playSyrena_sc", getLocalPlayer())
guiSetVisible(button, false)
removeEventHandler("onClientRender", getRootElement(), drawSyrena)
showCursor(false)
end, false)

function Closegui(button, state)
if panel and button == "left" and state == "down" then
if cursorPosition(screenW * 0.5688, screenH * 0.6094, screenW * 0.6501, s...
143. GUI się włącza dla każdego gracza
Szuka?em po forum i nie znalaz?em.. Mam problem, gdy wejdzie kto? w gui to ka?demu si? pokazuje :/

Kawa?ek kodu z uruchamianiem:

server:
function wirtualparking(plr)
triggerClientEvent("parking",getRootElement(),plr)
end
addEventHandler
("onMarkerHit",wparkingw,wirtualparking)


client:
addEvent("parking",true)
addEventHandler("parking",localPlayer,function()
        
guiSetVisible(gui,true)
guiSetVisible(Pojazdytrue)
guiSetVisible(Pojazdy2true)
guiSetVisible(policecarlstrue)
guiSetVisible(policecarsftrue)
guiSetVisible(policecarlvtrue)
guiSetVisible(fbitrue)
guiSetVisible(fbitrucktrue)
guiSetVisible(enforcertrue)
guiSetVisible(burittotrue)
guiSetVisible(zamknijtrue)
showCursor(true)
end)
za pomoc :piwo:
144. Kłopot z Freeroam GUI
Witam , chcia?bym dowiedzie? si? jak moge usuna? ustawienia z nazw? ,,Regulamin-Serwera...'' , za pomoc stawiam piwko :)
https://imgur.com/a/aeL3plZ
145. [SKRYPT] Tuning Garażowy / Tuning
Witam, mam dla was skrypt w kt?rym gracz sobie sam robi tunning jednocze?nie maj?c na to podgl?d !
Czego? takiego nie widzia?em na GTAO wi?c pomy?la?em ?e to si? przyda szczeg?lnie Pseudolska na kt?rym tunnerzy to rzadko?? ! xd

ScreenShot: https://imgur.com/a/dUxd2

Download:
Ukryta wiadomość / Hidden message(aby ją zobaczyć musisz postawić użytkownikowi)
Wiadomość została ukryta, aby ją przeczytać należy się zalogować.


PS; Skrypt nie jest m?j tylko jakiego? Angielskiego speca !
Co w nim zrobi?em ? :

- Dostosowa?em go pod OGRPG/PYS ( Domy?lnie by? pod FreeRoam )
- Doda?em t?umaczenie
- Poprawi?em gui
- Odbugowa?em Tabelki
- Doda?em zapis cze?ci
- Zoptymalizowa?em dzia?anie skryptu
- Poprawi?em czasami buguj?ce si? markery
- Doda?em zawansowany system notyfikacji, kt?ry jest odrazu w skrypcie :D
- Umo?liwi?em dodawania nowych cze?ci typu mk lub gz
146. GUI
Witam!
Ot?? morduje si? z tym problemem ju? godzin? i nie wiem co jest grane. Po naci?ni?ciu przycisku 'Anuluj' zabiera mi paczk? zamiast wy??czy? GUI. Prosze o pomoc, o poprawienie kodu. Za pomoc stawiam R* :piwo:


[lua]
local praca = createMarker(1407.70, 1143.37, 5102.70-1, "cylinder", 2.0, 255, 255, 255, 80)
local t=createElement("text")
setElementData(t,"name", "Praca Dorywcza: Pracownik Magazynu")
setElementPosition(t,1407.70, 1143.37, 5102.70)
setElementDimension(t, 0)
setElementInterior(t, 0)

local screenW, screenH = guiGetScreenSize()

panel = false

local miejscamagazynier = {
{1410.87, 1156.97, 5102.70},
{1406.32, 1170.66, 5102.70},
{1406.32, 1170.66, 5102.70},
{1410.95, 1178.06, 5102.70},
{1406.38, 1178.06, 5102.70},
{1418.81, 1185.87, 5102.70},
{1413.73, 1181.31, 5102.70},
}

function paneldx()
dxDrawImage(screenW * 0.2833, screenH * 0.2865, screenW * 0.4334, screenH * 0.4271, "images/bg2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Rozpocznij", (screenW * 0.3587) - 1, (screenH * 0.6029) - 1, (screenW * 0.4414) - 1, (screenH * 0.6549) - 1, tocolor(0, 0, 0, 255), 1.20, "default-bold", "center", "center", false, false, false, false, false)
dxDrawText("Rozpocznij", (screenW * 0.3587) + 1, (screenH * 0.6029) - 1, (screenW * 0.4414) + 1, (screenH * 0.6549) - 1, tocolor(0, ...
147. Zamykanie GUI
Znowu mam problem z GUI, problem polega na tym, ?e je?eli w GUI nr.1 klikn? Wi?cej informacji w miejscu gdzie w GUI nr.2 jest guzik zamkni?cia to GUI si? zamyka.
Je?eli w GUI nr.1 klikn? Wi?cej informacji w miejscu gdzie nie ma guzika zamykaj?cego GUI nr.2 to normalnie otwiera si? GUI nr.2 i potem mog? go zamkn?? guzikiem.

SS: https://imgur.com/a/eP8bF

[lua]local screenW, screenH = guiGetScreenSize()

function isCursorOnElement(x,y,w,h)
local mx,my = getCursorPosition ()
local fullx,fully = guiGetScreenSize()
cursorx,cursory = mx*fullx,my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

hud = false
hud2 = false

function dxRender()
dxDrawRectangle(screenW * 0.3234, screenH * 0.3208, screenW * 0.3508, screenH * 0.3528, tocolor(0, 0, 0, 170), false)
dxDrawLine((screenW * 0.3547) - 1, (screenH * 0.5653) - 1, (screenW * 0.3547) - 1, screenH * 0.6292, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine(screenW * 0.4797, (screenH * 0.5653) - 1, (screenW * 0.3547) - 1, (screenH * 0.5653) - 1, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine((screenW * 0.3547) - 1, screenH * 0.6292, screenW * 0.4797, screenH * 0.6292, tocolor(255, 255, 255, 255), 1, false)
dxDrawLine(screenW * 0.4797, screenH * 0.6292, screenW * 0.4797, (screenH * 0.5653) - 1, tocolor(255, 255, 255, 255), 1, false)
dxDrawRectangle(screenW...
148. Gui się nie pokazuje
witam robie ammunation shop i chcia?em zrobi? marker z gui i nie pokazuje mi gui po wej?ciu w marker

C_SIDE

[lua]

pracaPanelGUI = false

function pracaGUI()

dxDrawRectangle(498, 207, 415, 403, tocolor(0, 0, 0, 200), false)
-- dxDrawImage(524, 320, 389, 285, ":guied/images/AK47.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("AK-47 CENA 5000 PLN", 497, 207, 913, 296, tocolor(255, 255, 255, 255), 2.00, "default-bold", "center", "center", false, false, false, false, false)


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,p...
149. Jak dodać gui do prac?
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]
150. GUI
Witam,bo chcia?bym jak by kto? m?g? mi da? kod z gui co moge doda? sobie tam jaki chcem obraz i edytytowa? tekst.Wiem ?e nikt mi nie da gotowej na tacy,
Za pomoc daje respekt i :piwo:
151. Ruchome GUI
Cze??.
Chcia?bym zrobi? ruchome GUI, kt?re porusza?by si? z do?u na g?r? i na odwr?t
152. Topka do pracy w GUI
Witam, chcia?bym zrobi? do systemu "Top 10" tak, aby nie by?o to wy?wietlane jako lat?j?cy napis, tylko dxDrawText.
Kod:

str
="(odswiezanie: 10 sekund)nRanking pracy kuriera:"
local t=createElement("text")
setElementData(t,"name",str)
setElementPosition(t,2151.39, -2247.3114.89+1.5)

function 
aktualizujText()
local q=exports["ogrpg-db"]:dbGet("select * from job_kurier_topka order by ilosc desc limit 10")
str="(odswiezanie: 10 sekund)nRanking pracy kuriera:"
for i,v in ipairs(q) do
iii=i
local nick
=exports["ogrpg-db"]:dbGet("select login,login2 from ogrpg_users where id=?"v["uid"])
for 
i2,v2 in ipairs(nick) do
if 
i2 1 then return end
if v2["login2"] == false then
str
=""..str.."n"..iii..". "..v2["login"].." - "..v["ilosc"].." oddane paczki"
else
str=""..str.."n"..iii..". "..v2["login2"].." - "..v["ilosc"].." oddane paczki"
end
end
end
setElementData
(t"name"str)
end
setTimer
(aktualizujText100000)
153. Ukrywanie GUI
Siema, jak ukry? to GUI.
Teraz mam kod, kt?ry po klikni?ciu w przycisk wy?wietla wiadomo?? "test" na chacie, a zamiast tego chc?, aby GUI si? ukry?o, jak mam to zrobi??
Za pomoc daj? :piwo:
Kod:
[lua]local markerZarcie = createMarker(-2382.43164, -584.20868, 132.11719-1, "cylinder", 1, 32,102, 23)

local sx,sy = guiGetScreenSize()
local px,py = (sx/1366),(sy/768)

function isMouseIn(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

addEventHandler("onClientRender", root, function()
if isElementWithinMarker(localPlayer, markerZarcie) then
dxDrawLine(422 - 1, 177 - 1, 422 - 1, 576, tocolor(16, 237, 141, 255), 1, false)
dxDrawLine(927, 177 - 1, 422 - 1, 177 - 1, tocolor(16, 237, 141, 255), 1, false)
dxDrawLine(422 - 1, 576, 927, 576, tocolor(16, 237, 141, 255), 1, false)
dxDrawLine(927, 576, 927, 177 - 1, tocolor(16, 237, 141, 255), 1, false)
dxDrawRectangle(422, 177, 505, 399, tocolor(102, 102, 102, 255), false)
dxDrawText("Sklep z jedzeniem", 560, 187, 789, 223, tocolor(255, 255, 255, 255), 2.30, "default", "left", "top", false, false, false, false, false)
dxDrawRectangle(451, 229, 450, 43, tocolor(3...
154. gui tablist headers
Hej,
jak zrobi? w p?tli gui tablist headers tak, ?eby header wy?wietli? si? tylko raz?


Pawn
stock DealerMenu(playerid)
{
    new 
s[500];
    new 
s2[50];
    
s2 "{FFFFFF}KOSZTtMAX PR?DKO??tPOJAZDn";
    for(new 
0i<MAX_VEHICLES_DEALERMENUi++)
    {
        
format(s,sizeof(s),"%s%s{FFFFFF}%d$t%dkm/ht{E6C800}%sn",s2sVehicleDealer[i][Koszt],VehicleDealer[i][MaxPredkosc], VehicleDealer[i][Nazwa]);
    }
        
ShowPlayerDialog(playeridVehicleDealerDialogDIALOG_STYLE_TABLIST_HEADERS"Salon"s"KUP""Anuluj");
    return 
1;
}


Teraz wy?wietla si? 3x, bo MAX_VEHICLES_DEALERMENU wynosi 3.


//EDIT:
Dla tych, kt?rzy szukaj? rozwi?zania:
U?y?em funkcji: strins.

Pawn
stock DealerMenu(playerid)
{
    new 
s[500];
    new 
s2[50];
    
s2 "{FFFFFF}KOSZTtMAX PR?DKO??tPOJAZDn";
    for(new 
0i<MAX_VEHICLES_DEALERMENUi++)
    {
        
format(s,sizeof(s),"%s{FFFFFF}%d$t%dkm/ht{E6C800}%sn"sVehicleDealer[i][Koszt],VehicleDealer[i][MaxPredkosc], VehicleDealer[i][Nazwa]);
    }
    
strins(ss20);
    
ShowPlayerDialog(playeridVehicleDealerDialogDIALOG_STYLE_TABLIST_HEADERS"Salon"s"KUP""Anuluj");
    return 
1;
}
155. Podmianka Gui
Witam, mam pytanie w jaki spos?b mo?na podmieni? gui na serwerze?
156. Zmiana broni w GUI
Siema, mam problem ze zrobieniem gui aktualnej broni.
Chodzi o to, ?e pojawia mi si? pi???, ale po zmianie broni nic si? nie zmienia - dalej ona jest.
Z g?ry dzi?ki, za pomoc stawiam piwo.
Kod:
[lua]setPlayerHudComponentVisible("ammo", false)
setPlayerHudComponentVisible("armour", false)
setPlayerHudComponentVisible("clock", false)
setPlayerHudComponentVisible("health", false)
setPlayerHudComponentVisible("money", false)
setPlayerHudComponentVisible("vehicle_name", false)
setPlayerHudComponentVisible("weapon", false)

bindKey("f11", "down", function()
if map == true then
map = false
setElementData(localPlayer, "hud:enabled", true)
showChat(true)
showPlayerHudComponent("all", false)
showPlayerHudComponent("radar", true)
showPlayerHudComponent("crosshair", true)
else
map = true
setElementData(localPlayer, "hud:enabled", false)
showChat(false)
showPlayerHudComponent("all", false)
end
end)

local czciona = dxCreateFont("font.ttf", 20)

local weapon = getPedWeapon(localPlayer)
local screenW, screenH = guiGetScreenSize()
local sx,sy = guiGetScreenSize() -- pobieramy rozdzielczo?? gracza kt?ry widzi gui
local px,py = (sx/1366),(sy/768) -- dzielimy rozdzielczo?? gracza kt?ry widzi gui przez rozdzielczo?...
157. Interaktywne GUI
Witam!
Mam pytanie, ot?? jestem ciekawy jak mo?na zrobi? interaktywne gui, tzn. Rysuje nam obrazek, kt?ry musimy przenie?? w odpowiednie miejsce na ekranie.
Z g?ry dzi?ki.
158. HUD / Gui
Mia?em przerw? do?? d?ug? od edytowania i robienia na gui editorze.. I zapomnia?em wielu rzeczy. I dlatego nie wiem do ko?ca dlaczego jak dodam grafike hudu do gui z pysa to ta grafika wcale si? nie pokazuje, w mecie wszystko jest dopisane.. Ale nie wiem co jeszcze naprawi? w tym kodzie.. ;-;

[lua]local sx,sy=guiGetScreenSize()
local screenW, screenH=guiGetScreenSize()
function renderHUD()
if getElementData(localPlayer,"notshowhud") then return end
dxSetAspectRatioAdjustmentEnabled( true )

local realtime = getRealTime()
local hour = realtime.hour
local minute = realtime.minute

local x,y,z=getElementPosition(localPlayer)

dxDrawImage(screenW * 0.2219, screenH * 0.0000, screenW * 0.5568, screenH * 0.3251, ":pystories-gui/hud.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText(string.format("PLN %06d", getPlayerMoney()), screenW * 0.4313+1, screenH * 0.0704+1, screenW * 0.5651+1, screenH * 0.0889+1, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false)
dxDrawText(string.format("PLN %06d", getPlayerMoney()), screenW * 0.4313, screenH * 0.0704, screenW * 0.5651, screenH * 0.0889, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "top", false, false, false, false, false)

dxDrawText("| FPS: "..getElementData(localPlayer,"fps").." | PING: "..getPlayerPin...
159. GUI
Witam, mam takie kodziki:
[quote]enum Info
{
plec, //0= male 1=female
wiek, // age :3
zalogowany, // If is player connected
}

new ppanel[MAX_PLAYERS][Info];
#define DIALOG_REGISTER1 123213
#define DIALOG_REGISTER2 1232141
#define DIALOG_REGISTER3 2134512
#define DIALOG_REGISTER4 25432154
#define DIALOG_LOGIN 2134523
#define DIALOG_NOPW1 1234231
#define DIALOG_NOPW2 1234234
#define DIALOG_WRONGPW 2134234
#define PATH "/Konta/%s.ini"[/quote]
[quote]onplayerconnect:

new path[200];
format(path, sizeof(path), "Konta/%s.ini", PlayerName(playerid));

if(!dini_Exists(path))
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Rejestracja", "{00FF00}Witaj %s na {FFFFFF}pA{0000FF}S {00FF00}! Musisz sie zarejestrwac.nn{00FF00}Podaj nowe haslo", "Gotowe", "Anuluj");
}
else
{
//If the player is registered
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Logowanie", "{00FF00}Te konto istnieje w naszej bazie danych!nnPodaj haslo do konta:", "Loguj", "Anuluj");
}
[/quote]
[quote]onplayerdisconnect:

format(path, sizeof(path), "Konta/%s.ini", PlayerName(playerid));

dini_IntSet(path, "plec", ppanel[playerid][plec]);
dini_IntSet(path, "wiek", ppanel[playerid][wiek]);[/quote]
[quote]ondialogresponse:

new path[200];
format(path, sizeof(path), "Konta/%s.ini", PlayerN...
160. gui
Chodzi o to ?e robi? prawo jazdy i jestem pod czas tworzenia teori lecz po lecz jak klikn? Kat.a to przenosi do wyboru czy teoria czy praktyka i po klikni?ciu teoria przenosi do pytania nr 1 czyli tak jak ma by? lecz po klikni?ciu w pytaniu nr.1 na oboj?tnie kt?r? odpowiedz lub na X do zamykania okna nic si? nie dzieje prosz? o pomoc i? nie wiem co jest tego przyczyn? a i nie ma ni? w DB3

kawa?ek kodu strona client
[lua]
function onClientClick(button,state,cX,cY)
if not isCursorShowing() then
return
end
if button == "left" and state == "up" then
for k,self in pairs(editBox.instances) do
if self.visible then
if self.input then
self.input = nil
self.onOutput()
end
local x,y,w,h = self:getPosition()
if isMouseInPosition(x,y,w,h) then
self.input = true
self.onInput()
end
end
end
if rodzaj then
if isMouseInPosition(x*525,y*375,x*57,y*38) then -- Kategoria A
if not getElementData(localPlayer, "Prawko_A", true) or getElementData(localPlayer, "Prawko_B", true) or getElementData(localPlayer, "Prawko_C", true) or getElementData(localPlayer, "Prawko_D", true) then
rodzaj = false
etap = true
setElementData (localPlayer, "Prawko_A", true)
else
outputChatBox("NIE OSZUKUJ")
end
elseif isMouseInPosition(x*608,y*375,x*57,y*38) then -- Kategoria B
if not getElementD...