Jump to content

Not Showing Texts.


Recommended Posts

Hi Guys..

I need help with this script.

I dont know what is wrong in this script,its not showing texts only showing image..

Sorry for my English..

here code:

local name, author, lastTimePlayed, playedCount, modename 
local startTick 
local month = {"January","February","March","April","May","June","Juli","August","September","October","November","December"} 
local screenWidth, screenHeight = guiGetScreenSize() 
local endPosition = screenHeight-140 
local moveback = false 
  
function timestampToDate(stamp) 
    local time = getRealTime(stamp) 
    return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) 
end 
  
function handleMapInfo(mapInfo) 
    name            = mapInfo.name or "Unknown" 
    author          = mapInfo.author or "Unknown" 
    lastTimePlayed  = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" 
    playedCount     = tostring(mapInfo.playedCount or "Unknown") 
    modename        = mapInfo.modename ~= "Destruction derby" and mapInfo.modename or "Destruction derby" 
    position        = screenHeight+90 
    movePosition    = 5 
    tickCount       = 400 
    moveback        = false 
    alpha           = 0 
    addEventHandler("onClientRender",getRootElement(),drawMapInfo) 
end 
addEvent("onClientMapStarting",true) 
addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) 
  
function drawMapInfo () 
    if position == endPosition then 
        if tickCount == 0 then 
            moveback = true 
        end 
        tickCount = tickCount-1 
        movePosition = 0 
    end 
    if position >= screenHeight+91 then 
        removeEventHandler("onClientRender",getRootElement(),drawMapInfo) 
    end 
    if moveback then 
        movePosition = -2.5 
        alpha = alpha - 10 
    end 
    alpha = alpha + 5 
    if alpha > 255 then 
        alpha = 255 
    elseif alpha < 0 then 
        alpha = 0 
    end 
    local heighResize = dxGetFontHeight(1.15, "default-bold") 
    local widthRezise1 = dxGetTextWidth("Map - "..name,1.15,"default-bold") 
    local widthRezise2 = dxGetTextWidth("Lasttime played - "..lastTimePlayed,1.15,"default-bold") 
    local widthRezise3 = dxGetTextWidth("By - "..author,1.15,"default-bold") 
    if widthRezise1 > widthRezise2 and widthRezise1 > widthRezise3 then 
        widthRezise = widthRezise1 
    elseif  widthRezise2 > widthRezise1 and widthRezise2 > widthRezise3 then 
        widthRezise = widthRezise2 
    elseif  widthRezise3 > widthRezise1 and widthRezise3 > widthRezise2 then 
        widthRezise = widthRezise3 
    end 
    dxDrawImage(screenWidth/2-widthRezise/2-8,position-movePosition-(heighResize-3),widthRezise+16,140+heighResize, "img/bgr.png",0,0,0,tocolor(200,200,200,alpha)) 
    dxDrawingColorText ( "#FF9900Map - #FFFFFF"..name,screenWidth/2,position-movePosition+heighResize,screenWidth/2,position-movePosition+heighResize, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900By - #FFFFFF"..author,screenWidth/2,position-movePosition+heighResize*2,screenWidth/2,position-movePosition+heighResize*2, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Played - #FFFFFF"..playedCount.." times",screenWidth/2,position-movePosition+heighResize*3,screenWidth/2,position-movePosition+heighResize*3, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Lasttime played - #FFFFFF"..lastTimePlayed,screenWidth/2,position-movePosition+heighResize*4,screenWidth/2,position-movePosition+heighResize*4, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Mode - #FFFFFF"..modename,screenWidth/2,position-movePosition+heighResize*5,screenWidth/2,position-movePosition+heighResize*5, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    position = position - movePosition 
end 
  
  
function dxDrawingColorText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) 
end 
  
function drawMyText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top , right+scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top+scale , right+scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top+scale , right, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top+scale , right-scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top , right-scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top-scale , right-scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top-scale , right, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top-scale , right+scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top , right, bottom, color,scale,font,alignX,alignY) 
end 

Link to comment
Hi Guys..

I need help with this script.

I dont know what is wrong in this script,its not showing texts only showing image..

Sorry for my English..

here code:

local name, author, lastTimePlayed, playedCount, modename 
local startTick 
local month = {"January","February","March","April","May","June","Juli","August","September","October","November","December"} 
local screenWidth, screenHeight = guiGetScreenSize() 
local endPosition = screenHeight-140 
local moveback = false 
  
