Jump to content

HUD


itHyperoX

Recommended Posts

Hi guys. Today i made a hud, everything works perfect, but i got some debugscript error, i tried to fix it, but still flooding when i join.

The Debug Error:

 sourceC.lua:295: attempt to compare boolen with number [DUP X899]

 

here is the script:

local playerMoney = getElementData(localPlayer,"account:handCash")
local messages =  { }
addEventHandler ( "onClientRender", root, function ( )
    local tick = getTickCount ( )
    if ( playerMoney ~= getElementData(localPlayer,"account:handCash") ) then
        local pM = getElementData(localPlayer,"account:handCash")
        if ( pM > playerMoney ) then  ---------------------------------------- Line 295.
            local diff = pM - playerMoney
            table.insert ( messages, { diff, true, tick + 5000, 180 } )
        else
            local diff = playerMoney - pM
            table.insert ( messages, { diff, false, tick + 5000, 180 } )
        end
        playerMoney = pM
    end
    if ( #messages > 3 ) then
        table.remove ( messages, 1 )
    end
    for index, data in ipairs ( messages ) do
        local v1 = data[1]
        local v2 = data[2]
        local v3 = data[3]
        local v4 = data[4]
        if ( v2 ) then
        dxDrawText("+ $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) - 1, (screenH * 0.2241)-(index*-25) - 1, (screenW * 0.9385) - 1, (screenH * 0.2519)-(index*-25) - 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("+ $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) + 1, (screenH * 0.2241)-(index*-25) - 1, (screenW * 0.9385) + 1, (screenH * 0.2519)-(index*-25) - 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("+ $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) - 1, (screenH * 0.2241)-(index*-25) + 1, (screenW * 0.9385) - 1, (screenH * 0.2519)-(index*-25) + 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("+ $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) + 1, (screenH * 0.2241)-(index*-25) + 1, (screenW * 0.9385) + 1, (screenH * 0.2519)-(index*-25) + 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("#FFA500+ $"..exports.wangExport:formatMoney(v1), screenW * 0.8474, screenH * 0.2241-(index*-25), screenW * 0.9385, screenH * 0.2519-(index*-25), tocolor(255, 255, 255, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        else
        dxDrawText("- $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) - 1, (screenH * 0.2241)-(index*-25) - 1, (screenW * 0.9385) - 1, (screenH * 0.2519)-(index*-25) - 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("- $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) + 1, (screenH * 0.2241)-(index*-25) - 1, (screenW * 0.9385) + 1, (screenH * 0.2519)-(index*-25) - 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("- $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) - 1, (screenH * 0.2241)-(index*-25) + 1, (screenW * 0.9385) - 1, (screenH * 0.2519)-(index*-25) + 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("- $"..exports.wangExport:formatMoney(v1), (screenW * 0.8474) + 1, (screenH * 0.2241)-(index*-25) + 1, (screenW * 0.9385) + 1, (screenH * 0.2519)-(index*-25) + 1, tocolor(0, 0, 0, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        dxDrawText("#D75959- $"..exports.wangExport:formatMoney(v1), screenW * 0.8474, screenH * 0.2241-(index*-25), screenW * 0.9385, screenH * 0.2519-(index*-25), tocolor(255, 255, 255, v4+75), 1.00, "pricedown", "left", "top", false, false, false, true, false)
        end
        if ( tick >= v3 ) then
            messages[index][4] = v4-2
            if ( v4 <= 25 ) then
                table.remove ( messages, index )
            end
        end
    end
end )

Thanks any help!

Edited by TheMOG
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...