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

Wysłany: 2013-04-28, 21:24


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
To juz ostatnie gui z mojej serii i przestaje was zadreczac :D
Wyswietla blad w debugu w linijce 84 w addEventHandler
CLIENT:
local marker createMarker(2043154310"cylinder"20255030)
local blip createBlip 204315431145 )



GUIEditor = {
    gridlist = {},
    button = {},
    edit = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.gridlist[1] = guiCreateGridList(453173756589false)
        guiSetAlpha(GUIEditor.gridlist[1], 0.86)
        guiSetVisible GUIEditor.gridlist[1], false )

        GUIEditor.gridlist[2] = guiCreateGridList(41139187333falseGUIEditor.gridlist[1])
        guiGridListAddColumn(GUIEditor.gridlist[2], "Pojazd"0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID"0.4)
        for 1do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 01"Infernus"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 02"411"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 11"Elegy"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 12"562"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 21"Bullet"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 22"541"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 31"Banshee"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 32"429"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 41"Buffalo"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 42"402"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 51"NRG-500"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 52"522"falsefalse)
        edit guiCreateEdit(42822813630""falseGUIEditor.gridlist[1])
        local kup guiCreateButton(37638824684"KUP"falseGUIEditor.gridlist[1])
        local esc guiCreateButton(275276044"X"falseGUIEditor.gridlist[1])
    end
)

    function draw()
        dxDrawText("Salon Samochodowy"500132889211tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"500130889209tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"498132887211tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"498130887209tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"499131888210tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawLine(4921831160183tocolor(255255255255), 1true)
        dxDrawText("Pojazdy:"517275709305tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"517273709303tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"515275707305tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"515273707303tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"516274708304tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7832851030324tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7832831030322tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7812851028324tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7812831028322tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7822841029323tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawLine(7763391155339tocolor(255255255255), 1true)
        dxDrawText("Wpisz ID pojazdu"826365951391tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Cena : 10000$"8314821095513tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
    end


function otworz hitElement )
guiSetVisibleGUIEditor.gridlist[1], true)
showCursor(true)
outputChatBox "Witamy w salonie samochodowym!"2550)
addEventHandler "onClientRender"getRootElement(), draw )
end
addEventHandler("onClientMarkerHit"markerotworz)

function zamknij()
    guiSetVisible GUIEditor.gridlist[1], false )
    showCursor false )
    guiSetInputEnabled false )
    removeEventHandler "onClientRender"getRootElement(), draw )
end
addEventHandler("onClientGUIClick"esczamknijfalse)

function auto()
outputChatBox "Kupiles auto."25500true)
triggerServerEvent("auto"getRootElement(), player)
end
addEventHandler "onClientGUIClick"kupauto)


SERVER:
function auto ()
    local kasa getPlayerMoney thePlayer )
    local x,y,getElementPosition thePlayer )
    if kasa >= 10000 then
    createVehicle tonumberguiGetText edit ) ), xy+2)
    else
    outputChatBox "Nie posiadasz 10000$"thePlayer )
    end
    end
    addEvent("auto"true)
    addEventHandler("auto"getRootElement(), auto)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 21:30


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Linijka 36,37 zmie? zmienn? localn? na globaln? poprzez usuni?cie "local" z jej przedsrostku.
Powinno pom?c.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 23:15


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Niestety, pokazalo bledy w 78 i 84 linijce z addEventHandler.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 10:44


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1


local marker createMarker(2043154310"cylinder"20255030)
local blip createBlip 204315431145 )



