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

Wysłany: 2015-05-15, 10:31


TruskawkaPL

Początkujący LUA






Wiek: 26
Na forum: 4266 dni
Posty: 30
Nick w MP: BOLEQ



Respekt: 50

Ostrzeżeń: 100%
Dzie? dobry.

Chcia?bym si? zapyta? - w jaki spos?b mog? zespawni? peda i doda? opis nad jego g?ow?, np. Urz?dnik.
Oraz w jaki spos?b mog? doda? opis do pojazdu, np. do roweru Rower puliczny ?

Z g?ry dzi?kuj?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-15, 12:45


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Wgraj ten kod po stronie c-side :


addEventHandler("onClientRender",root,function()
    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"font""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.1truefalsefalsetruefalsetruetrue ) ) then
                    local sxsy getScreenFromWorldPositionpxpypz+0.2 )
                    if sx and sy then
                        local w dxGetTextWidthtostringtext ) )
                        local h = ( text and or ) * dxGetFontHeight( )
                        dxDrawTexttostringtext ), sx+3sy+30+3sxsytocolor00070 ), 1.1*width/2.5"default""center""center" )
                        dxDrawTexttostringtext ), sxsy+30sxsytocolor25525525570 ), 1.1*width/2.5"default""center""center",_,_,_,true )
                    end
                end
            end
        end
    end    
end)



Nast?puj?cemu elelementowi : ped, pojazd; nadaj setElementData(element,"message","Tekst")

Podpis

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

 
Wysłany: 2015-05-15, 12:49


TruskawkaPL

Początkujący LUA






Wiek: 26
Na forum: 4266 dni
Posty: 30
Nick w MP: BOLEQ



Respekt: 50

Ostrzeżeń: 100%
Shuffle, m?g?by? da? przyk?ad z ped'em?
Bo nie za bardzo rozumiem.. a dopiero si? ucz?. :oops:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-15, 13:08


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

local ped=createPed bla bla)
setElementData(ped,"message","Jest to ped testowy")


Podpis

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

 
Wysłany: 2015-05-15, 13:14


TruskawkaPL

Początkujący LUA






Wiek: 26
Na forum: 4266 dni
Posty: 30
Nick w MP: BOLEQ



Respekt: 50

Ostrzeżeń: 100%
"Shuffle" napisał/a:

local ped=createPed bla bla)
setElementData(ped,"message","Jest to ped testowy")

I ju? po tym kodzie nie musz? dawa? jakich? 'end' czy co??
Po prostu w osobnym pliku to da??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-05-15, 13:28


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

To by? przyk?ad, a nie ca?y kod. Pozagl?daj do poradnik?w, ja jestem tylko od pomocy a nie od nauki LUA.

Podpis

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

 
Wysłany: 2015-05-15, 13:35


TruskawkaPL

Początkujący LUA






Wiek: 26
Na forum: 4266 dni
Posty: 30
Nick w MP: BOLEQ



Respekt: 50

Ostrzeżeń: 100%
Dobra, mo?na zamkn??.

Postaw piwo autorowi tego posta
 

 
Tagi: napis :: nad :: głową :: peda :: opisy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Napis nad głową peda / opisy 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