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

Wysłany: 2014-08-14, 12:01


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Witam serdecznie kochani. Jestem nowy na forum. Ale pisz? bo mam pewien problem. Jestem przekonany ?e mi pomo?ecie bo kolega poleci? to forum, m?wi? ?e wspaniali ludzie. A wi?c przejd?my do rzeczy ;) Chodzi o napisy. Dok?adnie o to ?e w danych kordach wy?wietla si? napis. Ja mam takowy skrypt bo przegl?da?em forum jako go?? i znalaz?em jak PanMaszyna podawa? jakiemu? innemu kolesiowi. U?y?em kodu, ale wyskakuj? b??dy. Podam kod :D

 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
                        dxDrawTexttextxy__tocolorcolor[1], color[2], color[3], color[4] ), scalefont"center""center" );
                    end
                end
            end
        end
    end
);


local napis dxDraw3DText"Magazyn ( Aby wej?? wci?nij E )"2376.228515625, -81.09179687527.567346572876,2.3,"clear",255,255,25525)


[ Dodano: 2014-08-14, 12:04 ]
Oczywi?cie za pomoc :piwo: , a tutaj ss jakie b??dy wyszukuje MTA Script Editor:



[ Dodano: 2014-08-14, 12:04 ]
http://zapodaj.net/5f20b23c1c347.png.html

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-14, 15:33


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dixers, usu? ":", ";" na koncu wierszy jak masz ): lub );

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-14, 16:57


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Nadal nic :( Macie jakie? pomys?y ?

[ Dodano: 2014-08-14, 17:00 ]
A dzi?ki ch?opie za pomoc, ale ju? nie potrzebuje ;) Wy?apa?em sam ju? b??dy :) Piwko leci za ch?ci :D

[ Dodano: 2014-08-14, 17:14 ]
A jednak pojawi?y si? problemy. Kod jest taki. MTA Script editor nic nie pokazuje ale jest db3

 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:1""text" )
            local tXtYtZ getElementDatatexts"i:2""x" ), getElementDatatexts"i:3""y" ), getElementDatatexts"i:4""z" )
                local font getElementDatatexts"i:5""font" )
                local scale getElementDatatexts"i:6""scale" )
                local color getElementDatatexts"i:7""rgba" )
                local maxDistance getElementDatatexts"i:8""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
                        dxDrawTexttextxy__tocolorcolor[1], color[2], color[3], color[4] ), scalefont"center""center" )
                    end
                end
            end
            end
        end)


        local napis dxDraw3DText"Zak?ad Pogrzebowy Rado??", -2127.1999511719, -80.535.299999237061,2.3,"clear",255,255,25525)

A o to db3:
ERROR:rpg/skrypty/napis1.lua:55:attempt to call local "texts" (a table value)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-14, 18:53


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

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:1], "text" );
                local tXtYtZ getElementDatatexts[i:2], "x" ), getElementDatatexts[i:3], "y" ), getElementDatatexts[i:4], "z" );
                local font getElementDatatexts[i:5], "font" );
                local scale getElementDatatexts[i:6], "scale" );
                local color getElementDatatexts[i:7], "rgba" );
                local maxDistance getElementDatatexts[i:8], "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
                        dxDrawTexttextxy__tocolorcolor[1], color[2], color[3], color[4] ), scalefont"center""center" );
                    end
                end
            end
        end
    end
);


        local napis dxDraw3DText"Zak?ad Pogrzebowy Rado??", -2127.1999511719, -80.535.299999237061,2.3,"default",255,255,25525)

Sprawdz Strona c-side.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-14, 22:03


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Nadal taki sam db3 i dodatkowo :
ERROR: Loading script failed rpg/skrypty.napis1.lua:55: '<name' expected near '1'

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-15, 12:09


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dixers, w nazwie nie mo?e by? . tylko _ lub razem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-15, 20:51


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

luki123luki123, nie ma przepraszam, to tylko liter?wka.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-16, 15:51


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dixers, po jakiej stronie masz ten skrypt ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-16, 17:55


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

No po stronie clienta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 15:55


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dixers, nie wiem czemu.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 18:40


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Hmmm, mo?e Maszyna b?dzie wiedzia? bo to jego kod. Napisz? do niego, dzi?ki luki za pomoc.

Postaw piwo autorowi tego posta
 

 
Tagi: napisy
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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