function draw3DText()
local x, y = getScreenFromWorldPosition(0, 0, 4)
if x then
dxDrawText("Zape?nienie", x, y)
end
end
addEventHandler("onClientRender", getRootElement(), draw3DText)
To taki przyk?ad, tworz?cy napis Zape?nienie na ?rodku mapy - pozycje 0, 0, 4
function renders (thePlayer, seat)
if seat == 0 then
local vehicle = getPedOccupiedVehicle( thePlayer )
local model_auta = getElementModel ( vehicle )
if model_auta == 408 then
if isPedInVehicle(thePlayer) == true then
local scX, scY = guiGetScreenSize()
for k,o in ipairs(getElementsByType ( "marker")) do
local cys = getElementData ( o, "smietnik" )
if cys == true then
if getElementModel(o) == 2899 then
x,y,z = getElementPosition(o)
local px, py = getScreenFromWorldPosition( x, y, z + 4, 0.06 )
local cx, cy, cz = getCameraMatrix()
local dist = getDistanceBetweenPoints3D( cx, cy, cz,x, y, z );
if dist >=1 and dist <= 40 then
if px then
addEventHandler( 'onClientRender', getRootElement(),
function ()
dxDrawText( "Zape?nienie: "..zapelnienie, px + 1, py + scY/38, px + 1, py + 1, tocolor( 0, 0, 0, 255 ), 1, 'default-bold', 'center', 'center', false, false )
dxDrawText( "Zape?nienie: "..zapelnienie, px, py + scY/38, px, py, tocolor( 99, 99, 99, 255 ), 1, 'default-bold', 'center', 'center', false, false )
end )
end
end
end
end
end
end
end
end
end
addEventHandler( "onClientVehicleEnter", getRootElement(), renders )
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