Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-05-07, 22:12


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

W debugu wyskakuje b??d "load script failed... ...'='expected near ' "
Rozumiem co to znaczy, ale nie wiem czemu ten b??d wyskakuje. Jest to 2 linijka.
Takiej samej funkcji u?ywa?em ju? kilka razy i jest wszystko ok...


function wyjdz1 ()
    (source GUIEditor_Button[4]) then
        guiSetVisible(GUIEditor_Window[1], false)
        (false)
  end
end
addEventHandler("onClientGUIClick"GUIEditor_Button[4], wyjdz1 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 22:15


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

ifa zgubi?e? i...to (false) pod koniec funkcji to co ma robi?? ;)
function wyjdz1 ()
    if (source GUIEditor_Button[4]) then
        guiSetVisible(GUIEditor_Window[1], false)
  end
end
addEventHandler("onClientGUIClick"GUIEditor_Button[4], wyjdz1)


Ciekawostka, ta linijka sprawdzaj?ca czy naci?ni?ty przycisk to GUIEditor_Button[4] jest zb?dna, deklarujesz j? w evencie ;)
Kod wi?c b?dzie dzia?a? gdy zrobimy tak:
function wyjdz1 ()
guiSetVisible(GUIEditor_Window[1], false)
end
addEventHandler("onClientGUIClick"GUIEditor_Button[4], wyjdz1)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 22:31


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Ziomek11, on doda? ifa ?eby si? nie bugowa?o

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 22:35


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Chodzi o bug, ?e klikasz po za przyciskiem a funkcja i tak si? aktywuje? ;)
Z tego co pami?tam, mo?esz doda? "false" w aktywacji eventu i te? b?dzie dzia?a?o :)

addEventHandler("onClientGUIClick"GUIEditor_Button[4], wyjdz1false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 22:40


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

Ci?g dalszy b??d?w :P
Unexpenced symbol near 'if'*. 3 linijka.

function Prawo ()
     local player guiGridListGetItemText (GUIEditor_Grid[1], 
        if guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1then
           guiSetVisible(GUIEditor_Window[2], true)
           guiSetVisible(GUIEditor_Window[1], false)
           showCursor(true)
         else
         outputChatBox("Nie Wybrales gracza!"root25500true)
end
addEventHandler("onClientGUIClick"GUIEditor_Button[1], Prawo)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 22:49


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

function Prawo ()
     local player guiGridListGetItemText (GUIEditor_Grid[1])
        if guiGridListGetSelectedItem (GUIEditor_Grid[1], 1then
           guiSetVisible(GUIEditor_Window[2], true)
           guiSetVisible(GUIEditor_Window[1], false)
           showCursor(true)
         else
         outputChatBox("Nie Wybrales gracza!"25500true)
         end
end
addEventHandler("onClientGUIClick"GUIEditor_Button[1], Prawo)


Pami?taj o zamykaniu nawias?w i dawaniu end?w, gdy ko?czymy "ifa".
Poprawi?em przy okazji wiadomo?? wysy?an? na czacie, to "root" by?o zb?dne.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 23:05


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

Skrypt ju? si? uruchomi?, ale mam kolejn? paczk? b??d?w :|
I thx za pomoc :D



Ostatnia linijka, b??d: bad argument 'addeventhendler' [expected element at argument 3,got nill]
function KatA()
        setElementData(targetPlayer"Prawo jazdy Kategorii A"true)
          outputChatBox("Gracz " .. nick .. " otrzyma?? Prawo Jazdy Kategorii A",player2552000true )
    end
end
addEventHandler"onClientGUIClick"GUIEditor_Button[5], KatA)


Ostatnia linijka, b??d: bad argument 'addeventhendler' [expected element at argument 2,got nill]
function wyjdz1 ()
   guiSetVisible(GUIEditor_Window[1], false)
 end
addEventHandler("onClientGUIClick"GUIEditor_Button[4], wyjdz1)




8 Linijka : bad argument 'guisetvisible' [expected element at argument 1,got nill]
Ten b??d wyskakuje gdy chc? uruchomi? panel.
function show() 
    if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("Urzad")) then
      guiGridListClear(GUIEditor_Grid[1]) 
       for idplayeritem in ipairs(getElementsByType("player")) do
         local row guiGridListAddRow GUIEditor_Grid[1] )
         guiGridListSetItemText GUIEditor_Grid[1], rowkolumnagetPlayerName playeritem ), falsefalse )
      end 
      guiSetVisible(GUIEditor_Window[1], true)
      showCursor(true)
    end
