Wysłany: 2014-10-22, 20:35
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
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?
Wysłany: 2014-10-22, 20:42
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
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.
Wysłany: 2014-10-22, 21:23
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4395 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
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 )
Wysłany: 2014-10-23, 16:22
xBolekk
Wiek: 24 Na forum: 4474 dni Posty: 113
Nick w MP: Bolek.
Piwa : 190
Wysłany: 2014-10-23, 18:33
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2014-10-23, 18:54
dudeks
Wiek: 31 Na forum: 6576 dni Posty: 171
Piwa : 89
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
Wysłany: 2014-10-23, 20:30
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
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
Tagi: nie :: wyświetlanie :: nazwy :: unkown :: interiorze.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: