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...
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
Ci?g dalszy b??d?w
Unexpenced symbol near 'if'*. 3 linijka.
function Prawo ()
local player = guiGridListGetItemText (GUIEditor_Grid[1],
if guiGridListGetSelectedItem (GUIEditor_Grid[1]), 1) then
guiSetVisible(GUIEditor_Window[2], true)
guiSetVisible(GUIEditor_Window[1], false)
showCursor(true)
else
outputChatBox("Nie Wybrales gracza!", root, 255, 0, 0, true)
end
addEventHandler("onClientGUIClick", GUIEditor_Button[1], Prawo)
function Prawo ()
local player = guiGridListGetItemText (GUIEditor_Grid[1])
if guiGridListGetSelectedItem (GUIEditor_Grid[1], 1) then
guiSetVisible(GUIEditor_Window[2], true)
guiSetVisible(GUIEditor_Window[1], false)
showCursor(true)
else
outputChatBox("Nie Wybrales gracza!", 255, 0, 0, true)
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.
Skrypt ju? si? uruchomi?, ale mam kolejn? paczk? b??d?w
I thx za pomoc
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",player, 255, 200, 0, true )
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 id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GUIEditor_Grid[1] )
guiGridListSetItemText ( GUIEditor_Grid[1], row, kolumna, getPlayerName ( playeritem ), false, false )
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
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",player, 255, 200, 0, true )
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[6], KatA)
function Prawo ()
guiGridListClear(GUIEditor_Grid[1])
guiSetVisible(GUIEditor_Window[2], true)
guiSetVisible(GUIEditor_Window[1], false)
showCursor(true)
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( GUIEditor_Grid[2] )
guiGridListSetItemText ( GUIEditor_Grid[2], row, kolumna2, getPlayerName ( playeritem ), false, false )
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",player, 255, 200, 0, true )
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[6], KatA)
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",player, 255, 200, 0, true )
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[6], KatA)
Pierwszy raz przypisuj? element danych. Co zrobi?em ?le?
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