Jump to content

[Solved] Rank Numbers To Images


HunT

Recommended Posts

Posted (edited)

Hi all :fadein:

i want edit the scoreboard rank numbers with images but IDK how.i need only the easy example.

Type (idk) : getAccountData ranknumber 1 = rank1.png

getAccountData ranknumber 2 = rank2.png

i have this for scoreboard rank numbers

  
exports.scoreboard:addScoreboardColumn('Rank') 
  
function scoreLevel () 
local account = getPlayerAccount(source) 
local level = getAccountData(account, "rank") 
    if rank== false then 
        setElementData ( source, "Rank", "0" ) --Show the image for guest players  
    else 
        setElementData ( source, "Rank", level ) --Show the images rank 
    end 
addEventHandler ( "onPlayerSpawn", getRootElement(), scoreLevel ) 

Tnx For Help :|

Edited by Guest
  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

hmmm yes i see this image thing on a server but i don't know how you can do it but i am searching to i wanna do this whit country flags i read somewhere that you need to edit the scoreboard maybe is an easier way i don't know

Posted
  
exports.scoreboard:addScoreboardColumn('Rank') 
  
function scoreLevel ( thePlayer ) 
local level = getAccountData( thePlayer, "rank") 
    if rank== false then 
        setElementData ( source, "rank", "0" ) --Show the image for guest players  
    else 
        setElementData ( source, "rank", level ) --Show the images rank 
    end 
addEventHandler ( "onPlayerSpawn", getRootElement(), scoreLevel ) 
  
function showTheRank() 
local level = getElementData ( thePlayer , "rank" ) 
dxDrawText( ".. level ..",sx*(0.3568),sy*(0.8074),sx*(0.2203),sy*(0.130), tocolor ( 192,192,192,255 ), 1.15, "default-bold","left","top", false, false ,true ) 
end 
bindKey ("F2", "down", showTheRank)  

NOT TESTED!

EDIT: If you want to use images use

guiCreateStaticImage 
  
EXAMPLE 
guiCreateStaticImage( x, y, width , heigh, "name.png", false ) -- it hasn't any parents .. 
  
guiCreateStaticImage( x, y, width , heigh, "name.png", myGuiWindow ) -- It will be shown only if "myGuiWindow" is visibile  

Posted
  
exports.scoreboard:addScoreboardColumn('Rank') 
  
function scoreLevel ( thePlayer ) 
local level = getAccountData( thePlayer, "rank") 
    if rank== false then 
        setElementData ( source, "rank", "0" ) --Show the image for guest players  
    else 
        setElementData ( source, "rank", level ) --Show the images rank 
    end 
addEventHandler ( "onPlayerSpawn", getRootElement(), scoreLevel ) 
  
function showTheRank() 
local level = getElementData ( thePlayer , "rank" ) 
dxDrawText( ".. level ..",sx*(0.3568),sy*(0.8074),sx*(0.2203),sy*(0.130), tocolor ( 192,192,192,255 ), 1.15, "default-bold","left","top", false, false ,true ) 
end 
bindKey ("F2", "down", showTheRank)  

NOT TESTED!

EDIT: If you want to use images use

guiCreateStaticImage 
  
EXAMPLE 
guiCreateStaticImage( x, y, width , heigh, "name.png", false ) -- it hasn't any parents .. 
  
guiCreateStaticImage( x, y, width , heigh, "name.png", myGuiWindow ) -- It will be shown only if "myGuiWindow" is visibile  

Relax no need the test :mrgreen: Tnx Anyway

--------------------------------------------------------------------------

bandi94 @

Yep i have the script for png's country but is totaly different :| why call the png's in admin resource.

Sure i need the table Type:

local levels =

