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: button
1. [SKRYPT] Button RivalRPG
Witam, oddaje wam system buttonów odwzorowane z serwera RivalRPG by xyzzzikk, IQ

Skrypt został odwzorowany na zlecenie dla mnie na mój stary projekt lecz mi się już to nie przyda tylko zalega na dysku.

Poprawne użycie skryptu (przykład niżej się znajduje):|

exports['button']:createButton(text, x, w, h, image, color)
(DOSTOSOWAĆ POD WŁASNE SKALOWANIE!!!)

Przypominam o dodaniu własnego fonta


ScrenShot:



Film:
YouTube ( DAJ SUBA)


Autor: .mydev

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


ps.edit (link)
*Nie dlugo wersja V2*
2. GUI podpinania button i editbox Jak to zrobić
Witam poprzedni temat zosta? zablokowany wi?c stworzy?em nowy. prosz? o pomoc w GUI nie umiem podpi?? button i editbox pod gotow? komend? /jail

Tutaj ni?ej podaje code od skryptu w jaki spos?b to wykona?.
Zdj?cie panelu: https://imgur.com/a/KRBPoMR

PANEL:

[code]local gui = {}

gui.window = guiCreateWindow(0.28, 0.20, 0.47, 0.60, "Panel-Jail", true)
guiWindowSetMovable(gui.window, false)
guiWindowSetSizable(gui.window, false)
guiSetVisible(gui.window, false)

gui.button = guiCreateButton(0.06, 0.10, 0.39, 0.13, "Potwierdz", true, gui.window)
gui.button2 = guiCreateButton(0.06, 0.25, 0.39, 0.13, "Zamknij", true, gui.window)
gui.edit1 = guiCreateEdit(0.07, 0.52, 0.38, 0.07, "", true, gui.window)
gui.edit2 = guiCreateEdit(0.07, 0.62, 0.38, 0.07, "", true, gui.window)
gui.text = guiCreateLabel(0.07, 0.60, 0.38, 0.02, "Czas..", true, gui.window)
gui.text = guiCreateLabel(0.07, 0.50, 0.38, 0.02, "Nick..", true, gui.window)
gui.edit3 = guiCreateEdit(0.07, 0.72, 0.38, 0.07, "", true, gui.window)
gui.text = guiCreateLabel(62, 449, 344, 18, "Jednostka m/h..", false, gui.window)
gui.edit4 = guiCreateEdit(0.07, 0.82, 0.38, 0.07, "", true, gui.window)
gui.text = guiCreateLabel(62, 515, 344, 18, "Pow?d..", false, gui.window)


