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

Wysłany: 2014-09-19, 17:03


teusz11







Wiek: 29
Na forum: 4652 dni
Posty: 191
Nick w MP: Matevsz

Piwa: 4

Respekt: 50

Witam, jak da? jaki? tekst tu? nad g?ow? peda? oraz jak zrobi? takie co?, ?e je?li stoimy samochodem przed barierk? zabierze nam 50$ i barierka si? otwiera

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-19, 17:37


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Napis nad g?ow? Sobie nie poradzisz dlatego ?ap m?j kod. U?ycie - nadane setElementData u?ytkownikowi o nazwie "message" z wartoscia tekstu w "".

font dxCreateFont "zachary.ttf"20 )

function renderIng( )
    local xygetCameraMatrix( )
    local dimension getElementDimensionlocalPlayer )
    for keypickup in ipairs getElementsByType"pickup" ) ) do
        if getElementDimensionpickup ) == dimension then
            local pxpypz getElementPositionpickup )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDatapickup"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 0.7truetruetruetruefalsefalsetruelocalPlayer ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz 0.7 )
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        dxDrawRectanglesx 5sy 51010tocolor000200 ) )
                        dxDrawTexttostringtext ), sxsysxsytocolor255255255255 ), 1"default""center""center" )
                    end
                end
            end
        end
    end
    for keymarker in ipairs getElementsByType"marker" ) ) do
        if getElementDimensionmarker ) == dimension then
            local pxpypz getElementPositionmarker )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDatamarker"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 1.7truetruetruetruefalsefalsetruelocalPlayer ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz 1.7 )
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        dxDrawRectanglesx 5sy 51010tocolor000200 ) )
                        dxDrawTexttostringtext ), sxsysxsytocolor255255255255 ), 1"default""center""center" )
                    end
                end
            end
        end
    end
    for keyplayer in ipairs getElementsByType"player" ) ) do
        if getElementDimensionplayer ) == dimension then
            local pxpypz getElementPositionplayer )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDataplayer"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 1.1truetruetruetruefalsefalsetruelocalPlayer ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz 0.2)
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        -- dxDrawRectanglesx 5sy 51010tocolor000200 ) )
                         dxDrawTexttostringtext ), sxsysxsytocolor255255255255 ), 1.2"default""center""center" )
                    end
                end
            end
        end
    end        
    for keyped in ipairs getElementsByType"ped" ) ) do
        if getElementDimensionped ) == dimension then
            local pxpypz getElementPositionped )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDataped"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 0truetruetruetruefalsefalsetruelocalPlayer ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz 0.1)
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        dxDrawRectanglesx 5sy 110htocolor000200 ) )
                        dxDrawTexttostringtext ), sxsysxsytocolor255255255255 ), 1"default""center""center" )
                    end
                end
            end
        end
    end    
    for keyvehicle in ipairs getElementsByType"vehicle" ) ) do
        if getElementDimensionvehicle ) == dimension then
            local pxpypz getElementPositionvehicle )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDatavehicle"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 1.1truetruetruetruefalsefalsetrue ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz+0.2 )
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        --dxDrawRectanglesx 25sy 1+50htocolor000200 ) )
                        dxDrawText"Na kartce napisane:"sxsysxsy-30tocolor255255255255 ), 0.8"bankgothic""center""center" )
                        --dxDrawRectanglesx 25sy 3030030tocolor000200 ) )
                        dxDrawTexttostringtext ), sxsy+30sxsytocolor255255255255 ), 0.7"bankgothic""center""center" )
                    end
                end
            end
        end
    end    
    for keyobject in ipairs getElementsByType"object" ) ) do
        if getElementDimension( object ) == dimension then
            local pxpypz getElementPosition( object )
            local distance getDistanceBetweenPoints3Dpxpypzxy)
            if distance <= 20 then
                local text getElementDataobject"message" )    
                if text and ( distance or isLineOfSightClearxyzpxpypz 1.1truetruetruetruefalsefalsetruelocalPlayer ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz 1.1 )
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                         dxDrawRectanglesx 5sy 110htocolor000200 ) )
                        dxDrawTexttostringtext ), sxsysxsytocolor255255255255 ), 1"default""center""center" )
                    end
                end
            end
        end
    end    
end
addEventHandler"onClientRender"getRootElement( ),renderIng)


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-19, 17:40


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Funkcje do utworzenia tekstu nad g?ow?:


Więcej informacji znajdziesz w Wikipedii MTA:

dxDrawText



Więcej informacji znajdziesz w Wikipedii MTA:

getScreenFromWorldPosition



Więcej informacji znajdziesz w Wikipedii MTA:

getPedBonePosition


@UP lel, par? sek. wcze?niej.

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-19, 17:54


teusz11







Wiek: 29
Na forum: 4652 dni
Posty: 191
Nick w MP: Matevsz

Piwa: 4

Respekt: 50

Dobra to teraz ostatnie, jak zrobi?em marker i je?li w niego wjedziemy odejmuje nam 50$ i otwieraj? si? barierki, z MoveObject dam rade tylko w?a?nie to pobieranie pieni?dzy :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-19, 18:12


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

teusz11,
Więcej informacji znajdziesz w Wikipedii MTA:

TakePlayerMoney


Postaw piwo autorowi tego posta
 

 
Tagi: dxdrawtext :: barierki
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » dxDrawText i barierki 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