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

Wysłany: 2016-11-10, 20:22


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

Jak zrobi? zeby w tekscie nie by?o "..id.." tylko np id auta 1


local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker
local t=createElement('text')
setElementPosition(t,2151.69, -2182.8112.55+0.25)
setElementData(t"name""Informacje dt. pojazdu\n\nID: nA\nPrzebieg: nA\nW?a?ciciel: nA")

addEventHandler("onClientMarkerHit"tunetunels, function(elmd)
    local pobieranieauta getPedOccupiedVehicle(el)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    if not getPedOccupiedVehicle(elthen return end
    local id getElementData(el,"vehicle:id") 
    outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
    setElementDatat"name""Informacje dt. pojazdu\nID: "..id.."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el) )
end)

addEventHandler"onClientRender"getRootElement(),
    function ()
    local screenWidthscreenHeight guiGetScreenSize ( )
    local xy, = getScreenFromWorldPosition(getElementPosition(t))
    local text getElementDatat"name")
    dxDrawText(textxyscreenWidth,screenHeight,tocolor(255,255,255,255),scale,"pricedown")
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 20:35


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

Aidis, Nie rozumiem, kod jest prawid?owy bo "..id.." oznacza, ?e w dane miejsce zostanie wy?wietlone ID pojazdu. Wi?c w czym problem?

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 21:13


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3810 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker
local t=createElement('text')
setElementPosition(t,2151.69, -2182.8112.55+0.25)
setElementData(t"name""Informacje dt. pojazdu\n\nID: nA\nPrzebieg: nA\nW?a?ciciel: nA")

addEventHandler("onClientMarkerHit"tunetunels, function(elmd)
    local pobieranieauta getPedOccupiedVehicle(el)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    if not getPedOccupiedVehicle(elthen return end
    local id getElementData(getPedOccupiedVehicle(el),"vehicle:id") 
    outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
    setElementDatat"name""Informacje dt. pojazdu\nID: "..id.."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el) )
end)

addEventHandler"onClientRender"getRootElement(),
    function ()
    local screenWidthscreenHeight guiGetScreenSize ( )
    local xy, = getScreenFromWorldPosition(getElementPosition(t))
    local text getElementDatat"name")
    dxDrawText(textxyscreenWidth,screenHeight,tocolor(255,255,255,255),scale,"pricedown")
    end
)


nie testowa?em , ani nie mam ca?ego kodu wi?c nie wiem czy zadzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 21:14


Kalizman







Wiek: 23
Na forum: 3652 dni
Posty: 1394

Piwa: 4619

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

Aidis, zauwa? ?e 13-stej linijce nie poda?e? kord?w wi?c zr?b najlepiej porz?dek tak:

local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker

addEventHandler("onClientMarkerHit"tunetunels, function(elmd)
    local pobieranieauta getPedOccupiedVehicle(el)
    if not md or getElementType(el) ~= "player" then return end
    if el ~= localPlayer then return end
    if not getPedOccupiedVehicle(elthen return end
    local id getElementData(el,"vehicle:id") 
    outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
    --setElementDatat"name""Informacje dt. pojazdu\nID: "..id.."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el) )
end)

local t=createElement('text')
setElementPosition(t,2151.69, -2182.8112.55+0.25)
setElementData(t"name""Informacje dt. pojazdu\n\nID: "..id.."\nPrzebieg: nA\nW?a?ciciel: "..getPlayerName(el))

addEventHandler"onClientRender"getRootElement(),
    function ()
    local screenWidthscreenHeight guiGetScreenSize ( )
    local xy, = getScreenFromWorldPosition(getElementPosition(t))
    local text getElementDatat"name")
    dxDrawText(textxyscreenWidth,screenHeight,tocolor(255,255,255,255),scale,"pricedown")
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 21:53


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3810 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240


local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker
local t=createElement('text')
setElementPosition(t,2151.69, -2182.8112.55+0.25)
setElementData(t"name""Informacje dt. pojazdu\n\nID: nA\nPrzebieg: nA\nW?a?ciciel: nA")

addEventHandler("onClientMarkerHit"tunetunels, function(elmd)
    local pobieranieauta getPedOccupiedVehicle(el)
    if el ~= localPlayer then return end
    if not getPedOccupiedVehicle(elthen return end
    local id getElementData(el,"vehicle:id") 
    outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
    setElementDatat"name""Informacje dt. pojazdu\nID: "..id.."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el) )
end)

addEventHandler"onClientRender"getRootElement(),
    function ()
    local screenWidthscreenHeight guiGetScreenSize ( )
    local xy, = getScreenFromWorldPosition(getElementPosition(t))
    local text getElementDatat"name")
    dxDrawText(textxyscreenWidth,screenHeight,tocolor(255,255,255,255),scale,"pricedown")
    end
)

Usun??em jedn? linijk? , bo skoro wje?d?asz w marker pojazdem to typ elementu to nie player tylko vehicle.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 21:59


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

nadal nic teraz niema markera.
SCRIPT ERROR: [skrypty_glowne]/og-tuning/s_informacje.lua:28: '<name>' expected near '='
ERROR: Loading script failed: [skrypty_glowne]/og-tuning/s_informacje.lua:28: '<name>' expected near '='

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-10, 23:34


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3810 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

Daj ca?y kod lub linijk? z b??dem , bo nie wiem kt?ra.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-11, 10:43


AteX







Wiek: 26
Na forum: 4016 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

"Aidis" napisał/a:

nadal nic teraz niema markera.
SCRIPT ERROR: [skrypty_glowne]/og-tuning/s_informacje.lua:28: '<name>' expected near '='
ERROR: Loading script failed: [skrypty_glowne]/og-tuning/s_informacje.lua:28: '<name>' expected near '='


A? tak my?lenie boli?

 local xy, = getScreenFromWorldPosition(getElementPosition(t))

Po y jest przecinek, kt?rego by? nie powinno.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-11, 12:19


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

marker jest ale nadal nie zmiena ..id.. na np 1

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-11, 14:42


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Aidis,
local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker
local t=createElement('text')
setElementPosition(t,2151.69, -2182.8112.55+0.25)
setElementData(t"name""Informacje dt. pojazdu\n\nID: nA\nPrzebieg: nA\nW?a?ciciel: nA")

addEventHandler("onClientMarkerHit"tunetunels, function(elmd)
    local pobieranieauta getPedOccupiedVehicle(el)
    if not md or getElementType(el) ~= "vehicle" then return end
    if not getPedOccupiedVehicle(elthen return end
    local id getElementData(el,"vehicle:id") 
    outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
    setElementDatat"name""Informacje dt. pojazdu\nID: "..id.."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el) )
end)

addEventHandler"onClientRender"getRootElement(),
    function ()
    local screenWidthscreenHeight guiGetScreenSize ( )
    local xgetScreenFromWorldPosition(getElementPosition(t))
    local text getElementDatat"name")
    dxDrawText(textxyscreenWidth,screenHeight,tocolor(255,255,255,255),scale,"pricedown")
    end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-11, 14:54


FaydenFX.







Wiek: 27
Na forum: 4057 dni
Posty: 246
Nick w MP: faydn

Piwa: 11

Respekt: 45,3

spr?buj tak:

local tunetunels createMarker(2145.48,-2178.92,12.55"cylinder"425525525530) -- marker
local t createElement('text')
setElementPosition(t2151.69, -2182.8112.55+0.25)
setElementData(t"name""Stanowisko jest puste!")

addEventHandler("onClientMarkerHit"tunetunels,
    function(elmd)
            if not md or getElementType(el) ~= "player" then return end
            if el ~= localPlayer then return end
            local pobieranieauta getPedOccupiedVehicle(el)
            if not pobieranieauta then return end
            local id getElementData(pobieranieauta"vehicle:id") 
            outputChatBox("Informacja: System informacji na temat pojazdu zosta? pomy?lnie wczytany."2552550) 
            setElementData(t"name""Informacje dt. pojazdu\nID: "..(id or "brak").."\nPrzebieg: 0\nW?a?ciciel: "..getPlayerName(el))
    end
)

addEventHandler("onClientMarkerLeave"tunetunels,
     function(elmd)
            if not md or getElementType(el) ~= "player" then return end
            if el ~= localPlayer then return end
            local pobieranieauta getPedOccupiedVehicle(el)
            if not pobieranieauta then return end
            setElementData(t"name""Stanowisko jest puste!")
    end
)



Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-11, 15:10


P.Wiśnia

Programista LUA






Wiek: 24
Na forum: 4045 dni
Posty: 568
Nick w MP: P.Wiśnia

Piwa: 376

Respekt: 100
Respekt: 100

nadal nie zmienia.

Postaw piwo autorowi tego posta
 

 
Tagi: informacje :: pojeździe
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Informacje o pojeździe 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