addEvent("marker"...
3. Button z hasłem
Cze??.

Mam problem z buttonem do has?a gdy? te has?o si? tzw. Nie gwiazdkuje i jest odkryte. I nie wiem jak zakry? to bo mam poprostu zrobione to w metodzie ni?ej i has?o jest niestety odkryte. Kto? co???

Kod:

dxDrawText(guiGetText(data.button[2]),675*px, 415*py, 754*px, 435*py,tocolor(255,255,255,255),1.1, "default-bold", "center", "center", false, false, false, false, false)


ss:


4. Button nil value
Witam posiadam frakcje z gm PSSM i we frakcji SAPD nie moge wyciaga? pojazd?w z prakingu wirtualnego.


[lua]local screenW, screenH = guiGetScreenSize()

function pokazgui()
exports["buttons"]:createCustomWindow("Wirtualny Parking", screenW * 0.2016, screenH * 0.2286, screenW * 0.6092, screenH * 0.5805, tocolor(255, 255, 255, 255), false)
exports["buttons"]:createCustomButton("Akademia", screenW * 0.2192, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Radiow?z", screenW * 0.3692, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Radiow?z2", screenW * 0.5292, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Merit", screenW * 0.6792, screenH * 0.3019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Enforcer", screenW * 0.2192, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Premier", screenW * 0.3692, screenH * 0.4019, screenW * 0.1094, screenH * 0.0600, tocolor(255,255,255,255), false)
exports["buttons"]:createCustomButton("Holownik", screenW ...
5. button
Dobry,mam problem z buttonem.Chcia?bym zrobi? ?eby po klikni?ciu w niego pokazywa?o si? np wiadomo??.Zrobi?em sw?j kod ale co? mi w nim nie dzia?a
local button guiCreateButton(47238521878""false)  
addEventHandler "onClientGUIClick"buttoncostam)
function 
costam()
    
outputChatBox("cos"255255255)
end
6. Button nie reaguje na zamknięcie
Witam, przychodz? mo?e i ze zbyt prostym problemem, ale podczas nauki LUA nie mog? zamkn?? gui, a przycisk nie reaguje. GUI zrobione jest w dxdraw.


addEvent
("okno",true)
addEventHandler("okno"root, function(value)
if 
not value then return end
tekst 
value
showCursor
(true)
addEventHandler("onClientRender"rootostrzezenie)
        function 
warnClose()
            if 
isMouseIn(screenW 0.5555screenH 0.5875screenW 0.1008screenH 0.0653then -- miejsce buttona
            
if value then
                removeEventHandler
("onClientRender"rootostrzezenie)
                
end
            end
        end
       end
)


isMouseIn jakby kto? potrzebowa?, ale jestem pewny, ?e to dzia?a:

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


Za pomoc stawiam :piwo:
7. Button Gui
Witam tworz? skrypt, lecz gdy chc? doda? do niego "button" i wjad? w marker wszystkim si? on pokazuje. Kod jest po stronie clienta. Prosi? bym o pomoc ?eby tylko wy?wietla? si? osobie kt?ra wjecha?a w marker.

addEvent
("guiwyswieetla"true)
addEventHandler("guiwyswieetla"getRootElement(), function()
guiCreateButton(0.55,0.5,0.15,0.2,"k**** TO NIE CHCE DZIA?A?!",true)
end)


8. Static image jako button
Witam, mam pomys? na ?adny login panel, I zrobi?em w gimpie przycisk. Potem w gui editorze zrobi?em ca?y login panel. I teraz oto taki mam problem:
Jak zrobi? gdy si? najedzie na to zdj?cie to zmieni si? kolor a potem gdy si? kursorem "wyjedzie" z tego zdj?cia to przywr?ci poprzedni kolor. Oraz gdy si? kliknie w przycisk to si? te? zmieni kolor oraz wywo?a si? jaka? funkcja. Oczywi?cie rep i zimne piwko. Mo?ecie te? poda? funkcje na mta sa to sobie sam zrobi? ify.

[ Dodano : 2017-07-17, 20:17 ]
Aktualny kod:
[lua]
-- Pomocne zmienne
local FMain = guiCreateFont("files/fonts/lato.tff", 18)
local screenW, screenH = guiGetScreenSize()
-- GUI:
addEventHandler("onClientResourceStart", resourceRoot,
function()

Bg = guiCreateStaticImage((screenW - 410) / 2, (screenH - 431) / 2, 410, 431, ":elife-login/files/img/bg_login.png", false)
Ilogin = guiCreateStaticImage(10, 89, 390, 64, ":elife-login/files/img/butt_login.png", false, Bg)
Ipass = guiCreateStaticImage(10, 191, 390, 67, ":elife-login/files/img/butt_login.png", false, Bg)
button_i = guiCreateStaticImage(11, 304, 389, 71, ":elife-login/files/img/butt_login.png", false, Bg)
guiSetProperty(button, "ImageColours", "tl:FFC87811 tr:FFC87811 bl:FFC87811 br:FFC87811")
butt_text = guiCreateLabel(26, 11, 329, 54, "Zaloguj si?", false, button)
guiSetFont(butt_text, "FMain")
l...
9. kolorowy button
1.Bo tak mnie ciekawi czy mo?na zrobi? kolorowy button ? Bo jedynie to wiem ,?e tekst .

2. Sprawa bo nie chcialem za?mieca? forum , to dobrze zrobilem dxTekst jako funkcje ?

local screenW
screenH guiGetScreenSize()
dxDrawText("Spawn"sx*-80/1024sy*-185/768sx*323/1024sy*386/768white1.00"default-bold""center""center"false

bo jej nie widz?
10. Button

function podmien17()
if 
source ~= G3A3 then  return end
            
if isElementWithinMarker(localPlayermarkerthen
            triggerServerEvent 
("neu" localPlayer)
            
outputChatBox("Statystyki Broni :#ffcc33Szybko-Porusznie +1 ",255,255,250,true)
            
dff engineLoadDFF "G3A3.dff"355 )
            
engineReplaceModel dff355 )
            
txd engineLoadTXD "G3A3.txd" )
            
engineImportTXD txd355 )
local team getPlayerTeam(localPlayer)
            
local teamName getTeamName(team)
            if 
teamName=="hakis team" then
            
            
if guiGetVisible(punkt3) == true then
            guiSetVisible
(punkt3false)
            
showCursor(false)
            
end
            end
    end
end
addEventHandler
("onClientGUIClick"root,podmien17)


a oto db3
guiWindowSetSizable [Expected gui-window at argument 1, got gui-tabpanel]

jak wiadomo klikam i nie znika mi gui , wczesniej dzia?a?o .
11. button
elo mam problem , button , podmienia , jak trzeba tylko nie zmienia ammo .
Pomo?ecie ?

function podmien()
if 
source == buy then
            
if isElementWithinMarker(localPlayermarkerthen
            setWeaponProperty
(29"pro""maximum_clip_ammo"50)
            
dff engineLoadDFF "qbz951.dff"355 )
            
engineReplaceModel dff355 )
            
txd engineLoadTXD "qbz951.txd" )
            
engineImportTXD txd355 )
            
guiSetVisible(napadfalse)
            
showCursor(false)
          
end
    end
end
addEventHandler
("onClientGUIClick"root,podmien)
12. Button
Czy te linijki odpowiadaja za buttona?
function clientClicking btnstatex)
    if ( 
btn == 'left' and not guiGetVisible window ) and state == 'down' and isOpen then
        
if ( >=  pY+370 and <=  pY+370 then
            local user
pass guiGetText username ), guiGetText password )
            -- 
