boro Posted January 9, 2013 Posted January 9, 2013 Hi all i make rank score but it doesn't work, check it , and please help me. TY rank server function scoreLevel () local account = getPlayerAccount(source) local level = getAccountData(account, "rank") local nameimage = "level" if rank== false then setElementData(source, "Rank", "level0.png") end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) scoreboard client elseif column.name == "Rank" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI )
myonlake Posted January 9, 2013 Posted January 9, 2013 Perhaps... Server-side (rank) addEventHandler("onPlayerSpawn", root, function() local account = getPlayerAccount(source) if not isGuestAccount(account) then if not getAccountData(account, "Rank") or tonumber(getAccountData(account, "Rank")) == 0 then setElementData(source, "Rank", "level0.png") else setElementData(source, "Rank", "level" .. tonumber(getAccountData(account, "Rank")) .. ".png") end else setElementData(source, "Rank", "level0.png") end end ) Client-side (scoreboard) elseif column.name == "Rank" then if getElementData(localPlayer, "Rank") then dxDrawImage(topX+theX, y+s(1), 16, 11, getElementData(localPlayer, "Rank"), 0, 0, 0, cWhite, drawOverGUI) end end
boro Posted January 9, 2013 Author Posted January 9, 2013 myonlake, scoreboard now not open when i press tab local partOfName = string.sub( playerName, firstCodePos, secondCodePos ) local textLength = dxGetTextWidth( partOfName, fontscale(contentFont, s(1)), contentFont ) dxDrawText( partOfName, xPos+s(1), y+s(1), topX+x+s(1+column.width), y+s(11) +dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( partOfName, xPos, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale (contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) xPos = xPos + textLength end elseif column.name == "Rank" then if getElementData(localPlayer, "Rank") then dxDrawImage(topX+theX, y+s(1), 16, 11, getElementData(localPlayer, "Rank"), 0, 0, 0, cWhite, drawOverGUI) end end else dxDrawText( content, topX+theX+s(1), y+s(1), topX+x+s(1+column.width), y+s(11) +dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( 0, 0, 0, a or 255 ), fontscale(contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) dxDrawText( content, topX+theX, y, topX+x+s(column.width), y+dxGetFontHeight( fontscale(contentFont, scoreboardScale), contentFont ), tocolor( r or 255, g or 255, b or 255, a or 255 ), fontscale (contentFont, s(1)), contentFont, "left", "top", true, false, drawOverGUI ) end end x = x + s(column.width + 10) end end local font = iif( element and isElement( element ) and getElementType( element ) == "team", teamHeaderFont, contentFont ) y = y + dxGetFontHeight( fontscale(font, scoreboardScale), font ) index = index + 1 end index = 1 end end end
HunT Posted January 9, 2013 Posted January 9, 2013 Search in my old post : viewtopic.php?f=91&t=38195&hilit=Rank+image
boro Posted January 9, 2013 Author Posted January 9, 2013 yes i make it be your script but this don't work
boro Posted January 9, 2013 Author Posted January 9, 2013 Hunterix here is my full script check it http://www.ulozto.net/xajJ6GM/rank-zip
HunT Posted January 9, 2013 Posted January 9, 2013 i no need download Anyway : Server Side exports.scoreboard:addScoreboardColumn('Rank',getRootElement(),1,40,'Rank') function scoreLevel () local account = getPlayerAccount(source) local level = getAccountData(account, "rank") local nameimage = "level" if isGuestAccount ( account ) then setElementData(source, "Rank",":ProRank\\Ranks\\level0.png") else setElementData(source, "Rank", tostring(":ProRank\\Ranks\\"..nameimage..level..".png" )) end end addEventHandler("onPlayerSpawn", getRootElement(), scoreLevel) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Rank", getRootElement(), 1, 40) end ) my rank resource name is "ProRank" and folder with images "Ranks" = (":ProRank\\Ranks\\"..nameimage..level..".png" )) if u want use other name of folder dont forget edit the patch ---------------------------------------------------------------------- dxscoreboard_client.lua after : xPos = xPos + textLength (string 692) elseif column.name == "Rank" then dxDrawImage( topX+theX, y-s(0.5), 30, 30, content, 0, 0, 0, cWhite, drawOverGUI )
-.Paradox.- Posted August 7, 2013 Posted August 7, 2013 I tried that too and it keep showing :experience\\ranks\\"..nameimage..Level.." etc help please
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