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

Wysłany: 2018-08-22, 16:52


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

Witam. Mam problem taki jak w tytule czyli gdy chce ulepszy? silnik lub cokolwiek w db3 wyskakuje ?e event nie jest dodany do serverside a jest dodany
wszystkie kody:
function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

tuningmechaniczny false
tuningmechaniczny_marker exports.custom_markers:createCustomMarker(-2328.54663, -166.2171034.3"cylinder"4.02552550)

    function tuningmechaniczny_gui()
        dxDrawImage(286100694506":K-UlepszSilnik/files/background.png"000tocolor(255255255255), false)
        dxDrawImage(264105175179":K-UlepszSilnik/files/button1.png"000tocolor(255255255255), false)
        dxDrawImage(264284175179":K-UlepszSilnik/files/button2.png"000tocolor(255255255255), false)
        dxDrawImage(264463175179":K-UlepszSilnik/files/button3.png"000tocolor(255255255255), false)
        dxDrawText("Witaj w panelu ulepszania silnika pojazd?w. Mi?ego tuningowania :)"509 1337 1915 1405 1tocolor(1431253255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu ulepszania silnika pojazd?w. Mi?ego tuningowania :)"509 1337 1915 1405 1tocolor(1431253255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu ulepszania silnika pojazd?w. Mi?ego tuningowania :)"509 1337 1915 1405 1tocolor(1431253255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu ulepszania silnika pojazd?w. Mi?ego tuningowania :)"509 1337 1915 1405 1tocolor(1431253255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Witaj w panelu ulepszania silnika pojazd?w. Mi?ego tuningowania :)"509337915405tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawImage(9461102424":K-UlepszSilnik/files/exit.png"000tocolor(255255255255), false)
    end

addEventHandler("onClientMarkerHit"tuningmechaniczny_marker, function()
if tuningmechaniczny == false then
    addEventHandler("onClientRender"roottuningmechaniczny_gui)
    showCursor(true)
    tuningmechaniczny true
end
addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuningmechaniczny == true then
            if isMouseInPosition(9461102424then
                removeEventHandler("onClientRender"roottuningmechaniczny_gui)
                showCursor(false)
                tuningmechaniczny false
            end
            if tuningmechaniczny == true then
                if isMouseInPosition(264105175179then
                    removeEventHandler("onClientRender"roottuningmechaniczny_gui)
                    addEventHandler("onClientRender"roottunesilnika_gui)
                    tuningmechaniczny false
                    tunesilnika true
                end
                if tuningmechaniczny == true then
                    if isMouseInPosition(264284175179then
                        removeEventHandler("onClientRender"roottuningmechaniczny_gui)
                        addEventHandler("onClientRender"roottunenapedu_gui)
                        tuningmechaniczny false
                        tunenapedu true
                    end
                    if tuningmechaniczny == true then
                        if isMouseInPosition(264463175179then
                            removeEventHandler("onClientRender"roottuningmechaniczny_gui)
                            addEventHandler("onClientRender"roottuneskretu_gui)
                            tuningmechaniczny false
                            tuneskretu true
                        end
                    end
                end
            end
        end
    end
end
)
end
)

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

tunenapedu false

    function tunenapedu_gui()
        dxDrawImage(286100694506":K-UlepszSilnik/files/background.png"000tocolor(255255255255), false)
        dxDrawImage(264105175179":K-UlepszSilnik/files/button1.png"000tocolor(255255255255), false)
        dxDrawImage(264284175179":K-UlepszSilnik/files/button2.png"000tocolor(255255255255), false)
        dxDrawImage(264463175179":K-UlepszSilnik/files/button3.png"000tocolor(255255255255), false)
        dxDrawImage(9461102424":K-UlepszSilnik/files/exit.png"000tocolor(255255255255), false)
        dxDrawImage(461171194184":K-UlepszSilnik/files/button6.png"000tocolor(255255255255), false)
        dxDrawImage(753171183184":K-UlepszSilnik/files/button8.png"000tocolor(255255255255), false)
        dxDrawImage(606387194184":K-UlepszSilnik/files/button7.png"000tocolor(255255255255), false)
    end

addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tunenapedu == true then
            if isMouseInPosition(9461102424then
                removeEventHandler("onClientRender"roottunenapedu_gui)
                showCursor(false)
                tunenapedu false
            end
            if tunenapedu == true then
                if isMouseInPosition(461171194184then
                    triggerServerEvent("ustawawd"localPlayer)
                    removeEventHandler("onClientRender"roottunenapedu_gui)
                    showCursor(false)
                    tunenapedu false
                end
                if tunenapedu == true then
                    if isMouseInPosition(606387194184then
                        triggerServerEvent("ustawfwd"localPlayer)
                        removeEventHandler("onClientRender"roottunenapedu_gui)
                        showCursor(false)
                        tunenapedu false
                    end
                    if tunenapedu == true then
                        if isMouseInPosition(753171183184then
                            triggerServerEvent("ustawrwd"localPlayer)
                            removeEventHandler("onClientRender"root ,tunenapedu_gui)
                            showCursor(false)
                            tunenapedu false
                        end
                    end
                end
            end
        end
    end
end
)

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

tunesilnika false

    function tunesilnika_gui()
        dxDrawImage(286100694506":K-UlepszSilnik/files/background.png"000tocolor(255255255255), false)
        dxDrawImage(264105175179":K-UlepszSilnik/files/button1.png"000tocolor(255255255255), false)
        dxDrawImage(264284175179":K-UlepszSilnik/files/button2.png"000tocolor(255255255255), false)
        dxDrawImage(264463175179":K-UlepszSilnik/files/button3.png"000tocolor(255255255255), false)
        dxDrawImage(9461102424":K-UlepszSilnik/files/exit.png"000tocolor(255255255255), false)
        dxDrawImage(602273193200":K-UlepszSilnik/files/button4.png"000tocolor(255255255255), false)
    end

addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tunesilnika == true then
            if isMouseInPosition(9461102424then
                removeEventHandler("onClientRender"roottunesilnika_gui)
                showCursor(false)
                tunesilnika false
            end
            if tunesilnika == true then
                if isMouseInPosition(602273193200then
                    triggerServerEvent("ulepszsilnik"localPlayer)
                    removeEventHandler("onClientRender"roottunesilnika_gui)
                    showCursor(false)
                    tunesilnika false
                end
            end
        end
    end
end
)

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    if ( cx >= and cx <= width ) and ( cy >= and cy <= height then
        return true
    else
        return false
    end
end

tuneskretu false

    function tuneskretu_gui()
        dxDrawImage(286100694506":K-UlepszSilnik/files/background.png"000tocolor(255255255255), false)
        dxDrawImage(264105175179":K-UlepszSilnik/files/button1.png"000tocolor(255255255255), false)
        dxDrawImage(264284175179":K-UlepszSilnik/files/button2.png"000tocolor(255255255255), false)
        dxDrawImage(264463175179":K-UlepszSilnik/files/button3.png"000tocolor(255255255255), false)
        dxDrawImage(9461102424":K-UlepszSilnik/files/exit.png"000tocolor(255255255255), false)
        dxDrawImage(591273213200":K-UlepszSilnik/files/button5.png"000tocolor(255255255255), false)
    end

addEventHandler("onClientClick"root, function(buttonstate)
    if state == 'down' then
        if tuneskretu == true then
            if isMouseInPosition(9461102424then
                removeEventHandler("onClientRender"roottuneskretu_gui)
                showCursor(false)
                tuneskretu false
            end
            if tuneskretu == true then
                if isMouseInPosition(591273213200then
                    triggerServerEvent("skret"localPlayer)
                    removeEventHandler("onClientRender"roottuneskretu_gui)
                    showCursor(false)                    
                    tuneskretu false
                end
            end
        end
    end
end
)

ulepszaniesilnika 65000
naped_awd 35000
naped_rwd 25000
naped_fwd 15000
zmianaskretu 30000

addEvent("ulepszsilnik"true)
addEventHandler("ulepszsilnik"root, function()
if (getPlayerMoney(source) > tonumber(ulepszaniesilnika)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourceulepszeniesilnika)
        outputChatBox"Ulepszy?e? silnik w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"maxVelocity"270.0 )
setVehicleHandling(pojazd"engineAcceleration"14.0 )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ulepszenie silnika w poje?dzie!"getRootElement(), 255255255true)

addEvent("skret"true)
addEventHandler("skret"root, function()
if (getPlayerMoney(source) > tonumber(zmianaskretu)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_awd)
        outputChatBox"Powi?kszy?e? stopni skr?tu w twoim poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"steeringLock"45.5 )
else
    outputChatBox ("#ff0000Nie sta? Ci? na powi?kszenie stopni skr?tu w poje?dzie"getRootElement(), 255255255true)

addEvent("ustawawd"true)
addEventHandler("ustawawd"root, function()
if (getPlayerMoney(source) > tonumber(naped_awd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_awd)
        outputChatBox"Ustawi?e? nap?d AWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""awd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du AWD w poje?dzie"getRootElement(), 255255255true)

addEvent("ustawfwd"true)
addEventHandler("ustawfwd"root, function()
if (getPlayerMoney(source) > tonumber(naped_fwd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_fwd)
        outputChatBox"Ustawi?e? nap?d FWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""fwd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du FWD w poje?dzie"getRootElement(), 255255255true)

addEvent("ustawrwd"true)
addEventHandler("ustawrwd"root, function()
if (getPlayerMoney(source) > tonumber(naped_rwd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_rwd)
        outputChatBox"Ustawi?e? nap?d RWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""rwd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du RWD w poje?dzie"getRootElement(), 255255255true)
end
end
)
end
end
)
end
end
)
end
end
)
end
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 17:15


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

podaj ten b??d

[ Dodano: 2018-08-22, 17:17 ]
doko?cz te wszystkie eventy, a nie na samym ko?cu ko?czysz wszystkie eventHandlery, co? takiego robisz:
addEvent("ulepszsilnik"true)
addEventHandler("ulepszsilnik"root, function()
if (getPlayerMoney(source) > tonumber(ulepszaniesilnika)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourceulepszeniesilnika)
        outputChatBox"Ulepszy?e? silnik w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"maxVelocity"270.0 )
setVehicleHandling(pojazd"engineAcceleration"14.0 )
else
 outputChatBox ("#ff0000Nie sta? Ci? na ulepszenie silnika w poje?dzie!"getRootElement(), 255255255true)
-- gdzie tu jest KONIEC eventuna samym ko?cu kodu...

addEvent("skret"true)
addEventHandler("skret"root, function()

popraw to

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 18:08


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

i nadal wyskakuje ERROR: Client (czlowiekjaja) triggered serverside event ulepszsilnik, but event is not added serverside

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 20:30


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

poka? teraz ten "zmodyfikowany przez Ciebie kod"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 20:49


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

ulepszaniesilnika 65000
naped_awd 35000
naped_rwd 25000
naped_fwd 15000
zmianaskretu 30000

addEvent("ulepszsilnik"true)
addEventHandler("ulepszsilnik"root, function()
if (getPlayerMoney(source) > tonumber(ulepszaniesilnika)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourceulepszeniesilnika)
        outputChatBox"Ulepszy?e? silnik w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"maxVelocity"270.0 )
setVehicleHandling(pojazd"engineAcceleration"14.0 )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ulepszenie silnika w poje?dzie!"getRootElement(), 255255255true)
end

addEvent("skret"true)
addEventHandler("skret"root, function()
if (getPlayerMoney(source) > tonumber(zmianaskretu)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_awd)
        outputChatBox"Powi?kszy?e? stopni skr?tu w twoim poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"steeringLock"45.5 )
else
    outputChatBox ("#ff0000Nie sta? Ci? na powi?kszenie stopni skr?tu w poje?dzie"getRootElement(), 255255255true)
end

addEvent("ustawawd"true)
addEventHandler("ustawawd"root, function()
if (getPlayerMoney(source) > tonumber(naped_awd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_awd)
        outputChatBox"Ustawi?e? nap?d AWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""awd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du AWD w poje?dzie"getRootElement(), 255255255true)
end

addEvent("ustawfwd"true)
addEventHandler("ustawfwd"root, function()
if (getPlayerMoney(source) > tonumber(naped_fwd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_fwd)
        outputChatBox"Ustawi?e? nap?d FWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""fwd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du FWD w poje?dzie"getRootElement(), 255255255true)
end

addEvent("ustawrwd"true)
addEventHandler("ustawrwd"root, function()
if (getPlayerMoney(source) > tonumber(naped_rwd)) then 
pojazd getPedOccupiedVehicle(source)
if not pojazd then return end
        takePlayerMoney(sourcenaped_rwd)
        outputChatBox"Ustawi?e? nap?d RWD w poje?dzie"getRootElement(), 255255255true )
setVehicleHandling(pojazd"driveType""rwd" )
else
    outputChatBox ("#ff0000Nie sta? Ci? na ustawienie nap?du RWD w poje?dzie"getRootElement(), 255255255true)
end
end
)
end
end
)
end
end
)
end
end
)
end
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 20:58


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

nie dzia?a bo nadal jakie? dodatkowe endy na ko?cu kodu.
porada: naucz si? lua i wtedy skryptuj, robisz co? na "hama" w tej dziedzinie, o kt?rej nie masz zielonego poj?cia...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:08


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

Tylko ?e jak tych end?w na ko?cu nie ma to wtedy wyskakuje end expected

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:13


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

W czym skryptujesz? W notatniku? No sorry, prostej rzeczy nie ma ni? poprawi?. Piszesz, ?e end?w nie ma na ko?cu? Mo?e zjed? na sam koniec kodu to je zauwa?ysz...

Tw?j kod: http://prntscr.com/klr5wg
Po dopisaniu nawiasu kt?ry odpowiada za zamkni?cie addEventHandler: http://prntscr.com/klr6hg

PS. O ile end?w si? znalaz?o :x http://prntscr.com/klr6sp I od czego te endy? Od pustych linijek? Nie s?dze... :-?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-22, 21:36


czlowiekjaja







Wiek: 20
Na forum: 2850 dni
Posty: 76
Nick w MP: czlowiekjaja

Piwa: 324

Respekt: 50

No to teraz mam unexpected symbol near ')'

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: czyta :: eventów :: serverside
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