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

Wysłany: 2016-03-19, 23:20


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

jak zrobi? napis 3d na pickup ?

addEventHandler("onClientRender", root, function()
    local rx,ry,rz = getCameraMatrix()
    
    for i,v in ipairs(getElementsByType("pickup", root)) do
        local opis = getElementData(p, "pickup_opis")
        if opis then
            local x,y,z = getElementPosition(p)
            local distance = getDistanceBetweenPoints3D(rx,ry,rz,x,y,z)
            if distance <= 20 then
                local sx,sy = getScreenFromWorldPosition(x,y,z, 200)
                if sx and sy then
                dxDrawText(opis, sx-(sw/5),sy,sx+(sw/5),sy, tocolor(255, 255, 255, 155), 1.0, "default-small", "center", "center", false, true)
                end
            end
        end
    end
end)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 23:28


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
addEventHandler("onClientRender", root, function()
function napisy()
    local pic = getElementsByType("pickup",getRootElement())
    local rx,ry,rz = getCameraMatrix()
    for i,pickup in ipairs(pic) do
        vopis = getElementData(pickup,"pickup_opis")
        if vopis then
            local vx,vy,vz = getElementPosition(pickup)
            local x,y,z = getElementPosition(localPlayer)
            local distance = getDistanceBetweenPoints3D(rx,ry,rz,vx,vy,vz)
            if distance <= 15 then
                local sx,sy = getScreenFromWorldPosition(vx,vy,vz, 0.06)
                if sx and sy then
                    if sx and sy then
                        dxDrawText(vopis, sx,sy,sx,sy, tocolor(0,0,0, 255), 1, "default-bold","center","center",false,false,true,false,false)
                        dxDrawText(vopis, sx,sy,sx,sy, tocolor(255,255,255, 255), 1, "default-bold","center","center",false,false,true,false,false)
                    end
                end
            end
        end
    end
end
addEventHandler("onClientRender",root,napisy)
end)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-20, 00:20


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

_Wicek_, zmieni?em to co wys?a?e? ale nadal nie dzia?a to jest kod Pickup

pickup = createPickup ( -2385.2072753906, -11.450578689575, 35.982009887695, 3, 1275, 0, 0 )  --- Boj?wka
setElementInterior (pickup, 0)

addEventHandler ( "onPickupHit", pickup, function(element)
    if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( element ) ), aclGetGroup ( "PSP" ) ) then
        if getAccountData ( getPlayerAccount ( element ), "stary:skin" ) then
            id = tonumber ( getAccountData ( getPlayerAccount ( element ), "stary:skin" ) )
            setElementModel ( element, id ) 
            setAccountData ( getPlayerAccount ( element ), "stary:skin", false )
            removeElementData(element,"Praca")
            takeWeapon(element, 42)
            takeWeapon(element, 9)
            setPlayerNametagColor(element, 255, 255, 255)
            outputChatBox("#cc3333* Wylogowa?a?-(a?) si? z s?u?by", element, 0, 0, 0, true)
        else
            skin = tonumber ( getElementModel ( element ) )
            setAccountData ( getPlayerAccount ( element ), "stary:skin", skin )
            setElementData( element, "pickup_opis", "Str?j Bojowy\nPanstwowej Strazy Pozarnej" )
            setPedArmor ( element, 100 )
            setElementModel ( element, 277  )
            local nazwa = "Panstowa Straz Pozarna"
            local r,g,b = 245, 170, 20
            setPlayerNametagColor(element, 245, 170, 20)
            setElementData(element,"Praca",nazwa)
            setElementData(element,"Praca:r",r) 
            setElementData(element,"Praca:g",g)     
            setElementData(element,"Praca:b",b) 
            outputChatBox("#cc3333* Zalogowa?e?-(a?) si? na S?u?b?", element, 0, 0, 0, true)
end
    end
    end)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-20, 00:21


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
setElementData( source, "pickup_opis", "Str?j Bojowy\nPanstwowej Strazy Pozarnej" )


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-20, 00:57


OskarYT

Mapper MTA






Wiek: 26
Na forum: 4386 dni
Posty: 267
Nick w MP: Kaczorek2306

Piwa: 1230

Respekt: 85,3

_Wicek_, Podmieni?em to i tak nie dzia?a nic w debugscript 3 si? nie wy?wietla ! :/

Podpis
Postaw piwo autorowi tego posta
 

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


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
?ap

pickup = createPickup ( -2385.2072753906, -11.450578689575, 35.982009887695, 3, 1275, 0, 0 )  --- Boj?wka
setElementInterior (pickup, 0)
setElementData(pickup,"pickup_opis","Str?j Bojowy\nPanstwowej Strazy Pozarnej")

addEventHandler ( "onPickupHit", pickup, function(element)
    if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( element ) ), aclGetGroup ( "PSP" ) ) then
        if getAccountData ( getPlayerAccount ( element ), "stary:skin" ) then
            id = tonumber ( getAccountData ( getPlayerAccount ( element ), "stary:skin" ) )
            setElementModel ( element, id ) 
            setAccountData ( getPlayerAccount ( element ), "stary:skin", false )
            removeElementData(element,"Praca")
            takeWeapon(element, 42)
            takeWeapon(element, 9)
            setPlayerNametagColor(element, 255, 255, 255)
            outputChatBox("#cc3333* Wylogowa?a?-(a?) si? z s?u?by", element, 0, 0, 0, true)
        else
            skin = tonumber ( getElementModel ( element ) )
            setAccountData ( getPlayerAccount ( element ), "stary:skin", skin )
            setPedArmor ( element, 100 )
            setElementModel ( element, 277  )
            local nazwa = "Panstowa Straz Pozarna"
            local r,g,b = 245, 170, 20
            setPlayerNametagColor(element, 245, 170, 20)
            setElementData(element,"Praca",nazwa)
            setElementData(element,"Praca:r",r) 
            setElementData(element,"Praca:g",g)     
            setElementData(element,"Praca:b",b) 
            outputChatBox("#cc3333* Zalogowa?e?-(a?) si? na S?u?b?", element, 0, 0, 0, true)
end
    end
    end)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Tagi: pickup
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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