Wysłany: 2015-08-01, 02:27
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
local loop = createMarker ( 358.24 , 178.74 , 1008.38 - 1 , "cylinder" , 0.7 , 255 , 255 , 255 )
setElementDimension ( loop , 1636 )
setElementInterior ( loop , 3 )
GUIEditor = {
button = {}
}
function()
local screenW , screenH = guiGetScreenSize ()
GUIEditor . window [ 1 ] = dxDrawRectangle ( screenW - 331 - 10 , ( screenH - 381 ) / 2 , 331 , 381 , tocolor ( 0 , 0 , 0 , 200 ), false )
GUIEditor . label [ 1 ] = guiCreateLabel ( 14 , 51 , 179 , 83 , "Tu mo?esz op?aci? swoje mandaty " , false , GUIEditor . window [ 1 ])
guiLabelSetHorizontalAlign ( GUIEditor . label [ 1 ], "left" , true )
GUIEditor . button [ 1 ] = guiCreateButton ( 24 , 112 , 161 , 65 , "P?ace za jeden" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 2 ] = guiCreateButton ( 24 , 187 , 161 , 65 , "P?ace za wszystkie" , false , GUIEditor . window [ 1 ])
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
addEventHandler ( "onClientMarkerHit" , loop , function( el , md )
if not md or el ~= localPlayer then return end
guiSetVisible ( GUIEditor . window [ 1 ], true )
showCursor ( true , false )
end )
local function win ()
guiSetVisible ( GUIEditor . window [ 1 ], false )
showCursor ( false )
end
addEventHandler ( "onClientMarkerLeave" , loop , function( el , md )
if el ~= localPlayer then return end
win ()
end )
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 2 ], function( plr )
local mandaty = getPlayerWantedLevel ( plr )
local mandat = mandaty * 700
if mandaty == 0 then
outputChatBox ( "* Nie posiadasz ?adnych mandat?w." , 255 , 255 , 255 , plr )
return
end
triggerServerEvent ( "setPlayerWantedLevel" , localPlayer , mandat )
win ()
end )
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 1 ], function( plr )
local mandaty = getPlayerWantedLevel ( plr )
local mandat = 700
if mandaty == 0 then
outputChatBox ( "* Nie posiadasz ?adnych mandat?w." , plr )
return
end
triggerServerEvent ( "setPlayerWantedLevel1" , localPlayer , mandaty , mandat )
end )
op?acanie ie dzia?a... GUI nie nie pojawia i marker znika...
Ostatnio zmieniony przez Vxen 2015-08-02, 13:26, w całości zmieniany 1 raz
Wysłany: 2015-08-01, 04:55
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
GUIEditor = {
button = {}
W oryginale bylo troche tego wiecej, takze skopiuj ca?? t? tabel?bz jakiegos outputu z guieditora i problem z gui powinien znikn??.
Jak juz to zrobisz sprawdz db3, no i podaj bl?dy.
Wysłany: 2015-08-01, 07:43
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
GUIEditor ={
button ={},
window ={},
label ={}
}
Wysłany: 2015-08-01, 10:48
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Maximerr , a dalbys ca?y kodzik taki aby dzia?a? na wszystkoh rrozdzia?ach? Dalej kod ten co wy i nie dzia?a...
Wysłany: 2015-08-01, 11:27
Jurandovsky
Kurdebele
Wiek: 17 Na forum: 4838 dni Posty: 915
Piwa : 2697
Pisz po ludzku o co Ci chodzi, nie wiem co to rozdzia? : /
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
Wysłany: 2015-08-01, 13:09
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Sorki ale pisa?em na fonie. Czy dali by?cie mo?e gotowy kodzik tak aby gui dzia?a?o na wszystkich rozdzielczo?ciach?
Wysłany: 2015-08-01, 13:57
Maximerr
Programmer PHP, LUA
Wiek: 25 Na forum: 4427 dni Posty: 548
Piwa : 1051
Vxen , za ka?d? rozdzielczo?cbi? WIDTH dodaj *screenW/szeroko?? na kt?rej robi?e?, a w HEIGHT dodaj *screenH/wysoko?? monitora.
Przyk?ad:
56*screenW/800, 50*screenH/600, 12*screenW/800, 15*screen/600.
Wysłany: 2015-08-01, 16:05
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Maximerr , sorki no ale ja jestm pocz?tkuj?cy i czy to ma by? tak:
}
function()
local screenW , screenH = guiGetScreenSize ()
GUIEditor . window [ 1 ] = dxDrawRectangle ( 56 * screenW / 800 , 50 * screenH / 600 , 12 * screenW / 800 , 15 * screen / 600 , tocolor ( 0 , 0 , 0 , 200 ), false )
GUIEditor . label [ 1 ] = guiCreateLabel ( 14 , 51 , 179 , 83 , "Tu mo?esz op?aci? swoje mandaty " , false , GUIEditor . window [ 1 ])
guiLabelSetHorizontalAlign ( GUIEditor . label [ 1 ], "left" , true )
GUIEditor . button [ 1 ] = guiCreateButton ( 24 , 112 , 161 , 65 , "P?ace za jeden" , false , GUIEditor . window [ 1 ])
GUIEditor . button [ 2 ] = guiCreateButton ( 24 , 187 , 161 , 65 , "P?ace za wszystkie" , false , GUIEditor . window [ 1 ])
guiSetVisible ( GUIEditor . window [ 1 ], false )
end
Wysłany: 2015-08-02, 02:03
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
GUIEditor . window [ 1 ] = dxDrawRectangle ( 56 * screenW / 800 , 50 * screenH / 600 , 12 * screenW / 800 , 15 * screen / 600 , tocolor ( 0 , 0 , 0 , 200 ), false )
Eem to cos, zakladam mialo byc to gui, musi byc oknem, stworzonym poprzez guiCreateWindow
Jezeli koniecznie chcesz dxDraw musisz to zrobic poprzez Renderowanie a wszystkie inne elementy musisz ponownie przeskalowac nie pod okno a pod ekran...
Takie zawi?e, jasniej nie umiem... Wiec stworz okno poprzez guiCreateWindow...
Wysłany: 2015-08-02, 13:24
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
A podajcie ca?y kod... Chcem zobaczy? jak to robi?!
Wysłany: 2015-08-02, 14:08
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
"Vxen" napisał/a :A podajcie ca?y kod... chcem (tak si? u nas na wsi m?wi) zobaczy? jak to robi?!
Zapomnij o gotowcu... Damy ci taki kod, a ty za chwile znowu do nas wrocisz, z takim samym problemem... Jaki to ma sens
Wysłany: 2015-08-02, 17:26
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Sprawdzi?em kilka skrypt?w no i zrobi?em co? takiego...
sW , sH = guiGetScreenSize ()
x = 1360
y = 768
-- / x ) * sW , / y ) * sH
local loop = createMarker ( 358.24 , 178.74 , 1008.38 - 1 , "cylinder" , 0.7 , 255 , 255 , 255 )
setElementDimension ( loop , 1636 )
setElementInterior ( loop , 3 )
sW , sH = guiGetScreenSize ()
x = 1360
y = 768
-- / x ) * sW , / y ) * sH
function gui1 ()
local screenW , screenH = guiGetScreenSize ()
-- guiCreateWindow ( 1027 , 331 , 210 , 272 , "Mandaty" , false )
dxDrawRectangle ( screenW * 1.000 , screenH * 1.000 , screenW * 1.000 , screenH * 1.000 , tocolor ( 0 , 0 , 0 , 200 ), false )
-- guiWindowSetSizable ( GUIEditor . window [ 1 ], false )
-- guiSetAlpha ( GUIEditor . window [ 1 ], 0.75 )
-- GUIEditor . label [ 1 ] = guiCreateLabel ( 14 , 51 , 179 , 83 , "Tu mo?esz op?aci? swoje mandaty " , false , GUIEditor . window [ 1 ])
-- guiLabelSetHorizontalAlign ( GUIEditor . label [ 1 ], "left" , true )
-- GUIEditor . button [ 1 ] = guiCreateButton ( 24 , 112 , 161 , 65 , "P?ace za jeden" , false , GUIEditor . window [ 1 ])
-- GUIEditor . button [ 2 ] = guiCreateButton ( 24 , 187 , 161 , 65 , "P?ace za wszystkie" , false , GUIEditor . window [ 1 ])
-- guiSetVisible ( GUIEditor . window [ 1 ], false )
end
addEventHandler ( "onClientMarkerHit" , loop , function( el , md )
if not md or el ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , gui1 )
showCursor ( true , false )
end )
local function win ()
removeEventHandler ( "onClientRender" , root , gui1 )
showCursor ( false )
end
--[[
addEventHandler ( "onClientMarkerLeave" , loop , function( el , md )
if el ~= localPlayer then return end
win ()
end )
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 2 ], function( plr )
local mandaty = getPlayerWantedLevel ( plr )
local mandat = mandaty * 700
if mandaty == 0 then
outputChatBox ( "* Nie posiadasz ?adnych mandat?w." , 255 , 255 , 255 , plr )
return
end
triggerServerEvent ( "setPlayerWantedLevel" , localPlayer , mandat )
win ()
end )
addEventHandler ( "onClientGUIClick" , GUIEditor . button [ 1 ], function( plr )
local mandaty = getPlayerWantedLevel ( plr )
local mandat = 700
if mandaty == 0 then
outputChatBox ( "* Nie posiadasz ?adnych mandat?w." , plr )
return
end
triggerServerEvent ( "setPlayerWantedLevel1" , localPlayer , mandaty , mandat )
end )]]--
Lecz dalej nie dzia?a!
Wysłany: 2015-08-02, 17:56
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
Moze dlatego Ci nie dziala, ze renderujesz poza ekranem ?!
Wysłany: 2015-08-02, 19:48
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Ok dzia?a...
A no i tera zrobie buttony i one si? nie pojawiaj?...
GUIEditor . button [ 1 ] = guiCreateButton ( screenW * 0.400 , screenH * 0.900 , screenW * 0.600 , screenH * 0.342 , "P?ace za jeden" , false )
GUIEditor . button [ 2 ] = guiCreateButton ( screenW * 0.400 , screenH * 0.900 , screenW * 0.600 , screenH * 0.342 , "P?ace za wszystkie" , false )
Wysłany: 2015-08-02, 20:02
#404
Wiek: 26 Na forum: 4772 dni Posty: 1438
Piwa : 2512
"DestroY" napisał/a :
GUIEditor . window [ 1 ] = dxDrawRectangle ( 56 * screenW / 800 , 50 * screenH / 600 , 12 * screenW / 800 , 15 * screen / 600 , tocolor ( 0 , 0 , 0 , 200 ), false )
Eem to co?, zak?adam mia?o by? to gui, musi by? oknem, stworzonym poprzez guiCreateWindow
Je?eli koniecznie chcesz dxDraw musisz to zrobi? poprzez Renderowanie a wszystkie inne elementy musisz ponownie przeskalowa? nie pod okno a pod ekran...
Takie zawi?e, jasniej nie umiem... Wiec stworz okno poprzez guiCreateWindow...
A? zacytuj? sw?j poprzedni post...
Tagi: opłacanie :: nie :: działa... :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: