Wysłany: 2015-08-02, 20:37
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
AHA!! Ok mam to 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
jeden = guiCreateButton ( 0.215 , 0.200 , 0.200 , 0.200 , "P?ace za jeden" , true )
GUIEditor ={
button ={},
window ={},
label ={}
}
-- / x ) * sW , / y ) * sH
function gui1 ()
local screenW , screenH = guiGetScreenSize ()
okno = dxDrawRectangle ( screenW * 0.400 , screenH * 0.600 , screenW * 0.200 , screenH * 0.300 , tocolor ( 0 , 0 , 0 , 200 ), false )
text = dxDrawText ( "PUNKT OP?AT" , screenW * 0.400 , screenH * 0.900 , screenW * 0.600 , screenH * 0.342 , tocolor ( 0 , 100 , 0 , 222 ), 1.00 , "pricedown" , "center" , "center" , false , false , true , false , false )
-- jeden = guiCreateButton ( screenW * 0.215 , screenH * 0.200 , screenW * 0.200 , screenH * 0.200 , "P?ace za jeden" , false )
-- wszystkie = guiCreateButton ( screenW * 0.215 , screenH * 0.418 , screenW * 0.366 , screenH * 0.456 , "P?ace za wszystkie" , 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 )
guiSetVisible ( jeden , true )
showCursor ( true , false )
end )
local function win ()
removeEventHandler ( "onClientRender" , root , gui1 )
guiSetVisible ( jeden , false )
showCursor ( false )
end
addEventHandler ( "onClientMarkerLeave" , loop , function( el , md )
if el ~= localPlayer then return end
guiSetVisible ( jeden , false )
win ()
end )
addEventHandler ( "onClientGUIClick" , jeden , 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" , wszystkie , 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 )
No i jak si? wbija naserwer to wida? button zap?a? za jeden!
Wysłany: 2015-08-02, 20:44
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
sW , sH = guiGetScreenSize ()
x = 1360
y = 768
local loop = createMarker ( 358.24 , 178.74 , 1008.38 - 1 , "cylinder" , 0.7 , 255 , 255 , 255 )
setElementDimension ( loop , 1636 )
setElementInterior ( loop , 3 )
jeden = guiCreateButton ( 0.215 , 0.200 , 0.200 , 0.200 , "P?ace za jeden" , true )
guiSetVisible ( jeden , false )
local screenW , screenH = guiGetScreenSize ()
function gui1 ()
dxDrawRectangle ( screenW * 0.400 , screenH * 0.600 , screenW * 0.200 , screenH * 0.300 , tocolor ( 0 , 0 , 0 , 200 ), false )
dxDrawText ( "PUNKT OP?AT" , screenW * 0.400 , screenH * 0.900 , screenW * 0.600 , screenH * 0.342 , tocolor ( 0 , 100 , 0 , 222 ), 1.00 , "pricedown" , "center" , "center" , false , false , true , false , false )
end
addEventHandler ( "onClientMarkerHit" , loop , function( el , md )
if not md or el ~= localPlayer then return end
addEventHandler ( "onClientRender" , root , gui1 )
guiSetVisible ( jeden , true )
showCursor ( true , false )
end )
addEventHandler ( "onClientMarkerLeave" , loop , function( el , md )
if el ~= localPlayer then return end
guiSetVisible ( jeden , false )
removeEventHandler ( "onClientRender" , root , gui1 )
showCursor ( false )
end )
addEventHandler ( "onClientGUIClick" , jeden , 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" , wszystkie , 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 )
Po?ow? kodu Ci wywali?em z tego... Albo by?o to bezsensem, albo nieoptymalne...
A button pokazywa? si?, bo go nie ukry?e?...
PS: Chocia? jak tak na spokojnie patrz? w ten kod... Mo?na by jeszcze wi?cej wywali? z niego...
Wysłany: 2015-08-02, 21:39
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
DestroY , Dalej to samo ...
[ Dodano : 2015-08-02, 22:34 ]
A jednak nie... wszystko dzia?a.
Tagi: opłacanie :: nie :: działa... :: gui
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: