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

Wysłany: 2020-08-21, 22:00


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Witam, w trakcie robienia gui natrafi?em na problem z kt?rym nie mog? sobie poradzi?, a dok?adnie chodzi o od?wie?anie tekstu w gui oraz o getVehicleHandling po stronie clienta. Chcia?bym zrobi? ?e po klikni?ciu w button handling odrazu pojawia? si? w tabeli

np
jak tu jest 1200

po klikni?ciu w button by?o 1300.

Eventy od ustawienia handlingu mam.

Domy?lam si? ?e trzeba zrobi? eventy tylko nie wiem jakie i w jaki spos?b
marker = createMarker(2482.35718, -1658.45166, 13.33557, 'cylinder', 2.0, 255, 170, 0, 150)

function hit(hit)
if getElementType(hit) ~= "player" then return end
local veh = getPedOccupiedVehicle(hit)
if not veh then return end
if hit == localPlayer then
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
end
addEventHandler("onClientMarkerHit", marker, hit)

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(500, 179, 590, 700, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 0.83)
        
        Gui3 = guiCreateLabel(240, 80, 150, 100, "Masa pojazdu: 1200kg", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(255, 150, 150, 100, "Ilo?? bieg?w: 5", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(215, 220, 190, 100, "Sztywno?? zawieszenia: 99.80%", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(220, 290, 210, 100, "Promie? skr?tu: 35.00 stopni", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(205, 360, 210, 100, "Pr?dko?? maksymalna: ", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(220, 430, 210, 100, "Przyspieszenie: 3s-100km/h", false, GUIEditor.window[1])
        Gui3 = guiCreateLabel(240, 500, 210, 100, "Spr??arka: ON/OFF", false, GUIEditor.window[1])
        guiSetFont(Gui3, "default-bold-small")
        
        GUIEditor.button[1] = guiCreateButton(25, 60, 115, 60, "Masa+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(450, 60, 115, 60, "Masa-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(25, 130, 115, 60, "Ilo?? bieg?w+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[4] = guiCreateButton(450, 130, 115, 60, "Ilo?? bieg?w-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[5] = guiCreateButton(25, 200, 115, 60, "Sztywno?? zawieszenia+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[6] = guiCreateButton(450, 200, 115, 60, "Sztywno?? zawieszenia-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[7] = guiCreateButton(25, 270, 115, 60, "Promie? skr?tu+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[8] = guiCreateButton(450, 270, 115, 60, "Promie? skr?tu-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[9] = guiCreateButton(25, 340, 115, 60, "Pr?dko?? maksymalna+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[10] = guiCreateButton(450, 340, 115, 60, "Pr?dko?? maksymalna-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[11] = guiCreateButton(25, 410, 115, 60, "Przyspieszenie+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[12] = guiCreateButton(450, 410, 115, 60, "Przyspieszenie-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[12], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[13] = guiCreateButton(25, 480, 115, 60, "Spr??arka+", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[13], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[14] = guiCreateButton(450, 480, 115, 60, "Spr??arka-", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[14], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[69] = guiCreateButton(62, 600, 460, 81, "Zamknij okno", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[69], "NormalTextColour", "FFAAAAAA")    
    end
)


addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)


[ Dodano: 2020-08-21, 22:02 ]
To 1200 to przyk?ad, dodatkowo chyba trzeba dorobi? funkcje od get handling

Podpis


Modern Stories
Discord
https://discord.gg/MRJSYq8
Forum
https://msmta.pl
Panel Gracza
https://panel.msmta.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-08-22, 15:42


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Po zmianie handlingu, ustaw sobie guiSetText(element,text) - gdzie "text" bedzie oczywi?cie w twoim przypadku zmienn? pobranej warto?ci handlingu.

Postaw piwo autorowi tego posta
 

 
Tagi: refresh :: gui/handling :: cliencie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Odpowiedz do tematu

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