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

Wysłany: 2014-12-27, 12:25


Lysy_Kappa







Wiek: 24
Na forum: 4195 dni
Posty: 10
Nick w MP: Lysy



Respekt: 45,3

Siema, tutaj ?ysy, ja z problemem:
Napisa?em skrypt z poradnika, i nie dzia?a :/ .
Mogliby?cie pom?c? Oczywi?cie, daje Grza?ca, na ocieplenie :) .
Chcia?bym aby w kodzie znajdowa? si? w markerze text3d, z napisem: Darmowe Buffalo, ale nie wiem jak to zrobi? ;/.
KOD:
Kod:

function auto ( thePlayer )
createVehicle ( 402, -2534.1706542969, 2361.3276367188, 4.9856700897217 )
marker = createMarker ( -2534.1706542969, 2361.3276367188, 4.9856700897217, "cylinder", 1.5, 255, 255, 255, 170 )
end
addEventHandler ( "onMarkerHit", marker, auto )

Pozdrawiam,
?ysy.

[ Dodano: 2014-12-27, 12:29 ]
Wydaje mi si?, ?e musz? dwa razy end da?, ale nie jestem pewien.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-27, 12:43


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

createMarker wywal na g?r? funkcji.

Co do 3dtext :

local fonts = { [ "default" ] = true, [ "default-bold" ] = true,[ "clear" ] = true,[ "arial" ] = true,[ "sans" ] = true,
      [ "pricedown" ] = true, [ "bankgothic" ] = true,[ "diploma" ] = true,[ "beckett" ] = true
};

function dxDraw3DTexttextxyzscalefontrgbmaxDistance )

    asserttypetext ) == "string""Bad argument @ dxDraw3DText" );
    asserttype) == "number""Bad argument @ dxDraw3DText" );
    asserttype) == "number""Bad argument @ dxDraw3DText" );
    asserttype) == "number""Bad argument @ dxDraw3DText" );

    if not scale or typescale ) ~= "number" or scale <= 0 then
        scale 2
    end
    if not font or typefont ) ~= "string" or not fontsfont then
        font "default"
    end
    if not r or type) ~= "number" or or 255 then
        r 255
    end
    if not g or type) ~= "number" or or 255 then
        g 255
    end
    if not b or type) ~= "number" or or 255 then
        b 255
    end
    if not maxDistance or typemaxDistance ) ~= "number" or maxDistance <= 1 then
        maxDistance 20
    end
    local textElement createElement"text" );

    if textElement then 

        setElementDatatextElement"text"text );
        setElementDatatextElement"x");
        setElementDatatextElement"y");
        setElementDatatextElement"z");
        setElementDatatextElement"scale"scale );
        setElementDatatextElement"font"font );
        setElementDatatextElement"rgba", { rgb255 } );
        setElementDatatextElement"maxDistance"maxDistance );

        return textElement
    end

    return false
end

addEventHandler"onClientRender"root,
    function( )
        local texts getElementsByType"text" );
        if #texts > 0 then
            local pXpYpZ getElementPositionlocalPlayer );
            for 1#texts do
                local text getElementDatatexts[i], "text" );
                local tXtYtZ getElementDatatexts[i], "x" ), getElementDatatexts[i], "y" ), getElementDatatexts[i], "z" );
                local font getElementDatatexts[i], "font" );
                local scale getElementDatatexts[i], "scale" );
                local color getElementDatatexts[i], "rgba" );
                local maxDistance getElementDatatexts[i], "maxDistance" );
                if not text or not tX or not tY or not tZ then
                    return
                end
                if not font then font "default" end
                if not scale then scale 2 end
                if not color or typecolor ) ~= "table" then
                    color = { 255255255255 };
                end
                if not maxDistance then maxDistance 20 end
                local distance getDistanceBetweenPoints3DpXpYpZtXtYtZ );
                if distance <= maxDistance then
                    local xgetScreenFromWorldPositiontXtYtZ );
                    if and y then
                        dxDrawTexttextx+2y+2__tocolor000255 ), scalefont"center""center" );
                        dxDrawTexttextxy__tocolorcolor[1], color[2], color[3], color[4] ), scalefont"center""center" );
                    end
                end
            end
        end
    end
);


Podpis

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

 
Wysłany: 2014-12-27, 12:48


Lysy_Kappa







Wiek: 24
Na forum: 4195 dni
Posty: 10
Nick w MP: Lysy



Respekt: 45,3

Czyli ma to wygl?da? tak?:
Kod:

marker = createMarker ( -2534.1706542969, 2361.3276367188, 4.9856700897217, "cylinder", 1.5, 255, 255, 255, 170 )
function auto ( thePlayer )
createVehicle ( 402, -2534.1706542969, 2361.3276367188, 4.9856700897217 )
end
addEventHandler ( "onMarkerHit", marker, auto )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-27, 12:57


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Teraz tylko Ci auto da :)

Podpis

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

 
Wysłany: 2014-12-27, 13:00


Lysy_Kappa







Wiek: 24
Na forum: 4195 dni
Posty: 10
Nick w MP: Lysy



Respekt: 45,3

Ok- dziala, dziena.

[ Dodano: 2014-12-27, 13:00 ]
A jak zrobi?, ?eby dawa?o mi auto, i ?eby od razu do niego tepa?o, bo w twoim poradniku tego nie zobaczy?em. ;-;

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-12-27, 13:54


Jeey

Lua, Grafik






Wiek: 27
Na forum: 4339 dni
Posty: 98
Nick w MP: Jeey

Piwa: 383

Respekt: 80

Ostrzeżeń: 100%

marker createMarker ( -2534.17065429692361.32763671884.9856700897217"cylinder"1.5255255255170 ) 
function auto thePlayer auto createVehicle 402, -2534.17065429692361.32763671884.9856700897217 ) 
 warpPedIntoVehicle thePlayerautoend 
addEventHandler "onMarkerHit"markerauto )


Postaw piwo autorowi tego posta
 

 
Tagi: dawanie :: auta
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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