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

Wysłany: 2014-06-25, 11:16


matik19977







Wiek: 28
Na forum: 4904 dni
Posty: 32
Nick w MP: nicollas



Respekt: 50

Sirma chia?bym steworzy? tablice og?osze? w gui ?e gdy wejde w marker to otworzy si? gui a w nim tekst i przycisk zamknij i zrobi?em ju? panel w guieditorze pobra?erm kod wiem ?e musz? to zrobi? po stronie clienta ale nie bardzo wiem od czego zacz?? jakich funkcji u?y? oto kod :
Kod:


GUIEditor = {
button = {},
window = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(277, 148, 199, 297, "Tablica Og?osze?", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.memo[1] = guiCreateMemo(13, 31, 176, 229, "dawaj text", false, GUIEditor.window[1])
GUIEditor.button[1] = guiCreateButton(27, 266, 148, 21, "Zamknij", false, GUIEditor.window[1])
end
)
chyba ?e kto? ma jaki? dobry kod na text 3d i pode?le kodzik :d

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 12:02


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Zacznij szuka? po starych dzia?ach b?d? u?ywaj wyszukiwarki. Dawa?em ten kod 40 razy :

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,"default",255,255,25525)


Na dole jego u?ycie.

Podpis

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

 
Wysłany: 2014-06-25, 12:46


matik19977







Wiek: 28
Na forum: 4904 dni
Posty: 32
Nick w MP: nicollas



Respekt: 50

zrobi?em tak: wklei?em to jako Client i stworzy?em metee oraz zmieni?em kordy a skrypt nie dzia?a :(
Kod:

<meta>
<script src="c.lua" type="client"/>
</meta


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 12:56


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Jakie? b??dy w konsoli ?
Sprawd? czy nazwa skryptu i nazwa skryptu w meta jest taka sama.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 12:59


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

db3 podaj.

Podpis

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

 
Wysłany: 2014-06-25, 13:03


matik19977







Wiek: 28
Na forum: 4904 dni
Posty: 32
Nick w MP: nicollas



Respekt: 50

Panmaszyna mo?na ja?niej ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 13:05


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

/debugscript 3
konsola b??d?w.

Podpis

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

 
Wysłany: 2014-06-25, 13:07


matik19977







Wiek: 28
Na forum: 4904 dni
Posty: 32
Nick w MP: nicollas



Respekt: 50

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 13:20


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

w 55 linijce masz jaki? znak niepotrzebny "1".

Podpis

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

 
Wysłany: 2014-06-25, 13:24


matik19977







Wiek: 28
Na forum: 4904 dni
Posty: 32
Nick w MP: nicollas



Respekt: 50

Client :
Kod:

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

function dxDraw3DText( text, x, y, z, scale, font, r, g, b, maxDistance )

assert( type( text ) == "string", "Bad argument @ dxDraw3DText" );
assert( type( x ) == "number", "Bad argument @ dxDraw3DText" );
assert( type( y ) == "number", "Bad argument @ dxDraw3DText" );
assert( type( z ) == "number", "Bad argument @ dxDraw3DText" );

if not scale or type( scale ) ~= "number" or scale <= 0 then
scale = 2
end
if not font or type( font ) ~= "string" or not fonts[ font ] then
font = "default"
end
if not r or type( r ) ~= "number" or r < 0 or r > 255 then
r = 255
end
if not g or type( g ) ~= "number" or g < 0 or g > 255 then
g = 255
end
if not b or type( b ) ~= "number" or b < 0 or b > 255 then
b = 255
end
if not maxDistance or type( maxDistance ) ~= "number" or maxDistance <= 1 then
maxDistance = 20
end
local textElement = createElement( "text" );

if textElement then

setElementData( textElement, "text", text );
setElementData( textElement, "x", x );
setElementData( textElement, "y", y );
setElementData( textElement, "z", z );
setElementData( textElement, "scale", scale );
setElementData( textElement, "font", font );
setElementData( textElement, "rgba", { r, g, b, 255 } );
setElementData( textElement, "maxDistance", maxDistance );

return textElement
end

return false
end

addEventHandler( "onClientRender", root,
function( )
local texts = getElementsByType( "text" );
if #texts > 0 then
local pX, pY, pZ = getElementPosition( localPlayer );
for i = 1, #texts do
local text = getElementData( texts[i], "text" );
local tX, tY, tZ = getElementData( texts[i], "x" ), getElementData( texts[i], "y" ), getElementData( texts[i], "z" );
local font = getElementData( texts[i], "font" );
local scale = getElementData( texts[i], "scale" );
local color = getElementData( texts[i], "rgba" );
local maxDistance = getElementData( texts[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 type( color ) ~= "table" then
color = { 255, 255, 255, 255 };
end
if not maxDistance then maxDistance = 20 end
local distance = getDistanceBetweenPoints3D( pX, pY, pZ, tX, tY, tZ );
if distance <= maxDistance then
local x, y = getScreenFromWorldPosition( tX, tY, tZ );
if x and y then
dxDrawText( text, x, y, _, _, tocolor( color[1], color[2], color[3], color[4] ), scale, font, "center", "center" );
end
end
end
end
end
);


local napis = dxDraw3DText( "Magazyn ( Aby wej?? wci?nij E )", 2376.228515625, -81.091796875, 27.567346572876,2.3,"default",255,255,255, 25)

Meta:
Kod:

<meta>
<script src="client.lua" type="client"/>
</meta>


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-06-25, 13:38


MeeShuffle

Programista/Grafik






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

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Nie prosi?em o kod. W 55 linijce masz b??d.

Podpis

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

 
Tagi: tworzenie :: gui :: lub :: 3dtxt
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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