GUIEditor = {
    gridlist = {},
    button = {},
    edit = {},
    przycisk={}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.gridlist[1] = guiCreateGridList(453173756589false)
        guiSetAlpha(GUIEditor.gridlist[1], 0.86)
        guiSetVisible GUIEditor.gridlist[1], false )

        GUIEditor.gridlist[2] = guiCreateGridList(41139187333falseGUIEditor.gridlist[1])
        guiGridListAddColumn(GUIEditor.gridlist[2], "Pojazd"0.4)
        guiGridListAddColumn(GUIEditor.gridlist[2], "ID"0.4)
        for 1do
            guiGridListAddRow(GUIEditor.gridlist[2])
        end
        guiGridListSetItemText(GUIEditor.gridlist[2], 01"Infernus"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 02"411"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 11"Elegy"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 12"562"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 21"Bullet"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 22"541"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 31"Banshee"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 32"429"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 41"Buffalo"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 42"402"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 51"NRG-500"falsefalse)
        guiGridListSetItemText(GUIEditor.gridlist[2], 52"522"falsefalse)
        edit guiCreateEdit(42822813630""falseGUIEditor.gridlist[1])
        przycisk[1] = guiCreateButton(37638824684"KUP"falseGUIEditor.gridlist[1])
        przycisk[2] = guiCreateButton(275276044"X"falseGUIEditor.gridlist[1])
    end
)

    function draw()
        dxDrawText("Salon Samochodowy"500132889211tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"500130889209tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"498132887211tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"498130887209tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Salon Samochodowy"499131888210tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawLine(4921831160183tocolor(255255255255), 1true)
        dxDrawText("Pojazdy:"517275709305tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"517273709303tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"515275707305tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"515273707303tocolor(000255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Pojazdy:"516274708304tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7832851030324tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7832831030322tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7812851028324tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7812831028322tocolor(000255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Interakcja:"7822841029323tocolor(255255255255), 2.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawLine(7763391155339tocolor(255255255255), 1true)
        dxDrawText("Wpisz ID pojazdu"826365951391tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Cena : 10000$"8314821095513tocolor(255255255255), 1.00"bankgothic""left""top"falsefalsetruefalsefalse)
    end


function otworz hitElement )
guiSetVisibleGUIEditor.gridlist[1], true)
showCursor(true)
outputChatBox "Witamy w salonie samochodowym!"2550)
addEventHandler "onClientRender"getRootElement(), draw )
end
addEventHandler("onClientMarkerHit"markerotworz)

function zamknij()
if source == przycisk[2then
    guiSetVisible GUIEditor.gridlist[1], false )
    showCursor false )
    guiSetInputEnabled false )
    removeEventHandler "onClientRender"getRootElement(), draw )
end
end
addEventHandler("onClientGUIClick"przycisk[2], zamknij)

function auto_f()
if source == przycisk[1then
outputChatBox "Kupiles auto."25500true)
triggerServerEvent("auto"getRootElement(), player)
end
end
addEventHandler "onClientGUIClick"przycisk[1], auto_f)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 12:22


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Mozesz powiedziec co zmieniles?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 14:10


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Oczywi?cie, wprowadzi?em zmiany techniczne i wizualne ;]

1. Wcze?niej nazwa funkcji "auto" by?a taka sama jak nazwa eventu
2. Nie doda?e? warunku if source == przycisk then [...] end
3. Przyciski wrzuci?em do tablicy to jest w sumie nie potrzebne ale lepiej si? pracuje na tablicach.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 15:33


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Kod:

3. Przyciski wrzuci?em do tablicy to jest w sumie nie potrzebne ale lepiej si? pracuje na tablicach.p

Jakich tablicach?:)

A tak swoja droga nie wiem gdzie jest blad, w debugu nie pokazuje zadnych, ale i tak przycisku wyjscia nie ma i po wpisaniu id i wcisnieciu Kup, nic sie nie dzieje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 16:15


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

CLIENT
function auto_f_s (player,edit)
local kasa = getPlayerMoney ( player )
local x,y,z = getElementPosition ( player )
if kasa >= 10000 then
createVehicle ( tonumber( edit ), x, y+2, z )
else
outputChatBox ( "Nie posiadasz 10000$", player )
end
end
addEvent("auto", true)
addEventHandler("auto", getRootElement(), auto_f_s)