end
addCommandHandler("p"show)

*Kursor jest.

?adnego z tych b??d?w nie rozumiem, i dla tego prosz? jeszcze raz o pomoc :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-07, 23:53


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Poka? zdefiniowane tablice:

GUIEditor_*

gdzie * oznacza "Window", "Button" itp. Po prostu poka? wszystkie te tablice tutaj.

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 00:10


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Scrollpane = {}
GUIEditor_Scrollbar = {}

GUIEditor_Window[1] = guiCreateWindow(471,395,328,306,"Panel Urz??du by .::Heniek::.",false)
GUIEditor_Grid[1] = guiCreateGridList(0.0274,0.0882,0.4421,0.8693,true,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Scrollpane[1] = guiCreateScrollPane(0.378,0.098,0.0152,0.683,true,GUIEditor_Window[1])
GUIEditor_Scrollbar[1] = guiCreateScrollBar(0.3841,0.1013,0.0732,0.8529,false,true,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(0.5213,0.1111,0.4177,0.1144,"Prawo Jazdy",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[1],"default-bold-small")
GUIEditor_Button[2] = guiCreateButton(0.5213,0.2647,0.4177,0.1144,"Dow??d",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[2],"default-bold-small")
GUIEditor_Button[3] = guiCreateButton(0.5213,0.4314,0.4177,0.1144,"Rejestracja Pojazdu",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[3],"default-bold-small")
GUIEditor_Button[4] = guiCreateButton(0.5213,0.8366,0.4177,0.1144,"Wyjd??",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[4],"default-bold-small")
kolumna guiGridListAddColumnGUIEditor_Grid[1], "Gracze"0.99 ) 
    guiSetVisible(GUIEditor_Window[1], falseGUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Label = {}

GUIEditor_Window[2] = guiCreateWindow(540,152,267,371,"Wydaj Prawo Jazdy",false)
GUIEditor_Label[1] = guiCreateLabel(164,-167,5,5,"",false,GUIEditor_Window[2])
GUIEditor_Button[5] = guiCreateButton(0.0824,0.1806,0.839,0.0997,"Kategoria A",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[5],"default-bold-small")
GUIEditor_Button[6] = guiCreateButton(0.0824,0.3585,0.839,0.0997,"Kategoria B",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[6],"default-bold-small")
GUIEditor_Button[7] = guiCreateButton(0.0824,0.5472,0.839,0.0997,"Kategoria C",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[7],"default-bold-small")
GUIEditor_Button[8] = guiCreateButton(0.0824,0.7278,0.839,0.0997,"Kategoria C+E",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[8],"default-bold-small")
GUIEditor_Button[9] = guiCreateButton(0.2846,0.8544,0.427,0.0943,"Wyjd??",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[9],"default-bold-small")
GUIEditor_Label[2] = guiCreateLabel(0.0861,0.0997,0.8202,0.0728,"",true,GUIEditor_Window[2])
GUIEditor_Label[3] = guiCreateLabel(0.0861,0.2803,0.8277,0.0728,"",true,GUIEditor_Window[2])
GUIEditor_Label[4] = guiCreateLabel(0.0899,0.4582,0.8165,0.0836,"",true,GUIEditor_Window[2])
GUIEditor_Label[5] = guiCreateLabel(0.0936,0.6496,0.8127,0.0701,"",true,GUIEditor_Window[2])
    guiSetVisible(GUIEditor_Window[2], false



Prosz?.

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 10:32


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Definiujesz tablice -> Tworzysz okienko -> Definiujesz od nowa te same tablice (Window i Button) jednocze?nie je czyszcz?c.

GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Scrollpane = {}
GUIEditor_Scrollbar = {}
GUIEditor_Label = {}

GUIEditor_Window[1] = guiCreateWindow(471,395,328,306,"Panel Urz??du by .::Heniek::.",false)
GUIEditor_Grid[1] = guiCreateGridList(0.0274,0.0882,0.4421,0.8693,true,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Scrollpane[1] = guiCreateScrollPane(0.378,0.098,0.0152,0.683,true,GUIEditor_Window[1])
GUIEditor_Scrollbar[1] = guiCreateScrollBar(0.3841,0.1013,0.0732,0.8529,false,true,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(0.5213,0.1111,0.4177,0.1144,"Prawo Jazdy",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[1],"default-bold-small")
GUIEditor_Button[2] = guiCreateButton(0.5213,0.2647,0.4177,0.1144,"Dow??d",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[2],"default-bold-small")
GUIEditor_Button[3] = guiCreateButton(0.5213,0.4314,0.4177,0.1144,"Rejestracja Pojazdu",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[3],"default-bold-small")
GUIEditor_Button[4] = guiCreateButton(0.5213,0.8366,0.4177,0.1144,"Wyjd??",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[4],"default-bold-small")
kolumna guiGridListAddColumnGUIEditor_Grid[1], "Gracze"0.99 ) 
    guiSetVisible(GUIEditor_Window[1], falseGUIEditor_Window[2] = guiCreateWindow(540,152,267,371,"Wydaj Prawo Jazdy",false)
GUIEditor_Label[1] = guiCreateLabel(164,-167,5,5,"",false,GUIEditor_Window[2])
GUIEditor_Button[5] = guiCreateButton(0.0824,0.1806,0.839,0.0997,"Kategoria A",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[5],"default-bold-small")
GUIEditor_Button[6] = guiCreateButton(0.0824,0.3585,0.839,0.0997,"Kategoria B",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[6],"default-bold-small")
GUIEditor_Button[7] = guiCreateButton(0.0824,0.5472,0.839,0.0997,"Kategoria C",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[7],"default-bold-small")
GUIEditor_Button[8] = guiCreateButton(0.0824,0.7278,0.839,0.0997,"Kategoria C+E",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[8],"default-bold-small")
GUIEditor_Button[9] = guiCreateButton(0.2846,0.8544,0.427,0.0943,"Wyjd??",true,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[9],"default-bold-small")
GUIEditor_Label[2] = guiCreateLabel(0.0861,0.0997,0.8202,0.0728,"",true,GUIEditor_Window[2])
GUIEditor_Label[3] = guiCreateLabel(0.0861,0.2803,0.8277,0.0728,"",true,GUIEditor_Window[2])
GUIEditor_Label[4] = guiCreateLabel(0.0899,0.4582,0.8165,0.0836,"",true,GUIEditor_Window[2])
GUIEditor_Label[5] = guiCreateLabel(0.0936,0.6496,0.8127,0.0701,"",true,GUIEditor_Window[2])
    guiSetVisible(GUIEditor_Window[2], false


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 13:51


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

Wprowadzi?em kilka zmian, wi?c przedstawi? to co zmieni?em.

GUIEditor_Window = {}
GUIEditor_Button = {}
GUIEditor_Grid = {}
GUIEditor_Scrollpane = {}
GUIEditor_Scrollbar = {}
GUIEditor_Label = {}

GUIEditor_Window[1] = guiCreateWindow(471,395,328,306,"Panel Urz??du by .::Heniek::.",false)
GUIEditor_Grid[1] = guiCreateGridList(0.0274,0.0882,0.4421,0.8693,true,GUIEditor_Window[1])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Scrollpane[1] = guiCreateScrollPane(0.378,0.098,0.0152,0.683,true,GUIEditor_Window[1])
GUIEditor_Scrollbar[1] = guiCreateScrollBar(0.3841,0.1013,0.0732,0.8529,false,true,GUIEditor_Window[1])
GUIEditor_Button[1] = guiCreateButton(0.5213,0.1111,0.4177,0.1144,"Prawo Jazdy",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[1],"default-bold-small")
GUIEditor_Button[2] = guiCreateButton(0.5213,0.2647,0.4177,0.1144,"Dow??d",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[2],"default-bold-small")
GUIEditor_Button[3] = guiCreateButton(0.5213,0.4314,0.4177,0.1144,"Rejestracja Pojazdu",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[3],"default-bold-small")
GUIEditor_Button[4] = guiCreateButton(0.5213,0.8366,0.4177,0.1144,"Wyjd??",true,GUIEditor_Window[1])
guiSetFont(GUIEditor_Button[4],"default-bold-small")
kolumna guiGridListAddColumnGUIEditor_Grid[1], "Gracze"0.99 ) 
    guiSetVisible(GUIEditor_Window[1], falseGUIEditor_Window[2] = guiCreateWindow(518,177,453,297,"Wydaj Prawo Jazdy",false)
GUIEditor_Grid[2] = guiCreateGridList(10,26,190,259,false,GUIEditor_Window[2])
guiGridListSetSelectionMode(GUIEditor_Grid[1],2)
GUIEditor_Scrollbar[1] = guiCreateScrollBar(167,29,30,255,false,false,GUIEditor_Window[2])
GUIEditor_Button[6] = guiCreateButton(218,49,219,36,"Kategoria A",false,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[6],"default-bold-small")
GUIEditor_Button[7] = guiCreateButton(218,94,219,36,"Kategoria B",false,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[7],"default-bold-small")
GUIEditor_Button[8] = guiCreateButton(218,139,219,36,"Kategoria C",false,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[8],"default-bold-small")
GUIEditor_Button[9] = guiCreateButton(218,185,219,36,"Kategoria C+E",false,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[9],"default-bold-small")
GUIEditor_Button[10] = guiCreateButton(271,246,117,36,"Wyjdz",false,GUIEditor_Window[2])
guiSetFont(GUIEditor_Button[10],"default-bold-small")
    guiSetVisible(GUIEditor_Window[2], falsekolumna2 guiGridListAddColumnGUIEditor_Grid[1], "Gracze"0.99 )


function Prawo ()
      guiGridListClear(GUIEditor_Grid[1]) 
       for idplayeritem in ipairs(getElementsByType("player")) do
         local row guiGridListAddRow GUIEditor_Grid[2] )
         guiGridListSetItemText GUIEditor_Grid[2], rowkolumna2getPlayerName playeritem ), falsefalse )
           guiSetVisible(GUIEditor_Window[2], true)
           guiSetVisible(GUIEditor_Window[1], false)
           showCursor(true)
end
addEventHandler("onClientGUIClick"GUIEditor_Button[1], Prawo)

*okno 2 si? nie otwiera, ale nie ma b??du...

B??d:bad argument 'addeventhendler' [expected funkcion at argument 3,got nill]
Ostatnia linijka.
function KatA()
    local player guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
        setElementData(targetPlayer"Prawo jazdy Kategorii A"true)
          outputChatBox("Gracz " .. nick .. " otrzyma?? Prawo Jazdy Kategorii A",player2552000true )
    end
end
addEventHandler"onClientGUIClick"GUIEditor_Button[6], KatA)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 16:35


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

function Prawo ()
      guiGridListClear(GUIEditor_Grid[1]) 
           guiSetVisible(GUIEditor_Window[2], true)
           guiSetVisible(GUIEditor_Window[1], false)
           showCursor(true)
       for idplayeritem in ipairs(getElementsByType("player")) do
         local row guiGridListAddRow GUIEditor_Grid[2] )
         guiGridListSetItemText GUIEditor_Grid[2], rowkolumna2getPlayerName playeritem ), falsefalse )
