So I did this:
local rootElement = getRootElement()
local screenWidth, screenHeight = guiGetScreenSize() -- Get the screen resolution
function createText ( )
local playerX, playerY, playerZ = getElementPosition( getLocalPlayer() )
dxDrawText(modeName(playerData.mode), 44, screenHeight-41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, "pricedown" )
dxDrawText(modeName(playerData.mode), 44, screenHeight-43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" )
end
function HandleTheRendering()
addEventHandler("onClientRender",rootElement, createText) -- keep the text visible with onClientRender.
end
addEventHandler("onClientResourceStart",rootElement, HandleTheRendering)
But it's not doing anything, i'm guessing that the script has to be defined as a client script?