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
81. Wczytywanie GUI
Witam ot??, mam problem z wczytaniem gui. Skrypt dzia?a? ma, ?e po wej?ciu do pojazdu wczyta na gui
client
[lua]function move()



local screenW, screenH = guiGetScreenSize()


dxDrawLine((screenW * 0.3229) - 1, (screenH * 0.2685) - 1, (screenW * 0.3229) - 1, screenH * 0.6148, tocolor(254, 254, 254, 210), 1, false)
dxDrawLine(screenW * 0.6062, (screenH * 0.2685) - 1, (screenW * 0.3229) - 1, (screenH * 0.2685) - 1, tocolor(254, 254, 254, 210), 1, false)
dxDrawLine((screenW * 0.3229) - 1, screenH * 0.6148, screenW * 0.6062, screenH * 0.6148, tocolor(254, 254, 254, 210), 1, false)
dxDrawLine(screenW * 0.6062, screenH * 0.6148, screenW * 0.6062, (screenH * 0.2685) - 1, tocolor(254, 254, 254, 210), 1, false)
dxDrawRectangle(screenW * 0.3229, screenH * 0.2685, screenW * 0.2833, screenH * 0.3463, tocolor(0, 0, 0, 210), false)
dxDrawText("Kupno Pojazdu TESTUJEMY", screenW * 0.3229, screenH * 0.2685, screenW * 0.6062, screenH * 0.3435, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, false, false, false)
dxDrawLine((screenW * 0.3453) - 1, (screenH * 0.5074) - 1, (screenW * 0.3453) - 1, screenH * 0.5481, tocolor(255, 175, 0, 255), 1, false)
dxDrawLine(screenW * 0.4401, (screenH * 0.5074) - 1, (screenW * 0.3453) - 1, (screenH * 0.5074) - 1, tocolor(255, 175, 0, 255), 1, false)
dxDrawLine((screenW * 0.3453) - 1, screenH * 0.5481...
82. Gui
Witam posiadam skrypt na kupno broni lecz gdy wchodze w marker wyskakuje gui wszyskim :/
client.lua
[lua]-- Enkanet Scripting Lab © 2015 - All rights are reserved.
local shopkeeper = createPed(179,269.01456, 2027.36646, 17.64063)
setElementFrozen(shopkeeper, true)
local weaponmarker = createMarker(268.99280, 2029.25427, 16.64063, 'cylinder', 2.0, 255, 0, 0, 150)
local player = getLocalPlayer()

function weaponGui ()
local screenW, screenH = guiGetScreenSize()
guiwindow = guiCreateWindow( 400, 250, 663, 162, "Weapon Shop System - Enkanet v1.0.0 [5.1.2015]", false)
guiWindowSetSizable(guiwindow, false)

button1 = guiCreateButton(10, 32, 164, 54, "Colt 45 - Ammo 200 n$1250 nBuy", false, guiwindow)
button2 = guiCreateButton(184, 32, 164, 54, "Desert Eagle - Ammo 200 n$1750nBuy", false, guiwindow)
button3 = guiCreateButton(358, 32, 164, 54, "M4 - Ammo 200 n$3000nBuy", false, guiwindow)
button4 = guiCreateButton(529, 32, 124, 54, "Sniper - Ammo 200 n$7000nBuy", false, guiwindow)
button5 = guiCreateButton(10, 101, 164, 42, "Close", false, guiwindow)
addEventHandler("onClientGUIClick", button5, btnClose, false)
addEventHandler("onClientGUIClick", button1, btnColt, false)
addEventHandler("onClientGUIClick", button2, btnDeagle, false)
addEventHandler("onClientGUIClick", button3, btnM4, false)
addEventHandler("onClientGUIClick"...
83. GUI statystyk
Witam, posiadam panel statystyk pod danym klawiszem, jest tam m.in. ranga i gdy awansuje gracza to ona si? nie zmienia w statystykach a dopiero sie odswieza po restarcie skryptu panelu. Jak dodac aby sie synchronizowalo?
84. Wygląd sklepów
Siemka.
Mam do Was pytanie, kt?re gui sklepu podoba Wam si? bardziej?

Opcja 1:
Co? ala GTA V




Opcja 2:



Oczywi?cie grafiki s? stworzone przyk?adowo i po wybraniu lepszej zostan? zmienione na bardziej "?adne".

B?d? wdzi?czny za ka?dy oddany g?os w ankiecie.
85. Wejście w marker, wyswietlanie gui i przesuwanie obiektu
Witam, pr?buj? zrobi? skrypt na przesuwanie si? obiektu (chodzi o drzwi) i chc? to zrobi? tak by po wejsciu w marker, wyswietla nam sie gui, jesli klikniemy "otworz" otwieraja sie drzwi, jesli "zamknij" to zamykaja. [lua]GUIEditor = {
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(1063, 423, 194, 308, "Otw?rz/zamknij drzwi PSP", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(29, 76, 139, 79, "Otw?rz", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(29, 189, 139, 79, "Zamknij", false, GUIEditor.window[1])
guiSetVisible(GUIEditor.window[1], false)
end
)

function isPlayerInPSP(plr)
local idb=getElementData(plr,'player:idb')
if not sid then return end

local result=exports['database']:dbGet('SELECT 1 FROM factions WHERE code=? AND idb=? LIMIT 1;', "PSP", idb)
if result[1] then
return true
else
return false
end
end

local gate = createObject ( 3089,-239.30, 1205.23, 19.74,0,0,90)
local marker = createMarker(-247.85, 1201.82, 18.59, 'cylinder', 1.5, 255, 255, 0, 170)
local marker2 = createMarker(-254.28, 1200.87, 18.59, 'cylinder', 1.5, 255, 255, 0, 170)
setElementDimension(gate,0)
setElementDimension(marker,0)
setElementDimension(marker2,0)


function hit(playerid)
i...
86. Otwieranie gui na przycisk i chowanie huda
Cze??. Mam kolejne dwa problemy. Pierwszy: jak otworzy? gui na przycisk? Event "onClientRender" dzia?a, ale kiedy chce wy??czy? wywala mi b??d, ?e Event "onClientRender" jest ju? w??czony. Drugi: da si? jako? wy??czy? hud? Jakie? pomys?y? :)
[lua]-- GUI
function gui()
dxDrawImage(0/scale, 0/scale, 1280/scale, 720/scale, "i/tlo.png")
dxDrawRectangle(0/scale, -50/scale, 1500/scale, 100/scale, tocolor(80, 80, 80, 240), false)
dxDrawRectangle(-10/scale, 50/scale, 1550/scale, 3/scale, tocolor(20, 20, 20, 190), false)
--
if isMouseInPosition(150/scale, 110/scale, 75/scale, 75/scale) then
dxDrawImage(150/scale, 110/scale, 80/scale, 80/scale, "i/gracz.png")
else
dxDrawImage(150/scale, 110/scale, 75/scale, 75/scale, "i/gracz.png")
end
--
if isMouseInPosition(375/scale, 110/scale, 80/scale, 80/scale) then
dxDrawImage(375/scale, 110/scale, 90/scale, 90/scale, "i/auto.png")
else
dxDrawImage(375/scale, 110/scale, 80/scale, 80/scale, "i/auto.png")
end
--
if isMouseInPosition(600/scale, 110/scale, 80/scale, 80/scale) then
dxDrawImage(600/scale, 110/scale, 90/scale, 90/scale, "i/kary.png")
else
dxDrawImage(600/scale, 110/scale, 80/scale, 80/scale, "i/kary.png")
end
--
if isMouseInPosition(810/scale, 110/scale, 75/scale, 75/scale) then
dxDrawImage(810/scale, 110/scale, 80/scale, 80/scale, "i/info.png")
else
dxDrawImage(810/scale, 110/sca...
87. Nie wyskakujące GUI po ponownym wejściu w marker
Witam, mam ma?y problem z oknem na dxdrawach. Mianowicie, GUI dzia?a pi?knie bez ?adnych zarzut?w do momentu a? nie zamkn? go/rozpoczn? pracy. Problem jest taki, ?e po ponownym wej?ciu w marker po wy??czeniu okna GUI si? nie pojawia tak jakby tego markera tam nie by?o, B??d?w nie ma ?adnych w db3. Za pomoc daje zimnego :piwo:
[lua]
local screenW, screenH = guiGetScreenSize()
okieneczko = false

function Panelmagazyn()
dxDraw..
end

addEvent("GUImagazynu", true)
addEventHandler("GUImagazynu", resourceRoot, function()
if okieneczko == false then
addEventHandler("onClientRender",root,Panelmagazyn)
tick = getTickCount()
okieneczko = true
showCursor (true)
end
end)

function ZamknijOkno(button, state)
if okieneczko and button == "left" and state == "down" then
if cursorPosition(screenW * 0.5098, screenH * 0.5573, screenW * 0.1963, screenH * 0.0469) then
removeEventHandler("onClientRender",root,Panelmagazyn)
okieneczko = false
showCursor (false)
end
end
end
addEventHandler("onClientClick", getRootElement(), ZamknijOkno)

function Rozpocznijprace(button, state)
if okieneczko and button == "left" and state == "down" then
if cursorPosition(screenW * 0.2949, screenH * 0.4870, screenW * 0.1963, screenH...
88. Sprawdzanie loginu gui z tym w bazie(mysql)
Napisa?em funkcj? do logowania przez gui.
Problem w tym, ?e nie potrafi? por?wna? loginu z gui z tym co jest w bazie.
Z clienta przesy?am login i has?o z gui

[lua]
function loginReq(login,password)
local login = guiGetText(editLogin)
local password = guiGetText(editPassword)

triggerServerEvent("loginReq",root,login,password)
end
addEvent("loginReq",true)
addEventHandler("loginReq",root, loginReq)
[/lua]
A na serwerze wykonuje tak
[lua]
SQL = dbConnect("mysql", "dbname=test;host=localhost", "","","share=1")
addEvent("loginReq",true)
addEventHandler("loginReq",getRootElement(), function (login,password)
local loginDb = dbQuery(SQL,"SELECT * FROM konto WHERE login =?",login)--wyszuka rekordy z takim samym nickiem
local resultLogin = dbPoll(loginDb,-1)
local passwordDb = dbQuery(SQL,"SELECT * FROM konto WHERE password=?",password)
local resultPassword = dbPoll(passwordDb,-1)

if #resultLogin then

if #resultLogin == login then
if resultPassword == password then

triggerClientEvent("closeGui",source)
outputDebugString("zalogowales")
else
outputDebugString("ne")
end
outputDebugString("loginy zgadzaja sie&q...
89. GUI
Witam, mam problem ze skryptem na gui. Kto? wie jak to naprawi?? Za pomoc daje :piwo: i R*
DB3: https://i.imgur.com/ILvbuM6.png
Kod:
local coords = {getScreenFromWorldPosition(bone[1], bone[2], bone[3]+checkLevel(v))}
90. gui
Siemka, mam pytanie
Czy da si? skalowa? elementy gui? Chodzi mi o te robione gui editorem.
?e np. dam tak: guiCreateWindow( screenWidth/2 - 400, 250, 800, 500 )
To mi si? wyskaluje czy nie da si? tego skalowa??

Ustalaj?c wcze?niej zmienna wymiar?w ekranu czyli to screenWidth
91. nie pokazuje się gui
Witam mam problem gdy robie tabelowo markery to gui si? nie pojawia

markerybramek 
= {
        {-
2668.281270.7455.43},
        {-
2676.891270.8555.43},
        {-
2685.521270.5655.43},
        {-
2694.521270.7155.43},

    }
    for 
_,v in ipairs(markerybramek) do
        
xd createMarker(v[1], v[2], v[3]-0.5"cylinder"32552500170)
        
end

        
--local xd createMarker(-2685.521270.5655.43-1"cylinder"1.5064,255,0,0)

    
addEventHandler("onClientMarkerHit",xd, function(el,md)
        if 
el~=localPlayer then return end
        
--if getPedOccupiedVehicle(elthen return end
            showCursor
(true)
            
addEventHandler("onClientRender"rootgui_bramki)
            
setElementData(el"marker:bramki"true)
            
setElementFrozen(eltrue)
    
end)

db3 czyste a gdy dodam jedne marker nie tabelowo to wszystko pokazuje ?adnie
92. Interior w przyciskach gui
Witam ot?z, mam problem, mam int urz?du, jest on w dimension 1 i interior 1, lecz gdy wjade na drog?, jest on robiony pod drog?, lecz na int 1 i dim 1. To ukazuje mi si? gui, jest jaka? funkcja ustawiaj?c? gui lub interior?
93. Gui
Jeszcze jedna sprawa tworze panel logowania(graficzny) i uzywam dxDrawImage(postgui=false) na g?ownej grafice

ale gdy chcem doda? graficzny przycisk "zaloguj si?" i mam post gui na true to si? nie wyswietla :/
94. Wyświetlanie gui po wejściu do pojazdu.
Jak zrobi? wy?wietlanie gui po wej?ciu do pojazdu.
95. Gui :D
Witam, mam problem. Chcia? bym zrobi? by po klikni?ciu w obrazek porusza? si? on za mysz?. Prosz? o pomoc, bo nie wiem jak to zrobi?.

Stawiam :piwo:

Mam Taki kod:

local px,py guiGetScreenSize()
local zoom 1
if px 1920 then 
    zoom 
math.min(21920/px)
end

showCursor
(true)

function 
mysz xywidthheight )
    if ( 
not isCursorShowing( ) ) then
        
return false
    end
    local sx
sy guiGetScreenSize ( )
    
local cxcy getCursorPosition ( )
    
local cxcy = ( cx sx ), ( cy sy )
    if ( 
cx >= and cx <= width ) and ( cy >= and cy <= height then
        
return true
    
else
        return 
false
    end
end

img 
dxCreateTexture("ulgowy.png")

function 
gui()
    
dxDrawImage(678/zoom542/zoom388/zoom516/zoomimg)
end
addEventHandler
("onClientRender"rootgui)

function 
cos()
    if 
mysz(670/zoom542/zoom388/zoom516/zoomthen
        guiSetPosition
(guicxcytrue)
    
end 
end
addEventHandler
("onClientClick"rootcos)


Przepraszam ?e nie doda?em tego wcze?niej. Kod zrobiony dla testu.


Uda?o si?, a czy m?g? by mi kto? powiedzie? jak zrobi? by obrazek szed? za kursorem bardziej "g?adko". Bo mam kod, obrazek idzie za kursorem ale nie jest tak jakby "przyczepiony" tylko teleportuje si? do miejsca w kt?rym klikn?.

Mam nadzieje ?e kto? zrozumie moje pytanie :mrgreen: !!
96. System zgłoszeń gui
Witam przychodz? z pytaniem jak zrobi? w gui combobox tak, ?e jak wybierzemy z pierwszego comboboxa frakcje np policja to pokazuje nam si? nast?pny combo box z listami zg?osze?. Chodzi mi tu g??wnie o to by ka?da frakcja mia?a osobne powody zg?osze?
97. Gui
Witam ostatnio bawi?em si? robieniem Guieditorem Chcia?bym zrobi? gui ale mi to troche nie wychodzi, gui kt?re planuje zrobi? z obrazkiem nakieruje Mnie kto? jak zrobi? ?
98. ACL GUI
Siema
Powiedzia?bym kto? jak zrobi? aby na gridliscie pokazywa?o osoby kt?re s? w grupie ACL "Druzyna"?
Pr?bowa?em to zrobi? sam ale zupe?nie nie wiem jak.
Za pomoc daje piwko i respekt :)
99. GUI
Siema
Mam pytanie dotycz?ce GUI

Je?li tworz? obraz za pomoc?: guiCreateStaticImage
To czy da siesi? zrobi? tak aby po najechaniu na GUIEditor.staticimage[1] ale nie klikaniu na niego to ?eby zmieni? kolor na jaki? tam ustalony albo ?eby zamiast niego pojawi? sie staticimage[2]?
Tak jak najedzie sie myszk? na zwykly button to on sie tak pod?wietla jakby, to czy da sie zamieni? obraz po najechaniu?

Za pomoc daje piwko i respekt
100. Panel GUI
Siemka
Mam skrypt na prace i jest tam do wybor?w kilka poziom?w
Lecz gdy wejde w marker i klikne co? na GUI to pokazuje si? ono ka?demu na serwerze


local Marker 
createMarker(101520-0.9"cylinder"1.012500)

function 
GUIpracy()
guiSetVisible(WindowJobtrue)
guiSetVisible(Button1true)
guiSetVisible(Button2true)
guiSetVisible(Button3true)
showCursor(true)
end
addEventHandler 
("onClientMarkerHit"MarkerGUIpracy)

function 
Wybor()
guiSetVisible(Okno2true)
guiSetVisible(Button1Okno2true)
guiSetVisible(Button2Okno2true)
guiSetVisible(WindowJobfalse)
guiSetVisible(Button1false)
guiSetVisible(Button2false)
guiSetVisible(Button3false)
showCursor(true)
end
addEventHandler
("onClientGUIClick"Button1Okno2Wybor


Po tej ostatniej funkcji ka?demu pokazuje si? gui
Wie kto? co na to poradzic
101. edycja gui rh
Witam ot?? chcia?bym zamiast cgui by?o gui w dx.
Tylko nie umiem tego zrobi? jedyne co ogarniam to to by tam wstawi?, lecz wi?cej nic
[lua]function gui()
-- tutaj gui z guieditora
end[/lua]
kod c.lua
[lua]addEventHandler("onClientResourceStart", resourceRoot,
function()
rh = guiCreateWindow(0.00, 0.93, 0.14, 0.07, "Gwintowane zawieszenie", true)
guiWindowSetSizable(rh, false)
guiWindowSetMovable(rh, false)

gora = guiCreateButton(0.05, 0.46, 0.43, 0.36, "Podwy?sz", true, rh)
dol = guiCreateButton(0.54, 0.46, 0.41, 0.36, "Obni?", true, 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]
s.lua
[lua]function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElement...
102. GUI 3D - Nie wyświetla
Mam drobny k?opot, pr?bowa?em zrobi? obrazek kt?ry b?dzie porusza? si? w ruch myszki(teksture z drift paradise wzi??em)
Niestety nic nie wy?wietla na ekranie, tak samo z db3 kt?re jest puste.
= {}
UI.textures = {}
local screenWscreenH guiGetScreenSize()
MAX_TRANSFORM_ANGLE 12


 dxSetRenderTarget
()
    if 
renderTarget then  
        rt3DDraw
renderTarget00screenWscreenH )

        
local mxmy=getCursorPosition( )
        
mx=mx*screenW
        my
=my*screenH
        
if not isCursorShowing() then
        mx
my=0*screenW0*screenH
        end
        local rx
=-( mx-screenW/)/screenW*MAX_TRANSFORM_ANGLE
        local ry
=( my-screenH/)/screenH*MAX_TRANSFORM_ANGLE

        rt3DTransform
renderTargetrxry)
    
end

addEventHandler
"onClientResourceStart"resourceRoot, function()
  
renderTarget rt3DCreatescreenWscreenH )
  
UI.textures.background dxCreateTexture"assets/images/login/background.png" )
end)

function 
animacja()
    
rt3DSetrenderTarget )
  
dxDrawImage00screenWscreenHUI.textures.background0,0,0tocolor255,255,255,255 ) )
end
103. Nie wyświetlanie się GUI
Witam przejd? od razu do rzeczy problem jest w tym ze ze nie wy?wietla si? GUI chocia? powinno, moim zdaniem ..(brak b??d?w w debugu) nie wiem czy dobrze to zrobi?em wiec za pomoc daje :piwo:
PS: GUI ma si? wy?wietla? gdy si? jest blisko pojazdu

[lua]local sx,sy = guiGetScreenSize()
local x,y = (sx/1366), (sy/768)
local font = dxCreateFont("f/OpenSans-CondBold.ttf", 22) --19

function dxDrawInterakcja(pojazd)
local x, y, z = getElementPosition(pojazd)
local x2, y2, z2 = getElementPosition(localPlayer)
local odleglosc = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if odleglosc <= 4 then
if isPedInVehicle(localPlayer) == false then
dxDrawTextCustom("NACISNIJ [E] ABY WEJSC", x*535, y*423, x*300, y*20, tocolor(0, 0, 0, 255), 0.60*y, font, "center", "center", true, true, false)
dxDrawTextCustom("NACISNIJ [E] ABY WEJSC", x*533, y*421, x*300, y*20, tocolor(255, 255, 255, 255), 0.60*y, font, "center", "center", true, true, false)
else
dxDrawTextCustom("NACISNIJ [E] ABY WYJSC", x*642, y*622, x*300, y*20, tocolor(0, 0, 0, 255), 0.50*y, font, "center", "center", true, true, false)
dxDrawTextCustom("NACISNIJ [E] ABY WYJSC", x*640, y*620, x*300, y*20, tocolor(255, 255, 255, 255), 0.50*y, font, "center", "center", true, true, false)
end
end
end

addEventHandler("onCli...
104. GUI
Witam,bo chcia?bym za pomoc? dx zrobi? buttona,tylko nie wiem jak si? do tego zabra?.Za pomoc daje :piwo:
105. GUI
Siemka mam problem z gui w dx wy?wietla si? gui na 1 ses (nawet mniej) a potem znika.
KOD:
function object ()
    
local object=createObject (2514, -711.69385964.5694012.35310-13600)
end
addEventHandler
"onClientResourceStart"getRootElement( ), object)
local marker=createMarker(-711.67029963.6933012.35443-1'cylinder'1.0255255255150)
addEventHandler("onClientRender"rootdraw)
function 
draw ()
    
dxDrawRectangle(-441268590tocolor(100255), false)
end
addEventHandler 
"onClientMarkerHit"getRootElement(),draw


[ Dodano: 2019-04-02, 15:44 ]
Ju? sam naprawi?em, do zamkni?cia
106. lista graczy w gui
Witam przychodz? do was z pytaniem jak zrobi? w gui list? graczy chodzi mi o takie co? https://imgur.com/a/CrC9d0o
Tam gdzie jest napisane lista graczy chcia?bym zrobi? wy?wietlanie wszystkich graczy jacy s? na serwerze
107. GUI
Witam,mam taki problem ?e jak wchodze w marker to gui tak jakby tylko si? dos?ownie jedn? mili sekund? pojawi?o a potem znikne?o.
KOD:
marker createMarker(-1991.36926953.0538945.44531-1"cylinder"1.53514235)
  
    
addEventHandler("onClientMarkerHit"marker, function(plr)  
    if (
marker)  then
        dxDrawImage
(5000300500"okno.png"000tocolor(255255255255), false
        
addEventHandler("onClientRender"root, function()
end)
    
end
        end
)
108. Nie działa GUI
Siemka,zrobi?em cz??ciowo skrypt na gui do markera lecz on mi nie dzia?a i nie wiem w czym jest problem.
marker createMarker(-1984.40953.9245.45-1"cylinder"1.53514235)
addEventHandler("onClientMarkerHit"marker, function(plrdim
if 
plr ~= localPlayer then return end
GUIEditor
.window[1] = guiCreateWindow(33093542420""false)
        
guiWindowSetSizable(GUIEditor.window[1], false)

        
GUIEditor.button[1] = guiCreateButton(13027826286""falseGUIEditor.window[1]) 
        
guiSetVisibleGUIEditor.window[1], false )
end)

DB3:ERROR: gui/gui.lua:4: attempt to index global 'GUIEditor' (a nil value)
109. GUI
Siemka,chcia?bym napisa? skrypt ?e jak wejdzie si? w marker to wy?wietla si? GUI.Tylko nie wiem jak mam si? zabra? do tego.
110. Nie wyświetla gui
Cze??, zmagam si? z problemem.. ot?? nie wy?wietla mi gui(dx) oraz nie ma b??d?w db3
kod na wyswietlanie:

client

addEvent
("SpeedON"true)
addEventHandler("SpeedON"root, function()
    
addEventHandler("onClientRender"rootrenderSpeedoMete)
end)

addEvent("SpeedOFF"true)
addEventHandler("SpeedOFF"root, function()
    
removeEventHandler("onClientRender"rootrenderSpeedoMete)
end)


server

addEventHandler
("onPlayerVehicleExit"root, function()
triggerClientEvent(source"SpeedOFF"source)
end)


addEventHandler("onPlayerVehicleEnter"root, function()
triggerClientEvent(source"SpeedON"source)
end)

111. Ramka w gui
Witam, mam taki problem poniewa? nie wiem jak doda? obram?wk? do zmiany tablic w gui

kod:

[lua]local marker=createMarker(358.59,163.00,1007.38, "cylinder", 1, 255, 255, 255, 155)
setElementInterior(marker, 3)

local t=createElement("text")
setElementPosition(t,358.59,163.00,1008.38)
setElementInterior(t,3)
setElementData(t,"name","Zmiana tablic rejestracyjnych")

local wm={}
wm.window=guiCreateWindow(0.22, 0.22, 0.59, 0.53, "Zmiana tablic", true)
guiWindowSetSizable(wm.window, false)
guiWindowSetMovable(wm.window, false)
guiSetVisible(wm.window, false)
wm.gridlist=guiCreateGridList(0.03, 0.09, 0.93, 0.72, true, wm.window)
guiGridListAddColumn(wm.gridlist, "ID", 0.2)
guiGridListAddColumn(wm.gridlist, "Nazwa", 0.5)
guiGridListAddColumn(wm.gridlist, "Tablica", 0.2)
wm.edit=guiCreateEdit(0.04, 0.83, 0.27, 0.11, "", true, wm.window)
wm.submit=guiCreateButton(0.35, 0.84, 0.28, 0.11, "Zmie? tablic?(5000 PLN)", true, wm.window)
wm.close=guiCreateButton(0.68, 0.84, 0.28, 0.11, "Zamknij", true, wm.window)

addEventHandler("onClientGUIClick", root, function(btn,state)
if source == wm.submit then
local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
local new_board=guiGetText(wm.edit)
if selectedRow < 0 then return end
local cost=5000
if string.len(new_board) < 1 then
outputChatBox("* Podaj wi?cej znak?w.&qu...
112. Gui do salonu + kierowca
Witam, mam pewien k?opot.
Czy wie kto? jak doda? gui do salonu aby przy zakupie otwiera?o si? gui tak jak w its tylko z mojej grafiki mam owe linijki dodane do skryptu lecz nie otwiera si? gui:

local function drawGUI()
    if 
data.text and data.vehicle then
        dxDrawImage
(001920/zoom1080/zoom"salon.png"000tocolor(255255255255), false)
        
dxDrawText(data.text904/zoom406/zoom1036/zoom530/zoomtocolor(255255255255), 1.25"default""left""top"falsefalsefalsefalsefalse)
        if 
isMouseInPosition(521/zoom584/zoom258/zoom62/zoom) and data.showed then dxDrawImage(521/zoom584/zoom258/zoom62/zoom"kup.png"000tocolor(180,180,180)) else dxDrawImage(521/zoom584/zoom258/zoom62/zoom"kup.png"end
        
if isMouseInPosition(1145/zoom584/zoom258/zoom62/zoom) and data.showed then dxDrawImage(1145/zoom584/zoom258/zoom62/zoom"anuluj.png"000tocolor(180,180,180)) else dxDrawImage(1145/zoom584/zoom258/zoom62/zoom"anuluj.png"end
    end
end


Macie tutaj skrypt (bez moich grafik)

Kliknij aby pobra?

Tak?e prosi?bym aby zrobi? kupno auta takie jak na 4l ?e kupujesz auto i ci? teleportuje z autem na dane miejsce a kierowca jest w ?rodku.
113. gui butt
cze??, potrzebuje pomocy w buttonach bo mam takie co?
 addEventHandler "onClientGUIClick"rootprzewin5
i mam tam funkcj? i nie wiem jak to zrobi?, aby pobiera?o np. createButton z innego zasobu i ?eby wykrywa?o, kiedy si? kliknie, buttony na zdj?ciach
114. Jak dodać GUI graficzne do prac ogrpg
Witam pomo?e mi kto? doda? GUI graficzne do prac ogrpg

Np do tej pracy

Kod od strony serwera

[code]createBlip(-2431.22, 1028.69, 50.39, 46,2,0,0,0,0,0,275)
--[[wejscie = createMarker (-2431.22, 1028.69, 50.39+1, "arrow", 1.5, 255, 255, 0)
wyjscie = createMarker (-3030.02, 5552.19, 64.16+1, "arrow", 1.5, 255, 255, 0)
setElementDimension(wyjscie, 0)


addEventHandler("onMarkerHit", wejscie, function(el, md)
--if getElementType(el)== vehicle then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
setTimer(function ()
outputChatBox( "* Wszed?e?(a?) do Magazynu.", el)
setElementDimension(el, 0)
setElementPosition(el, -3030.00, 5546.04, 64.16)
setElementFrozen(el, false)
showPlayerHudComponent(el, "radar", false)
fadeCamera(el, true)
end, 1500, 1)
end)
addEventHandler("onMarkerHit", wyjscie, function(el, md)
if getElementType(el)== vehicle then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
setTimer(function ()
outputChatBox("* Wyszed?e?(a?) z Magazynu.", el)
setElementDimension(el, 0)
setElementPosition(el, -2431.10, 1032.35, 50.39)
setElementFrozen(el, false)
showPlayerHudComponent(el, "radar", true)
fadeCamera(el, true)
end, 1500, 1)
end)]]--



wejscie = createMarker (-2431.22, 1028.69, 50.39+1, "arrow&quo...
115. GUI wpisywanie tekatu
Cze?? mam problem gdy? postanowi?em nauczy? si? tworzenia GUI, zrobi?em sobie proste okno gdzie mo?emy wpisa? tekst i tutaj zaczynaj? si? schodzy gdy wpisuje tekst i wcisne przypu??my podczas pisania przycisk t, to uruchamia mi si? pisanie na czacie nie wiem zbytnio jak zablokowa? czat podczas pisania w tym okienku.
116. Gui salon
Postanowi?em ulepszy? troch? salon i chcia?em go zrobi? w gui. Wszystko jest okej dop?ki nie podejd? do informacji pojazd?w. Kiedy nadaj? to informacje do gui niestety mam b??dy.


client gui
[lua]
addEventHandler("onClientColShapeHit", resourceRoot, function(hit)
if hit ~= localPlayer then return end
if isPedInVehicle(hit) then return end
local veh = getElementData(source, "komis:slot")
if not veh then return end
local desc = getElementData(veh, "vehicle:desc")
if not desc then return end
addEventHandler("onClientRender", root, salony)
informacje_pojazdy = desc
showCursor(true)
end)

[/lua]

serwer
[lua]
function createKomisVehicle(slot)
if #getElementsWithinColShape(komis_shapes[slot]) > 0 then setTimer(createKomisVehicle, 250, 1, slot) return end

vehicles[slot] = {}

vehicles[slot].mileage = math.random(slots[slot].dmin, slots[slot].dmax)
vehicles[slot].price = slots[slot].price

vehicles[slot].veh = createVehicle(slots[slot].model, slots[slot][1], slots[slot][2], slots[slot][3], 0, 0, slots[slot][4])
setElementFrozen(vehicles[slot].veh, true)
setVehicleDamageProof(vehicles[slot].veh, true)
setVehicleLocked(vehicles[slot].veh, true)

setElementData(komis_shapes[slot], "komis:veh", vehicles[slot].veh)
setElementData(komis_shapes[slot], "komis:slot", slot)
setElementData(vehicles[slot].veh, "komis:veh", true)
setElementData(vehicles[slot].veh, &...
117. Nie wyswietla się gui
Witam mam taki problem z podmienieniem


dxDrawRectangle
(screenW 0.2628screenH 0.2135screenW 0.4744screenH 0.0742tocolor(093147200), false)


Na



dxDrawImage
(screenW 0.2628screenH 0.2135screenW 0.4744screenH 0.0742"okno.png"tocolor(255,255,255,255), false)



nie pokazuje mi si? te podmienione gui graficzne,

db3= 0

Za pomoc :piwo:
oraz
R*
118. Jak podmieć gui
Witam tak jak w temacie zrobi?em sobie okno i chce je podmieni? na gui nie wiem jak to zrobi? jak uda mi si? zrobi? piwko i respekt a jak nie uda to tylko piwko za pomoc :)

[lua]
local I=0
local D=0

--wykorzystujemy zmienne:
--UM_HOUSE_ID
--UM_HOUSE_CENA

local marker=createMarker(1663.23, -1650.35, 14.25-1,"cylinder",1.5,50,90,255,75)
setElementInterior(marker,0)

local infowin = guiCreateWindow(0.7531,0.3479,0.2109,0.3792,"Kupno domku ( Kursor - F4 )",true)
local infowinlbl = guiCreateLabel(0.037,0.1209,0.9185,0.1,"", true, infowin)
local infoedit=guiCreateEdit(0.037, 0.3, 0.9185, 0.1, "ID DOMU", true, infowin)
local infobtn=guiCreateButton(0.037, 0.5, 0.9185, 0.2, "Nast?pny krok (1/3)", true, infowin)

guiLabelSetHorizontalAlign(infowinlbl,"center",true)
guiSetFont(infowinlbl,"default-small")
guiSetVisible(infowin, false)

addEventHandler("onClientMarkerHit", marker, function(el,md)
if (el~=localPlayer or not md) then return end
local _,_,z=getElementPosition(localPlayer)
local _,_,z2=getElementPosition(source)
if (math.abs(z2-z)>5) then return end
guiSetText(infobtn, "Nast?pny krok (1/3)")
guiSetText(infoedit, "ID DOMU")
guiSetText(infowinlbl, "")
guiSetVisible(infowin, true)
umlasttick = getTickCount()
end)

addEventHandler("onClientMarkerLeave", marker, function(el,md)
if (el~=localPlayer) then re...
119. respienie auta poprzez klikniecie w gui
Mam taki problem ot?? chcia?bym aby po kliknieciu w "rozpocznij prace" respi?o nam pojazd i ustawia?o punkt do kt?rego mamy jecha? .. lecz nie wiem jak to ustawic m?g? by kto? pom?c ?

a tutaj kod



local baseX = 1920
local zoom = 1.0
local minZoom = 2
if sx < baseX then
zoom = math.min(minZoom, baseX/sx)
end

local x,y,z = -99.296501159668,1083.2281494141,19.7499713897715
local marker = createMarker(x, y, z-1, "cylinder" , 0.8,191, 191, 191)
local panel_x, panel_y_, panel_w, panel_h = 746/zoom, 372/zoom, 429/zoom, 238/zoom
local addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h = 9/zoom, 31/zoom, 155/zoom, 63/zoom
local addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h = 261/zoom, 31/zoom, 155/zoom, 63/zoom

panel = guiCreateWindow(panel_x, panel_y_, panel_w, panel_h, "Praca dorywcza", false)
addKamizelka = guiCreateButton(addKamizelka_x, addKamizelka_y, addKamizelka_w, addKamizelka_h, "Rozpocznij prace", false, panel)
addUSPs = guiCreateButton(addUSPs_x, addUSPs_y, addUSPs_w, addUSPs_h, "Zamknij panel", false, panel)

guiSetVisible(panel, false)
guiSetVisible(addKamizelka, false)
guiSetVisible(addUSPs, false)

if source == addKamizelka then
createVehicle ( 582, -82.071304321289,1078.6505126953,19.7421875)
outputChatBox (" Tw?j pojazd pracowniczy wyjecha? z gara?u wsi?dz do niego")
addEventHandler("onClientGUIClick", addKamizelka )
end

functio...
120. nie otwiera gui i nie pokazuje blipa
Witam mam pewien problem robi? sobie gui lecz jest problem one w og?le si? nie otwiera

[lua]
marker = {
{369.75, -2043.86, 7.67},
{848.63, -1822.13, 12.19},
{-1567.03, -2735.30, 48.54},
{-2328.49, -1618.51, 483.71},
{-1945.10, -1084.70, 30.78},
{-2524.29, -604.01, 132.56},
{-2793.32, -380.37, 7.04},
{-2354.25, -154.45, 35.32},
{-2769.76, 229.40, 7.06},
{-2208.21, 639.76, 49.44},
{-1790.54, 1428.62, 7.19},
{-2512.31, 1205.41, 37.42},
{-2261.07, 2287.73, 4.82},
{-1267.02, 2708.03, 50.07},
{-926.00, 2026.48, 60.91},
{-366.77, 1129.84, 19.76},
{2144.14, 2808.86, 10.82},
{2444.98, 2290.26, 10.82},
{1722.32, 2105.34, 10.82},
{2206.28, 1514.67, 10.82},
{2461.04, 1158.96, 10.82},
{1542.48, 1033.90, 10.82},
{1098.74, 1450.08, 12.55},
{1500.63, 773.24, 10.82},
{1288.60, 342.65, 19.55},
{1925.90, 174.90, 37.28},
}


GUIEditor = {
gridlist = {},
window = {},
button = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(424, 275, 888, 475, "Towary", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.gridlist[1] = guiCreateGridList(10, 20, 855, 341, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "#", 0.2)
guiGridListAddColumn(GUIEditor.gridlist[1], "Nazwa Towaru", 0.2)
guiGridListAddColumn(GUIEditor.gridlist[1], "Wyn...