Jump to content

Script Error


Recommended Posts

Posted

Hello, its me again, i have this script

 exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'  ') 
function scoreLevel () 
    local account = getPlayerAccount(source) 
    local Level = getAccountData(account, "LV") 
    if isGuestAccount ( account ) then 
        setElementData(source, "Rank",":experience\\ranks\\lvl_0.png") 
    else 
        setElementData(source, "Rank", tostring(":experience\\ranks\\lvl_"..Level..".png" ))                                       
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) 
addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() 
        call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) 
    end 
) 

& im trying to add a dxImage to the screen but wont work

    if Level and fileExists ( ":experience\\ranks\\lvl_"..Level..".png" ) then 
    size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") 
    dxDrawImage((557/1024)*sWidth, (666/768)*sHeight, size, size, ":experience\\ranks\\lvl_"..Level..".png") 
    end 

When i do /debugscript 3 it show this error

ERROR: newhud/hud.lua:59: attempt to concatenate local 'Level' (a boolean value) 

Can somebody tell me what i have to do?

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

check Level variable!. You set that variable as local in the function scoreLevel. remove local keyword and it will work.

i guess.

there are two kinds of people: those who know C++ and those who don´t. .)

Posted

Thanks for you're help...but still same error, help please.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Please help

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

remove ( call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) ) and change all ":experience\\ranks\\lvl_"..Level..".png" to ":experience/ranks/lvl_"..Level..".png"

Omerta Roleplay

Posted

((not tested))

Server:

exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'  ') 
function scoreLevel () 
    local account = getPlayerAccount(source) 
    Level = getAccountData(account, "LV") 
    if isGuestAccount ( account ) then 
        setElementData(source, "Rank", 0) 
    else 
        setElementData(source, "Rank", tonumber( Level ))                                       
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) 

Client:

local Level = tonumber ( getElementData ( localPlayer, "Rank" ) ) 
if Level and fileExists ( ":experience/ranks/lvl_"..tostring ( Level )..".png" ) then 
    size = dxGetFontHeight((0.7/1366)*sWidth, "bankgothic") 
    dxDrawImage((557/1024)*sWidth, (666/768)*sHeight, size, size, ":experience/ranks/lvl_"..tostring ( Level )..".png") 
end 

Posted

Crashed my scoreboard Error dxDrawImage [Can't load file]

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

No it was working, it show ranks in scoreboard, but when i add yours my scoreboard crash

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Help please

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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...