local screenWidth, screenHeight = guiGetScreenSize ( )
local scroll = guiCreateScrollBar(15,81,24,245,false,false)
local scroll2 = guiCreateScrollBar(45,81,24,245,false,false)
local scroll3 = guiCreateScrollBar(75,81,24,245,false,false)
local R, G, B = 0, 0, 0
addEventHandler( "onClientGUIScroll", root,
function()
local ScrollValue = guiScrollBarGetScrollPosition ( source )
if source == scroll then
R = (255/100) * ScrollValue
elseif source == scroll2 then
G = (255/100) * ScrollValue
elseif source == scroll3 then
B = (255/100) * ScrollValue
end
end)
function createText ( )
local playerX, playerY, playerZ = getElementPosition ( localPlayer ) -- Get our player's coordinates.
local playerZoneName = getZoneName ( playerX, playerY, playerZ ) -- Get name of the zone the player is in.
-- Draw zone name text's shadow.
dxDrawText ( playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" )
-- Draw zone name text.
dxDrawText ( playerZoneName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( R, G, B, 255 ), 1, "pricedown" )
end
function HandleTheRendering ( )
addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender.
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )
@+Source|>