HunT Posted December 27, 2011 Share Posted December 27, 2011 (edited) Hi all 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 December 29, 2011 by Guest Link to comment
bandi94 Posted December 27, 2011 Share Posted December 27, 2011 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 Link to comment
GanJaRuleZ Posted December 27, 2011 Share Posted December 27, 2011 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 Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 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 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") Link to comment
GanJaRuleZ Posted December 27, 2011 Share Posted December 27, 2011 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 Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 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 Link to comment
GanJaRuleZ Posted December 27, 2011 Share Posted December 27, 2011 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" Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 Who Help Me Please. Link to comment
GanJaRuleZ Posted December 27, 2011 Share Posted December 27, 2011 Are you a noob or something ? Just try that script -.-' Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 Are you a noob or something ?Just try that script -.-' GanJaRuleZ Tnx for reply but i want wait the Legendary Scripters Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 table.sort What . . . Link to comment
GanJaRuleZ Posted December 27, 2011 Share Posted December 27, 2011 Use that function -.-' Link to comment
Cadu12 Posted December 27, 2011 Share Posted December 27, 2011 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. Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 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) Link to comment
Cadu12 Posted December 27, 2011 Share Posted December 27, 2011 I tinhk line 8 is wrong. Remove it Edit: https://wiki.multitheftauto.com/wiki/IsGuestAccount Link to comment
Evil-Cod3r Posted December 27, 2011 Share Posted December 27, 2011 i think if (rank) == false then Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 I tinhk line 8 is wrong. Remove itEdit: https://wiki.multitheftauto.com/wiki/IsGuestAccount Cadu12 u script work fine i test with rank 0 and show level0.png and rank 1 show the level1.png The problem maybe is for call the png in scoreboard Link to comment
Jaysds1 Posted December 27, 2011 Share Posted December 27, 2011 that's what I was thinking, How are you gonna get the picture in the scoreboard? Link to comment
Orange Posted December 27, 2011 Share Posted December 27, 2011 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. Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 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 Link to comment
Orange Posted December 27, 2011 Share Posted December 27, 2011 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? Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 that's what I was thinking,How are you gonna get the picture in the scoreboard? Yep images for orange : Link to comment
HunT Posted December 27, 2011 Author Share Posted December 27, 2011 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) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now