end
end
addEventHandler("onClientGUIClick"GUIEditor_Button[1], Prawo)


A co do 2 b??du:
function KatA()
    local player guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
        setElementData(targetPlayer"Prawo jazdy Kategorii A"true)
          outputChatBox("Gracz " .. nick .. " otrzyma?? Prawo Jazdy Kategorii A",player2552000true )
    end
addEventHandler"onClientGUIClick"GUIEditor_Button[6], KatA)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 17:31


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

B??d podczas wydawania prawa jazdy.

bad argument 'setElementData' [expected element at argument 1,got nill]
3-ta linijka.

function KatA()
    local player guiGridListGetItemText (GUIEditor_Grid[2], guiGridListGetSelectedItem (GUIEditor_Grid[2]), 1)
        setElementData(targetPlayer"Prawo jazdy Kategorii A"true)
          outputChatBox("Wydales? Prawo Jazdy Kategorii A",player2552000true )
    end
addEventHandler"onClientGUIClick"GUIEditor_Button[6], KatA)


Pierwszy raz przypisuj? element danych. Co zrobi?em ?le?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 17:34


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

A co masz pod zmienn? targetPlayer?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-05-08, 17:40


hendryczek11







Wiek: 30
Na forum: 4903 dni
Posty: 49
Nick w MP: Heniek



Respekt: 50

Nie mam nic, a co powinienem ?

Podpis
Postaw piwo autorowi tego posta
 

 
Tagi: kłopot :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku