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
[lua]
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)
showPlayerHudCompo... |