SERVER
function auto_f()
if source == przycisk[1] then
outputChatBox ( "Kupiles auto.", 255, 0, 0, true)
triggerServerEvent("auto", getRootElement(), player,ed)
end
end
addEventHandler ( "onClientGUIClick", przycisk[1], auto_f)

[ Dodano: 2013-04-29, 16:27 ]
Poprawka:
Server

function auto_f()
if source == przycisk[1then
player getLocalPlayer()
ed guiGetText edit )
outputChatBox "Kupiles auto."25500true)
triggerServerEvent("auto"getRootElement(), player,ed)
end
end
addEventHandler "onClientGUIClick"przycisk[1], auto_f)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 17:52


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Oski, mam pytanie sk?d ty masz zmian? edit jak nie masz w jej w funkcji ?? chodzi o strun? serwer.

albo masz z?e napisane strony popraw to.


"Oski" napisał/a:

CLIENT
function auto_f_s (player,edit)
local kasa = getPlayerMoney ( player )
local x,y,z = getElementPosition ( player )
if kasa >= 10000 then
createVehicle ( tonumber( edit ), x, y+2, z )
else
outputChatBox ( "Nie posiadasz 10000$", player )
end
end
addEvent("auto", true)
addEventHandler("auto", getRootElement(), auto_f_s)

SERVER
function auto_f()
if source == przycisk[1] then
outputChatBox ( "Kupiles auto.", 255, 0, 0, true)
triggerServerEvent("auto", getRootElement(), player,ed)
end
end
addEventHandler ( "onClientGUIClick", przycisk[1], auto_f)

[ Dodano: 2013-04-29, 16:27 ]
Poprawka:
Server

function auto_f()
if source == przycisk[1then
player getLocalPlayer()
ed guiGetText edit )
outputChatBox "Kupiles auto."25500true)
triggerServerEvent("auto"getRootElement(), player,ed)
end
end
addEventHandler "onClientGUIClick"przycisk[1], auto_f)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 18:04


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

"luki123luki123" napisał/a:

Oski, mam pytanie sk?d ty masz zmian? edit jak nie masz w jej w funkcji ?? chodzi o strun? serwer.

albo masz z?e napisane strony popraw to.


"Oski" napisał/a:

CLIENT
function auto_f_s (player,edit)
local kasa = getPlayerMoney ( player )
local x,y,z = getElementPosition ( player )
if kasa >= 10000 then
createVehicle ( tonumber( edit ), x, y+2, z )
else
outputChatBox ( "Nie posiadasz 10000$", player )
end
end
addEvent("auto", true)
addEventHandler("auto", getRootElement(), auto_f_s)

SERVER
function auto_f()
if source == przycisk[1] then
outputChatBox ( "Kupiles auto.", 255, 0, 0, true)
triggerServerEvent("auto", getRootElement(), player,ed)
end
end
addEventHandler ( "onClientGUIClick", przycisk[1], auto_f)

[ Dodano: 2013-04-29, 16:27 ]
Poprawka:
Server

function auto_f()
if source == przycisk[1then
player getLocalPlayer()
ed guiGetText edit )
outputChatBox "Kupiles auto."25500true)
triggerServerEvent("auto"getRootElement(), player,ed)
end
end
addEventHandler "onClientGUIClick"przycisk[1], auto_f)


Je?li ju? to nie server tylko client.
Racja pomy?ka.
B??dy ka?demu si? zda?aj?.
Dzi?kuje ?e zauwazy?e?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 18:08


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Wciaz 0 reakcji w debugu jak i w skrypcie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 18:19


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Ciastkooo, daj kod kt?ry teraz masz

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 18:57


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Wkleilem ten ktory mi dal Oski :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-29, 19:19


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Ciastkooo, daj ca?y bo mo?e ty masz b??d

Postaw piwo autorowi tego posta
 

 
Tagi: panel
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