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.
1. Zly kod - dostosowuje sie pod kazde gui.
[center][b]Mam zrobiony darkshop i jest on niezla amatorka przerobiona przeze mnie... i problem odkrylem dzis taki, ze jak zaladuje sobie obojetne jakie gui np. F1 XD i nacisne w miejsce, w ktorym mam "kup teraz" w darkshopie... to zakupie sobie bron, i tak przy uzyciu kazdego gui... Jak to naprawic?[/b][/center]

[b]Client[/b]
[lua] --[[
Author:Ramper
All rights resived!
]]

local t=createElement('text')
setElementData(t,'name','Dark Shop nWcisnij F3 by kupic bron!')
setElementDimension(t, 0)
setElementInterior(t, 0)
setElementPosition(t,-1684.26, 1062.26, 16.59)

local screenW, screenH = guiGetScreenSize()
local marker1 = createMarker(-1684.26, 1062.26, 15.59, "cylinder", 1.5, 35, 142, 35)
local sx,sy=guiGetScreenSize()

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

function draw ()
dxDrawRectangle(screenW * 0.3547, screenH * 0.0533, screenW * 0.2906, screenH * 0.8933, tocolor(3, 0, 0, 222), false)
dxDrawImage(screenW * 0.3547, screenH * 0.0783, screenW * 0.0641, screenH * 0.0467, "AK47.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawLine(screenW * 0.3531, screenH * 0.1417, screenW * 0.6461, screenH * 0.1417, tocolor(19, 177, 3, 222), 1,...
2. Brak wyświetlania gui.
Hejka. Od razu m?wi? o co chodzi, gui po prostu si? nie wy?wietla. Zawsze mi to stanowi?o problem.


pokazGui 
false
---glowne gui render
function renderGui()
if 
pokazGui == true then
    guiSetVisible
(gui.window1true)
    
guiSetVisible(gui.button3true)
    
guiSetVisible(gui.button1true)
    
guiSetVisible(gui.button2true)
    else
    
guiSetVisible(gui.window1false)
    
guiSetVisible(gui.button3false)
    
guiSetVisible(gui.button2false)
    
guiSetVisible(gui.button1false)
end

------jakidalszy kod

addCommandHandler
("panel"root, function()
  if 
getElementData(localPlayer"player:ekipa"truethen
     
if pokazGui == false then
       pokazGui 
true
   
else
         if 
pokazGui == true then
         pokazGui 
false
         end
    end
end
)



Od razu m?wi?, brak b??d?w w db3.
3. Tworzenie GUI. Reszta elementów się nie tworzy.
Mam problem z innymi elementami podpi?tymi pod okno GUI.
Wy?wietla si? tylko okno (window), a reszta element?w ju? nie.
    if not gui then
        gui 
= {}
        
showCursor (true)
        
gui[1] = guiCreateWindow (437*w239*h492*w290*h"Sprzeda? pojazdu 1/3"false)
        
gui[2] = guiCreateGridList (454*w310*h455*w137*hfalsegui[1])
        
gui[3] = guiGridListAddColumn (gui[2], "Nick gracza:"0.9)
        
gui[4] = guiCreateButton (685*w466*h223*w49*h"Zamknij okno"falsegui[1])
        
gui[5] = guiCreateButton (454*w466*h223*w49*h"Nast?pny krok"falsegui[1])
        
addEventHandler ("onClientGUIClick"gui[4], onSprzedazClickZamknijfalse)
        
addEventHandler ("onClientGUIClick"gui[5], onSprzedazClickGraczeDalejfalse)
    
end


Wi?cej kodu nie potrzeba. Za pomoc stawiam piwo i respekt.
4. Tuner w gui.
Witam,
mam pewien problem, a mianowicie gdy wchodze w urzedzie do markeru, w ktorym mozna zatrudnic sie w tunerze, to nie ukazuje si? tam nic oprocz gui.
Prosze o pomoc.
5. Nie wyświetla mi się gui.
Witam kiedy? robi?em sobie GUI a dok?adnie login panel. I wszystko dzia?a?o. A tutaj nie chce mi si? wy?wietli?.

[lua]
-------------------------
--Zmienne
local screenW, screenH = guiGetScreenSize()
-------------------------
--Gui
function gui()
bg = guiCreateStaticImage((screenW - 359) / 2, (screenH - 426) / 2, 359, 426, "files/img/dot_white.png", false)
guiSetProperty(bg, "ImageColours", "tl:FF191919 tr:FF191919 bl:FF191919 br:FF191919")
bg_gold = guiCreateStaticImage(-3, 416, 363, 10, ":guieditor/images/dot_white.png", false, bg)
guiSetProperty(bg_gold, "ImageColours", "tl:FFFEA31F tr:FFFEA31F bl:FFFEA31F br:FFFEA31F")
logo = guiCreateStaticImage(46, 14, 278, 96, ":guieditor/images/examples/mtalogo.png", false, bg)
login = guiCreateEdit(0.13, 0.36, 0.79, 0.10, "", true, bg)
pass = guiCreateEdit(0.13, 0.56, 0.79, 0.10, "", true, bg)
button = guiCreateStaticImage(48, 322, 280, 42, ":guieditor/images/dx_elements/slider_pointer.png", false, bg)
guiSetProperty(button, "ImageColours", "tl:FFFEA31F tr:FFFEA31F bl:FFFEA31F br:FFFEA31F")
end
function showGUI()
guiSetVisible ( bg, true )
guiSetVisible ( bg_gold, true )
guiSetVisible ( logo, true )
guiSetVisible ( login, true )
guiSetVisible ( pass, true )
guiSetVisible ( button, true )
showCursor(true)
end
addEventHandler("onClientResourceStart", showGUI)
[/lu...
6. [SKRYPT] Login panel w GUI.
Witam, ostatnio znalaz?em login panel w community, przerobi?em go na ?adniejszy i spolszczy?em. Mam nadziej? ?e si? podoba. ^^

~ Cholewka.

Wiem ?e bardzo taki rutynowy, ale mam nadzieje ?e komu? si? spodoba. ^^


Link z community:
https://community.multitheftauto.com/index.php?p=resources&s=details&id=14369

W 50% autor skryptu: Function#




---



---



---



---



---



---



Pobieranie loginpanelu:
Kliknij mnie. [/center]
7. Wiele funkcji na raz po kliknieciu w okno gui.
Witam, gdy w moim gui klikam w przycisk wykonuje sie funkcja przypisana do tego przycisku ale gdy klikne w okno gui wykonuj? sie funkcje przypisane do wszystkich przycisk?w.My?le ?e napisa?em zrozumiale, nie wiem jak rozwi?za? ten problem.Prosze o pomoc
Kod:


----- Tutaj jest kod GUI ----
guiSetVisible(okno,false)
ammumarker=createMarker ( 295.33187866211,-38.300151824951,1000.515625 , "cylinder", 1.0, 0, 255, 0, 100 )
setElementDimension (ammumarker, 0)
setElementInterior ( ammumarker, 1 ,295.33187866211,-38.300151824951,1000.515625 )
addEventHandler("onClientMarkerHit", ammumarker, function(el,md)
if el~=localPlayer then return end
if not guiGetVisible(okno) then
showCursor(true,false)
guiSetVisible(okno,true)
toggleControl("fire",false)
toogleControl("aim_weapon",false)
end
end)


function leave(el,md)
if el~=localPlayer then return end
if guiGetVisible(okno) then
showCursor(false)
guiSetVisible(okno, false)
toggleControl("fire",true)
toogleControl("aim_weapon",true)
end
end
addEventHandler("onClientMarkerLeave", ammumarker,leave)
8. Jak zrobić ruchome GUI.
Witam wszystkich. Mam problem, ot?? jestem w trakcie pisania skryptu i tak si? zastanawiam jak zrobi? ruchome GUI. Widzia?em ju? takie zjawiska, ?e przyk?adowo okno GUI wyje?d?a sobie z prawej strony monitora. Ma kto? pomys? jak to zrobi??
9. Zabezpieczenie przed wyswietlaniem gui.
Witam! Potrzebuje pomocy z skryptem.
A wi?c chc? doda? zabezpieczenie, gdy w bazie danych kolumna prezenty = 1 to gui nie wy?wietla si?. Mog?by mi kto? z tym pom?c?

Cytat:


createBlip(1482.05, -1685.51, 14.05,26, 2, 255,0,0,255,0,400)
-- Skrypt na prezenty by TheMarcin450

local marker = createMarker(1482.05, -1685.51, 14.05-0.90, "cylinder", 2, 255, 255, 255, 25)
local t=createElement("text")
setElementPosition(t, 1482.05, -1685.51, 14.05)
setElementData(t,"name","Odbierz prezent swiateczny!nDostepne juz wkrotce!")


addEventHandler("onClientMarkerHit", marker, function(el,md)
if not md or el~=localPlayer then return end
if guiGetVisible(wm.window) then return end
showCursor(true)
guiSetVisible(wm.window,true)
end)
10. Trigger oraz centrowanie gui.
Mam dwa pytania, pierwsze to jak wycentrowa? gui?

Drugie, zwi?zane z tym triggerem:
triggerServerEvent "genderforwarded"resourceRoot"male")

w jaki spos?b przekaza? dane tak by po stronie server w tym even'cie "genderforwarded" mo?na by?o u?ywa? elementu "source" lub dopisa? do funkcji "player" i to by dzia?a?o, poniewa? u?ywaj?c tego source, oraz po paru testach player okazuje si?, ?e konsola wywala b??d typu expected element at argument.. bla bla.

Za ka?d? trafn? pomoc ofiaruj? piwko, dzi?ki.
11. Guzik w gui.
Co zrobi? aby guzik w gui wykonywa? dan? komend??
12. Logowanie do teamu GUI.
Witam mam skrypty na logowania jak w Temacie ale gui si? nie wy?wietla.
META.xml
[lua]
<meta>
<info author="KineQ" type="script" version="1.1"/>
<script src="server.lua" type="server" />
<script src="client.lua" type="client" />
</meta>
[/lua]
Client.lua
[lua]
GUIEditor = {
button = {},
window = {},
label = {}
}
addCommandHandler ( "loginpoli", resourceRoot.
function()
GUIEditor.window[1] = guiCreateWindow(234, 135, 329, 279, "Logowanie Do Frakcji", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.68)

button.login = guiCreateButton(48, 193, 232, 52, "Zaloguj", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(80, 255, 172, 15, "Logowanie Do Frakcji By KineQ", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(71, 45, 188, 47, "Logowanie Do Frakcji Policja", false, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false)
end
)


addEventHandler("OnClientGUIClick", button.login, poli1)

[/lua]
Server.lua
[lua]
poli = createTeam ( "Policja", 0, 0, 255 )


function poli1 ( thePlayer )
local playerName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ( &q...
13. Polskie znaki w gui.
Witam, czy jest mo?liwo?? wprowadzenia do okna gui polskich znak?w ?
14. Oskryptowanie gui.
Witam wszystkich u?ytkownik?w forum. Jestem nowy w ?wiecie .lua. Dzisiaj zrobi?em gui na panel policji i chia? bym sie was zapytac, drodzy weterani. Jak moge oskryptowa? moje gui. Pokaze ss-a jak to gui wyglada. Chcia? bym was poprosi? aby?cie wyt?umaczyli mi jak te funkcje cale zrobi? itp. Jak by kto? by? sk?onny pom?c to GG:3689199

A tu moje wypociny kodowe :

[IMG]http://iv.pl/images/01316617401727685410.png[/IMG]

[size=18] Zawarto?? pliku policja_c[/size]
[code]GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Edit = {}
GUIEditor_Grid = {}

GUIEditor_Window[1] = guiCreateWindow(0.3703,0.1014,0.2383,0.5681,"Panel Policji",true)
guiSetVisible(GUIEditor_Window[1], false)
GUIEditor_Button[1] = guiCreateButton(202,39,91,29,"Mandat",false,GUIEditor_Window[1])
GUIEditor_Button[2] = guiCreateButton(203,74,91,29,"Wiezienie",false,GUIEditor_Window[1])
GUIEditor_Button[3] = guiCreateButton(205,110,91,29,"Kick",false,GUIEditor_Window[1])
GUIEditor_Grid[1] = guiCreateGridList(36,49,160,247,false,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)

guiGridListAddColumn(GUIEditor_Grid[1],"Gracze:",0.2)
GUIEditor_Button[4] = guiCreateButton(206,146,90,30,"Score",false,GUIEditor_Window[1])
GUIEditor_Button[5] = guiCreateButton(91,133,5,5,"",false,GUIEditor_Button[4])
GUIEditor_Edit[1] = guiCreateEdit(28,327,197,30,"Ilosc",false,GUIEditor_Window[1])...
15. [SKRYPT] [INNE] Komenda /admins w
Wiele os?b chcia?o, prosz?:

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

Jest to kod. :P