{ 1 = "level1.png",

2= "level2.png"

etc. . .

+

setElementData(source, "Rank", ":folder with images"..levels..".png")

Posted
  
Sure i need the table Type: 
  
local levels =  
{ 1 = "level1.png", 
 2= "level2.png" 
etc. . . 
  
+ 
  
setElementData(source, "Rank", ":folder with images".. levels ..".png") 

 

Actually , the levels are saved as numbers not as level1 and level2 and etc

So you can simply write

 

local levels = 
{ 1 = "1.png" 
2 = "2.png" 
... 
99 = "99.png" } 
  
setElementData(source, "rank", "images\".. levels ..".png")  
  
  
 

And don't forget that the element is "rank" not "Rank"

Good Luck :)

Posted

i Made this but no work (show the msg :| . . . ":Panel\\Rank in scoreboard and no the image )

exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),3,30,'Rank') 
  
levels = {  
    ["Rank/level1.png"] = 1, 
    ["Rank/level2.png"] = 2, 
    ["Rank/level3.png"] = 3 
}  
  
function scoreRank() 
        local account = getPlayerAccount(source) 
        livello  =  getAccountData(account, "rank") 
        if livello == false then 
    for i,v in pairs(levels) do 
             if livello  ==  i then 
                    end 
             end 
    end 
        setElementData(source, "Rank", ":Panel\\Rank\\"..livello..".png") 
    end 
addEventHandler('onPlayerSpawn',Root,scoreRank) 

Help Please :evil:

Posted
exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),3,30,'Rank') 
  
levels = {  
    ["Rank/1.png"] = 1, 
    ["Rank/2.png"] = 2, 
    ["Rank/3.png"] = 3 
}  
  
function scoreRank() 
        local account = getPlayerAccount(source) 
        livello  =  getAccountData(account, "rank") 
        if livello == false then 
    for i,v in pairs(levels) do 
             if livello  ==  i then 
                    end 
             end 
    end 
        setElementData(source, "Rank", ":Panel\\Rank\\".. livello ..".png") 
    end 
addEventHandler('onPlayerSpawn',Root,scoreRank) 

And rename the 3 files into 1 , 2 , and 3

The level is saved as "number" not as "level"

Posted
Are you a noob or something ?

Just try that script -.-'

GanJaRuleZ Tnx for reply but i want wait the Legendary Scripters :twisted:

Posted
  
exports.scoreboard:addScoreboardColumn('Rank') 
  
function scoreLevel () 
    local account = getPlayerAccount(source) 
    local level = getAccountData(account, "rank") 
    local nameimage = "level" 
    if rank== false then 
        setElementData(source, "Rank", "level0.png") --Show the image for guest players 
    else 
        setElementData(source, "Rank", tostring(nameimage .. level .. ".png" )) --Show the images rank 
                                        -- If you doesnt have image in your resource \/ 
                                        -- Try use ":Panel\\Rank\\"..nameimage..level..".png" 
    end 
end 
addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) 
  

Not tested.

Posted

Tnx now show the text level0.png and else level1.png but no the images,only text :|

errors nothing in debugscript 3

Anyway i have the "Rank" folder for images. (30x30)

and i test with

setElementData(source, "Rank", tostring(":Panel\\Rank\\"..nameimage .. level .. ".png" )) 

and

setElementData(source, "Rank", tostring(nameimage .. level .. ".png" )) 

Maybe no call the image (idk)

Posted

Omg you fucker, stop copying every feature from my server (check Andromeda Race/DD/DM :3 once they even copied nicknames of my clan members)

If you're that pro scripter then move your ass and modify scoreboard resource as I did. Nobody is going to do it for you.

Posted

Orange u are crazy?

in this days i play in Cod MW3 and i have this idea.

i want add the images rank from mw3 in my server

what copy sorry? . . . facepalm

Posted
what just happened?

I've got bad experience with him. A year ago his clan (?) has copied names of my clan (I don't know why did they do it). They were advertising their server where nobody played everyday. In this thread, he's going to copy one of unique features of my server (oh yeah, he's so pro that he can't do it himself).

Orange u are crazy?

in this days i play in Cod MW3 and i have this idea.

i want add the images rank from mw3 in my server

what copy sorry? . . . facepalm

Oh yeah, I've got rank icons from mw2. Don't you remember when you were copying every idea?

Posted
that's what I was thinking,

How are you gonna get the picture in the scoreboard?

Yep :|

images for orange :

148.png

149.png

150.png

Posted
what just happened?

I've got bad experience with him. A year ago his clan (?) has copied names of my clan (I don't know why did they do it). They were advertising their server where nobody played everyday. In this thread, he's going to copy one of unique features of my server (oh yeah, he's so pro that he can't do it himself).

Orange u are crazy?

in this days i play in Cod MW3 and i have this idea.

i want add the images rank from mw3 in my server

what copy sorry? . . . facepalm

Oh yeah, I've got rank icons from mw2. Don't you remember when you were copying every idea?

No Comment.

Listen i have 20 years ago and i no want spend the time with the kids.

1.i never enter in u server

2.my name is hunterix ever

3.maybe the kinds banned in my server enter in u server . ..idk :|

4. i have 20 years (again)

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