function timestampToDate(stamp) 
    local time = getRealTime(stamp) 
    return string.format("%d %s %02d:%02d",time.monthday,month[time.month+1],time.hour,time.minute) 
end 
  
function handleMapInfo(mapInfo) 
    name            = mapInfo.name or "Unknown" 
    author          = mapInfo.author or "Unknown" 
    lastTimePlayed  = timestampToDate(mapInfo.lastTimePlayed) or "Unknown" 
    playedCount     = tostring(mapInfo.playedCount or "Unknown") 
    modename        = mapInfo.modename ~= "Destruction derby" and mapInfo.modename or "Destruction derby" 
    position        = screenHeight+90 
    movePosition    = 5 
    tickCount       = 400 
    moveback        = false 
    alpha           = 0 
    addEventHandler("onClientRender",getRootElement(),drawMapInfo) 
end 
addEvent("onClientMapStarting",true) 
addEventHandler("onClientMapStarting",getRootElement(),handleMapInfo) 
  
function drawMapInfo () 
    if position == endPosition then 
        if tickCount == 0 then 
            moveback = true 
        end 
        tickCount = tickCount-1 
        movePosition = 0 
    end 
    if position >= screenHeight+91 then 
        removeEventHandler("onClientRender",getRootElement(),drawMapInfo) 
    end 
    if moveback then 
        movePosition = -2.5 
        alpha = alpha - 10 
    end 
    alpha = alpha + 5 
    if alpha > 255 then 
        alpha = 255 
    elseif alpha < 0 then 
        alpha = 0 
    end 
    local heighResize = dxGetFontHeight(1.15, "default-bold") 
    local widthRezise1 = dxGetTextWidth("Map - "..name,1.15,"default-bold") 
    local widthRezise2 = dxGetTextWidth("Lasttime played - "..lastTimePlayed,1.15,"default-bold") 
    local widthRezise3 = dxGetTextWidth("By - "..author,1.15,"default-bold") 
    if widthRezise1 > widthRezise2 and widthRezise1 > widthRezise3 then 
        widthRezise = widthRezise1 
    elseif  widthRezise2 > widthRezise1 and widthRezise2 > widthRezise3 then 
        widthRezise = widthRezise2 
    elseif  widthRezise3 > widthRezise1 and widthRezise3 > widthRezise2 then 
        widthRezise = widthRezise3 
    end 
    dxDrawImage(screenWidth/2-widthRezise/2-8,position-movePosition-(heighResize-3),widthRezise+16,140+heighResize, "img/bgr.png",0,0,0,tocolor(200,200,200,alpha)) 
    dxDrawingColorText ( "#FF9900Map - #FFFFFF"..name,screenWidth/2,position-movePosition+heighResize,screenWidth/2,position-movePosition+heighResize, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900By - #FFFFFF"..author,screenWidth/2,position-movePosition+heighResize*2,screenWidth/2,position-movePosition+heighResize*2, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Played - #FFFFFF"..playedCount.." times",screenWidth/2,position-movePosition+heighResize*3,screenWidth/2,position-movePosition+heighResize*3, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Lasttime played - #FFFFFF"..lastTimePlayed,screenWidth/2,position-movePosition+heighResize*4,screenWidth/2,position-movePosition+heighResize*4, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    dxDrawingColorText ( "#FF9900Mode - #FFFFFF"..modename,screenWidth/2,position-movePosition+heighResize*5,screenWidth/2,position-movePosition+heighResize*5, tocolor(255,255,255,alpha), alpha, 1.15, "default-bold", "center", "bottom", false, false, false ) 
    position = position - movePosition 
end 
  
  
function dxDrawingColorText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) 
end 
  
function drawMyText ( text,left,top,right,bottom,color,scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top , right+scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top+scale , right+scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top+scale , right, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top+scale , right-scale, bottom+scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top , right-scale, bottom, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left-scale, top-scale , right-scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top-scale , right, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left+scale, top-scale , right+scale, bottom-scale, tocolor(30,30,30,Alpha),scale,font,alignX,alignY) 
    dxDrawingColorText ( text, left, top , right, bottom, color,scale,font,alignX,alignY) 
end 

Are you kidding us?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...