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

Wysłany: 2014-10-22, 20:35


xBolekk







Wiek: 24
Na forum: 4615 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Cze??.
Mam kod, kt?ry wy?wietla dzielnic?, miasto, lecz je?li jestem w interiorze pisze unkown. Mo?na zrobi?, ?e kiedy jestem w interiorze to nie wy?wietla w og?le si? ten napis?

Kod

local screenWidth, screenHeight = guiGetScreenSize ( ) --skalujemy
 
function createText ( )
    local x, y, z = getElementPosition ( localPlayer ) --pobieramy pozycje
    local location = getZoneName ( x, y, z ) --pobieramy dzielnice
    local city = getZoneName ( x, y, z, true ) --pobieramy miasto

    dxDrawText ( city, 403, screenHeight - 103, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.2, czcionka ) --cien
    dxDrawText ( city, 400, screenHeight - 100, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.2, czcionka )  -- tekst
    
    if location ~= city then
        dxDrawText ( location, 423, screenHeight - 153, screenWidth, screenHeight, tocolor (0, 0, 0, 255 ), 1.2, czcionka ) --cien
        dxDrawText ( location, 420, screenHeight - 150, screenWidth, screenHeight, tocolor (255, 255, 255, 255 ), 1.2, czcionka ) --tekst
    end
end
 
 
 function HandleTheRendering ( )
    czcionka = dxCreateFont( "yellowc.ttf", 20 ) --ladujemy czcionki
    addEventHandler ( "onClientRender", root, createText ) 
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )

showPlayerHudComponent("area_name", false)
showPlayerHudComponent("vehicle_name", false)
showPlayerHudComponent("radio", false)


I jeszcze co?... Na dole kodu wida?, ?e ukrywaj? si? hudy, jednak po minimalizowaniu gry komponent area_name si? pojawia. Jak temu zapobiec?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-22, 20:42


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

xBolekk, 1. problem

local screenWidth, screenHeight = guiGetScreenSize ( ) --skalujemy
 
function createText ( )
    local x, y, z = getElementPosition ( localPlayer ) --pobieramy pozycje
    local location = getZoneName ( x, y, z ) --pobieramy dzielnice
    local city = getZoneName ( x, y, z, true ) --pobieramy miasto

    dxDrawText ( city, 403, screenHeight - 103, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.2, czcionka ) --cien
    dxDrawText ( city, 400, screenHeight - 100, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.2, czcionka )  -- tekst
    
    if location ~= city then
        if not location == "unkown" then
        dxDrawText ( location, 423, screenHeight - 153, screenWidth, screenHeight, tocolor (0, 0, 0, 255 ), 1.2, czcionka ) --cien
        dxDrawText ( location, 420, screenHeight - 150, screenWidth, screenHeight, tocolor (255, 255, 255, 255 ), 1.2, czcionka ) --tekst
        end
  end
end
 
 
 function HandleTheRendering ( )
    czcionka = dxCreateFont( "yellowc.ttf", 20 ) --ladujemy czcionki
    addEventHandler ( "onClientRender", root, createText ) 
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )

showPlayerHudComponent("area_name", false)
showPlayerHudComponent("vehicle_name", false)
showPlayerHudComponent("radio", false)

2. nie wiem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-22, 21:23


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4536 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Ma?a poprawka :

local screenWidth, screenHeight = guiGetScreenSize ( ) --skalujemy
 
function createText ( )
    local x, y, z = getElementPosition ( localPlayer ) --pobieramy pozycje
    local location = getZoneName ( x, y, z ) --pobieramy dzielnice
    local city = getZoneName ( x, y, z, true ) --pobieramy miasto

    dxDrawText ( city, 403, screenHeight - 103, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.2, czcionka ) --cien
    dxDrawText ( city, 400, screenHeight - 100, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.2, czcionka )  -- tekst
    
    if location ~= city then
if not location then return end
        if not location == "unknown" then
        dxDrawText ( location, 423, screenHeight - 153, screenWidth, screenHeight, tocolor (0, 0, 0, 255 ), 1.2, czcionka ) --cien
        dxDrawText ( location, 420, screenHeight - 150, screenWidth, screenHeight, tocolor (255, 255, 255, 255 ), 1.2, czcionka ) --tekst
        end
  end
end
 
 
 function HandleTheRendering ( )
    czcionka = dxCreateFont( "yellowc.ttf", 20 ) --ladujemy czcionki
    addEventHandler ( "onClientRender", root, createText ) 
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )

showPlayerHudComponent("area_name", false)
showPlayerHudComponent("vehicle_name", false)
showPlayerHudComponent("radio", false)


Podpis

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

 
Wysłany: 2014-10-23, 16:22


xBolekk







Wiek: 24
Na forum: 4615 dni
Posty: 113
Nick w MP: Bolek.

Piwa: 190

Respekt: 60

Nie dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-23, 18:33


luki123luki123

Place Game






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

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

xBolekk, sprawdz moje.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-23, 18:54


dudeks







Wiek: 32
Na forum: 6717 dni
Posty: 171

Piwa: 89

Respekt: 105,3
Respekt: 105,3

Nie ma pokazywa? tylko lokacji, czy oby dw?ch tekst?w? Je?eli dw?ch to:

function createText ( )
    local x, y, z = getElementPosition ( localPlayer ) --pobieramy pozycje
    local location = getZoneName ( x, y, z ) --pobieramy dzielnice
    local city = getZoneName ( x, y, z, true ) --pobieramy miasto
    
    if string.lower(location) == "unknown" then return end
    
    dxDrawText ( city, 403, screenHeight - 103, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.2, czcionka ) --cien
    dxDrawText ( city, 400, screenHeight - 100, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1.2, czcionka )  -- tekst
    
    if location ~= city then
        dxDrawText ( location, 423, screenHeight - 153, screenWidth, screenHeight, tocolor (0, 0, 0, 255 ), 1.2, czcionka ) --cien
        dxDrawText ( location, 420, screenHeight - 150, screenWidth, screenHeight, tocolor (255, 255, 255, 255 ), 1.2, czcionka ) --tekst
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-10-23, 20:30


Oski

LUA Scripter






Wiek: 30
Na forum: 5387 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Jest jeszcze opcja pobrania interioru w kt?rym znajduje si? localPlayer, je?li r?wna si? on zero (if interior==0) to w takim wypadku rysujemy napis jesli nie to rysujemy w tek?cie nazwy interiora pobranea z PA

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: wyświetlanie :: nazwy :: unkown :: interiorze.
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