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

Wysłany: 2016-02-12, 16:44


nox







Wiek: 33
Na forum: 3907 dni
Posty: 51
Nick w MP: nox



Respekt: 50


GUIEditor = { 
gridlist = {}, 
window = {}, 
button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(460, 205, 391, 298, "Panel Pomocy Drogowej v1.0", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFE802C5") 

GUIEditor.button[1] = guiCreateButton(13, 37, 116, 51, "Napraw", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(13, 120, 116, 51, "Tankuj", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(13, 215, 116, 51, "Napraw i Tankuj", false, GUIEditor.window[1]) 
GUIEditor.gridlist[1] = guiCreateGridList(206, 42, 176, 230, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Lista graczy", 0.9) 
GUIEditor.button[4] = guiCreateButton(366, 21, 16, 16, "X", false, GUIEditor.window[1]) 
end 
) 

addEventHandler("onClientRender", root, 
function() 
dxDrawLine(633, 349, 635, 355, tocolor(255, 255, 255, 255), 1, false) 
end 
)

function openPanel()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addCommandHandler("panelpd", openPanel)

function zamykamy()
if source =~ GUIEditor.button[4] then
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", root, zamykamy)

function napraw()
if source =~ GUIEditor.button[1] then
local woz = getPedOccupiedVehicle(source)
fixVehicle(woz)
takePlayerMoney(source, 300) 
end
end
addEventHandler("onClientGUIClick", root, napraw)

function tankuj()
if source =~ GUIEditor.button[2] then
local woz = getPedOccupiedVehicle(source) 
setElementData(woz, "paliwo", 100) 
takePlayerMoney(source, 100) 
end
end
addEventHandler("onClientGUIClick", root, tankuj)

function naprawitankuj()
if source =~ GUIEditor.button[3] then
local woz = getPedOccupiedVehicle(source)
setElementData(woz, "paliwo", 100)
fixVehicle(woz)
takePlayerMoney(source, 400) 
end
addEventHandler("onClientGUIClick", root, naprawitankuj)



Mam taki kodzik na panelpd i moj problem lezy w tym, ze panel po wpisaniu komendy nie otwiera mi si?. Moze ktos mi wyjasnic i ewentualnie znale?? b?ad w tym kodzie ? Stawiam piwerko.


//Nast?pnym razem prosz? u?ywa? znacznik?w LUA//DestroY

Ostatnio zmieniony przez #404 2016-02-12, 16:52, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 16:56


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4402 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Jakie? b??dy w db3 ?

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:01


nox







Wiek: 33
Na forum: 3907 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"Wicek7" napisał/a:

Jakie? b??dy w db3 ?

Skrypt nie jest przy??czony do db3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:02


Alien2

C++, Music produce






Wiek: 26
Na forum: 4458 dni
Posty: 40
Nick w MP: Teaj

Piwa: 6

Respekt: 19

Ciekawe co mia?by zapisywa? xd

Skrypt jest po stronie serwera, a nie masz napisanego w strone client. Jak mi si? wydaje

Ostatnio zmieniony przez Alien2 2016-02-12, 17:03, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:03


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
nox, nie nie, db3 czyli debugscript 3 (/debugscript 3).

Wszystkie informacje o b??dach, ostrze?eniach itp, pokazuje tam wszystko i nie trzeba jako? specjalnie tego ??czy?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:18


nox







Wiek: 33
Na forum: 3907 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"DestroY" napisał/a:

nox, nie nie, db3 czyli debugscript 3 (/debugscript 3).

Wszystkie informacje o b??dach, ostrze?eniach itp, pokazuje tam wszystko i nie trzeba jako? specjalnie tego ??czy?.


Po wpisaniu /debugscript 3 nic mi si? nie pojawia, wi?c b??d?w chyba ?adnych nie ma

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:23


TheGuruPolska







Wiek: 36
Na forum: 3908 dni
Posty: 65
Nick w MP: TheGuru

Piwa: 47

Respekt: 50

Kod:

if source =~ GUIEditor.button[4] then

Masz tam takie cu?: "=~", czemu?
zamie? to na "==", wsz?dzie :D

[ Dodano: 2016-02-12, 17:25 ]
Kod:


GUIEditor = {
gridlist = {},
window = {},
button = {}
}
GUIEditor.window[1] = guiCreateWindow(460, 205, 391, 298, "Panel Pomocy Drogowej v1.0", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFE802C5")

GUIEditor.button[1] = guiCreateButton(13, 37, 116, 51, "Napraw", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(13, 120, 116, 51, "Tankuj", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(13, 215, 116, 51, "Napraw i Tankuj", false, GUIEditor.window[1])
GUIEditor.gridlist[1] = guiCreateGridList(206, 42, 176, 230, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "Lista graczy", 0.9)
GUIEditor.button[4] = guiCreateButton(366, 21, 16, 16, "X", false, GUIEditor.window[1])
guiSetVisible(GUIEditor.window[1],false)

addEventHandler("onClientRender", root,
function()
dxDrawLine(633, 349, 635, 355, tocolor(255, 255, 255, 255), 1, false)
end
)

function openPanel()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addCommandHandler("panelpd", openPanel)

function zamykamy()
if source == GUIEditor.button[4] then
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", root, zamykamy)

function napraw()
if source == GUIEditor.button[1] then
local woz = getPedOccupiedVehicle(source)
fixVehicle(woz)
takePlayerMoney(source, 300)
end
end
addEventHandler("onClientGUIClick", root, napraw)

function tankuj()
if source == GUIEditor.button[2] then
local woz = getPedOccupiedVehicle(source)
setElementData(woz, "paliwo", 100)
takePlayerMoney(source, 100)
end
end
addEventHandler("onClientGUIClick", root, tankuj)

function naprawitankuj()
if source == GUIEditor.button[3] then
local woz = getPedOccupiedVehicle(source)
setElementData(woz, "paliwo", 100)
fixVehicle(woz)
takePlayerMoney(source, 400)
end
addEventHandler("onClientGUIClick", root, naprawitankuj)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 17:30


nox







Wiek: 33
Na forum: 3907 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"TheGuruPolska" napisał/a:

Kod:

if source =~ GUIEditor.button[4] then

Masz tam takie cu?: "=~", czemu?
zamie? to na "==", wsz?dzie :D

[ Dodano: 2016-02-12, 17:25 ]
Kod:


GUIEditor = {
gridlist = {},
window = {},
button = {}
}
GUIEditor.window[1] = guiCreateWindow(460, 205, 391, 298, "Panel Pomocy Drogowej v1.0", false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetProperty(GUIEditor.window[1], "CaptionColour", "FFE802C5")

GUIEditor.button[1] = guiCreateButton(13, 37, 116, 51, "Napraw", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(13, 120, 116, 51, "Tankuj", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(13, 215, 116, 51, "Napraw i Tankuj", false, GUIEditor.window[1])
GUIEditor.gridlist[1] = guiCreateGridList(206, 42, 176, 230, false, GUIEditor.window[1])
guiGridListAddColumn(GUIEditor.gridlist[1], "Lista graczy", 0.9)
GUIEditor.button[4] = guiCreateButton(366, 21, 16, 16, "X", false, GUIEditor.window[1])
guiSetVisible(GUIEditor.window[1],false)

addEventHandler("onClientRender", root,
function()
dxDrawLine(633, 349, 635, 355, tocolor(255, 255, 255, 255), 1, false)
end
)

function openPanel()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addCommandHandler("panelpd", openPanel)

function zamykamy()
if source == GUIEditor.button[4] then
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", root, zamykamy)

function napraw()
if source == GUIEditor.button[1] then
local woz = getPedOccupiedVehicle(source)
fixVehicle(woz)
takePlayerMoney(source, 300)
end
end
addEventHandler("onClientGUIClick", root, napraw)

function tankuj()
if source == GUIEditor.button[2] then
local woz = getPedOccupiedVehicle(source)
setElementData(woz, "paliwo", 100)
takePlayerMoney(source, 100)
end
end
addEventHandler("onClientGUIClick", root, tankuj)

function naprawitankuj()
if source == GUIEditor.button[3] then
local woz = getPedOccupiedVehicle(source)
setElementData(woz, "paliwo", 100)
fixVehicle(woz)
takePlayerMoney(source, 400)
end
addEventHandler("onClientGUIClick", root, naprawitankuj)



Zrobi?em tak jak radzisz, niestety panel nadal si? nie odpala ;c

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 18:21


TheGuruPolska







Wiek: 36
Na forum: 3908 dni
Posty: 65
Nick w MP: TheGuru

Piwa: 47

Respekt: 50

Niesprawdzone:
okno = guiCreateWindow(460, 205, 391, 298, "Panel Pomocy Drogowej v1.0", false)
guiWindowSetSizable(okno, false)
guiSetProperty(okno, "CaptionColour", "FFE802C5")

btt1 = guiCreateButton(13, 37, 116, 51, "Napraw", false, okno)
btt2 = guiCreateButton(13, 120, 116, 51, "Tankuj", false, okno)
btt3 = guiCreateButton(13, 215, 116, 51, "Napraw i Tankuj", false, okno)
gridlist = guiCreateGridList(206, 42, 176, 230, false, okno)
guiGridListAddColumn(gridlist, "Lista graczy", 0.9)
btt4 = guiCreateButton(366, 21, 16, 16, "X", false, okno)
guiSetVisible(okno,false)

addEventHandler("onClientRender", getRootElement,
function()
dxDrawLine(633, 349, 635, 355, tocolor(255, 255, 255, 255), 1, false)
end
)

function openPanel()
guiSetVisible(okno, true)
showCursor(true)
end
addCommandHandler("panelpd", openPanel)

function przyciskifunct()
if getPedOccupiedVehicle(localPlayer) then 
    if source == btt1 then
        if getPlayerMoney() >= 300 then
            takePlayerMoney(300)
            fixVehicle(getPedOccupiedVehicle(localPlayer))
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt2 then
        if getPlayerMoney() >= 100 then
            setElementData(getPedOccupiedVehicle(localPlayer), "paliwo", 100)
            takePlayerMoney(100)
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt3 then
        if getPlayerMoney() >= 400 then
            takePlayerMoney(400)
            fixVehicle(getPedOccupiedVehicle(localPlayer))
            setElementData(getPedOccupiedVehicle(localPlayer), "paliwo", 100)
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt4 then
        guiSetVisible(okno,false)
        showCursor(false)
    end
end
end
addEventHandler("onClientGUIClick", getRootElement(), przyciskifunct)

Jak co? to wpisz w F8 'debugscript 3' i napisz b??dy jakie s?.
W mecie mam nadziej?, ?e masz napisane "<script src="nazwa.lua" type="client" />" xD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-12, 19:44


nox







Wiek: 33
Na forum: 3907 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"TheGuruPolska" napisał/a:

Niesprawdzone:
okno = guiCreateWindow(460, 205, 391, 298, "Panel Pomocy Drogowej v1.0", false)
guiWindowSetSizable(okno, false)
guiSetProperty(okno, "CaptionColour", "FFE802C5")

btt1 = guiCreateButton(13, 37, 116, 51, "Napraw", false, okno)
btt2 = guiCreateButton(13, 120, 116, 51, "Tankuj", false, okno)
btt3 = guiCreateButton(13, 215, 116, 51, "Napraw i Tankuj", false, okno)
gridlist = guiCreateGridList(206, 42, 176, 230, false, okno)
guiGridListAddColumn(gridlist, "Lista graczy", 0.9)
btt4 = guiCreateButton(366, 21, 16, 16, "X", false, okno)
guiSetVisible(okno,false)

addEventHandler("onClientRender", getRootElement,
function()
dxDrawLine(633, 349, 635, 355, tocolor(255, 255, 255, 255), 1, false)
end
)

function openPanel()
guiSetVisible(okno, true)
showCursor(true)
end
addCommandHandler("panelpd", openPanel)

function przyciskifunct()
if getPedOccupiedVehicle(localPlayer) then 
    if source == btt1 then
        if getPlayerMoney() >= 300 then
            takePlayerMoney(300)
            fixVehicle(getPedOccupiedVehicle(localPlayer))
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt2 then
        if getPlayerMoney() >= 100 then
            setElementData(getPedOccupiedVehicle(localPlayer), "paliwo", 100)
            takePlayerMoney(100)
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt3 then
        if getPlayerMoney() >= 400 then
            takePlayerMoney(400)
            fixVehicle(getPedOccupiedVehicle(localPlayer))
            setElementData(getPedOccupiedVehicle(localPlayer), "paliwo", 100)
        else
            outputChatBox("Nie masz tyle pieni?dzy",255,0,0)
        end
    elseif source==btt4 then
        guiSetVisible(okno,false)
        showCursor(false)
    end
end
end
addEventHandler("onClientGUIClick", getRootElement(), przyciskifunct)

Jak co? to wpisz w F8 'debugscript 3' i napisz b??dy jakie s?.
W mecie mam nadziej?, ?e masz napisane "<script src="nazwa.lua" type="client" />" xD


Wszystko dzia?a elegancko, piwerko leci dzi?ki ^^ :D Tylko jeszcze mysl?, jak pobra? graczy z serwera aby pokazywa?o ich w girdliscie ?

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: nie :: otwiera :: się
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