Jump to content

Pobieranie nazwy pojazdu z markeru


Recommended Posts

Witam, zrobiłem kod, gdzie po wjechaniu samochodem do markeru pokazuje się gui, GridList, w kolumnie1 "Model" -> row "-" ma się pokazać nazwa samochodu. Pobiera jednak nazwę mojego samochodu a nie kogoś, kto wjedzie w marker. Pomoże ktoś?

 

silnikIOpony = createMarker(-2050.5, 167.39999, 27.9, "cylinder", 1, 255, 0, 0, 0) -- marker do otwarcia GUI

InfoOSamochodzie = createMarker(-2052.3999023438, 170.5, 27.799999237061, "cylinder", 4, 255, 255, 255, 255) -- marker w którym stoi samochód

local screenW, screenH = guiGetScreenSize()

        komputerOponySilniki = guiCreateWindow(10, (screenH - 372) / 2, 836, 372, "Diagnostyka Komputerowa", false)
        guiWindowSetSizable(komputerOponySilniki, false)
        guiSetVisible(komputerOponySilniki, false)

panelUszkodzen = guiCreateGridList(10, 29, 669, 287, false, komputerOponySilniki)
           column1 = guiGridListAddColumn(panelUszkodzen, "Model", 0.3)
row = guiGridListAddRow(panelUszkodzen)
nazwa = guiGridListSetItemText(panelUszkodzen, 0, 1, "-", false, false)

addEventHandler("onClientMarkerHit", InfoOSamochodzie,
            function(hitPlayer,matchingDimension)
                if (not matchingDimension) or (isElement(komputerOponySilniki)) or (hitPlayer ~= localPlayer) then
                    return 
                end

                local veh = getPedOccupiedVehicle(localPlayer)


                guiGridListSetItemText(panelUszkodzen, 0, 1, ""..getVehicleName(veh).."", false, false)
            end
        )

        addEventHandler("onClientMarkerLeave", InfoOSamochodzie,
            function(leftPlayer,matchingDimension)
                if (leftPlayer == localPlayer) and (matchingDimension) and (isElement(komputerOponySilniki)) then
                    guiGridListClear(column1)
                end
            end
        )

 

Link to comment
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...