Login Button --
            if ( 
>= pX+25 and <= pX+440then
                
if ( string.gsub user' ''' ) ~= '' and string.gsub pass' ''' ) ~= '' then
                    
if ( string.find user'%s' ) ) then
                        
return sendError "Spaces (' ') are not allowednin the username." )
                    
end if ( string.find pass'%s' ) ) then
                        
return sendError "Spaces (' ') are not allowednin the password." )
                    
end
                    triggerServerEvent 
"Login:onClientAttemptLogin"localPlayeruserpass )
                else
                    
sendError "A username and password arenrequired to access the server." )
                
end
13. GridList potem button
Mam takie co? i nie dzia?a mi ze po klikni?ciu w gridlist a potem button dopiero si? co? wykonuje

[lua]
grid = guiCreateGridList(9, 29, 461, 302, false, panel)
guiGridListAddColumn(grid, "Nazwa", 0.2)
guiGridListAddColumn(grid, "ID", 0.2)
guiGridListAddColumn(grid, "Cena", 0.2)
guiGridListAddColumn(grid, "Zamontowano", 0.2)
for i = 1, 3 do
guiGridListAddRow(grid)
end
felgiahab = guiGridListSetItemText(grid, 0, 1, "Felgi Ahab", false, false)
guiGridListSetItemText(grid, 0, 2, "1083", false, false)
guiGridListSetItemText(grid, 0, 3, "5000", false, false)
guiGridListSetItemText(grid, 0, 4, "Brak danych", false, false)
guiGridListSetItemText(grid, 1, 1, "-", false, false)
guiGridListSetItemText(grid, 1, 2, "-", false, false)
guiGridListSetItemText(grid, 1, 3, "-", false, false)
guiGridListSetItemText(grid, 1, 4, "-", false, false)
guiGridListSetItemText(grid, 2, 1, "-", false, false)
guiGridListSetItemText(grid, 2, 2, "-", false, false)
guiGridListSetItemText(grid, 2, 3, "-", false, false)
guiGridListSetItemText(grid, 2, 4, "-", false, false)
guiSetVisible (paneltune, false )
guiSetVisible (grid, false )

function otworzp(gracz)
guiSetVisible (panel, true)
guiSetVisible (grid, true)
showCursor(true)
end
addEvent("opanel", true)
addEventHandler("opa...
14. GUI Button
addEventHandler "onClientGUIClick"guzik
function()
    
showCursor(false)
    
guiSetVisible(window,false)
end)

Mam b??d,
expected element at argument 2, addEventHandler
15. gui button
Witam, wytlumaczy? by mi kto? jak zrobi?, aby guzik w gui mo?na by?o u?y? raz na 10 min
Z g?ry dzi?kuje za pomoc
16. Button pod team
Witam jak zrobi? np. przycisk zadzwon jak nacisnie team policja to bedzie co? si? dzia? a jak zwyk?y gracz to nie bedzie dzia?
17. Zamkniecie gui przez button
Witam, jak zrobi? ?eby po naci?ni?ciu buttonu "Zako?cz" zamkne?o si? gui?

function onClickBtn(Button)
if GUIEditor.button[1] then
(...)?
18. Tankowanie button
Jak zrobi? ten button :


button1 
guiCreateButton(1410032357"Zatankuj 10% za 3.67 PLN"falsepanelfuel)


Aby dzia?a?o tankowanie, kt?re jest zawarte w tej funkcji. Po prostu tej funkcji chce si? pozby?, a chc?, ?eby tankowanie by?o poprzez przycisk.


function setTimerRefillGas(enabled
 if(
isPedInVehicle(getLocalPlayer())) then
        local player 
getLocalPlayer()
        
local vehicle getPedOccupiedVehicle(player)
        
local fuel getElementData(vehicle,"fuel")
        if(
tonumber(fuel) < 100then

setElementData
(vehicle,"fuel",getElementData(vehicle"fuel") +10)
distanceOld distance
end
end
end 
addEventHandler
("onGasRefill",getRootElement(),setTimerRefillGas
19. Komenda podpięta pod Button
Witam. Mam do was ma?e pytanko. A wi?c chcia? bym zrobi? panel do logowania frakcji. Ca?y panel ju? zrobi?em ale chcia? bym ?eby np button "Policja" wykonywa? komend? /loginpoli. Wiec jak to zrobic ? Mozecie podac jakis przyklad.
Za pomoc beda piwka :)
20. Button po najechaniu na niego kursorem
Witam, mam problem, poniewa? nie wiem jak zrobi? takie co?, ?e jak si? najedzie kursorem na button to on np. zmienia kolor, czy tam przezroczysto??.
21. Grafika jako button - jak to zrobić?
Witajcie!
Jak zrobi?, aby grafika dzia?a?a jak button, je?li w ni? klikniemy, przechodzimy do nast?pnego GUI?
22. Button na własnym obrazku w GUI
Witam, mam okienko GUI w kt?rym jest w?asne t?o (ca?e okno jest niebieskie) i ustawi?em przyciski(buttony) na tym obrazku (tle) i w nie da si? klikn??. Czy to normalne? Czy co? ?le zrobi?em?