WolfPire Posted September 25, 2012 Share Posted September 25, 2012 So i want to make my own sytstem of flags... Showing the image of where the player lives... I'm just 1 step to do this... But there's a problem... Here's the 2 codes: loc_s.lua (Server) exports.scoreboard:addScoreboardColumn('Location') function addLoc() local Loc = exports.admin:getPlayerCountry ( source ) if Loc then setElementData(source,"Location",":flags/"..Loc..".png", true) else setElementData(source,"Location","N/A", true) end end addEventHandler("onPlayerJoin",root, addLoc) Edit in Line 705 on dxScoreboard_client (Client) elseif column.name == "Location" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) else So here's the problem.... Whenever i start the scripts... Flags won't show... Just a blank space and there's an error that says: "ERROR: scoreboard/dxscoreboard_client.lua:705: dxDrawImage can't load file" And i don't know whether the error lay's into my script or the dxScoreboard... Help would be appreciated. Thanks in advance. Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 Do you have a resource called flags? Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 Do you have a resource called flags? Not really, the flags are all in a resource called "ENLLoc" Inside that folder there's a folder called "flags" where the flags are allocated. Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 (edited) ok, try this: exports.scoreboard:addScoreboardColumn('Location') function addLoc() local Loc = exports.admin:getPlayerCountry ( source ) if Loc then outputChatBox(Loc) setElementData(source,"Location",":ENLLoc/flags/"..string.lower(Loc)..".png", true) else setElementData(source,"Location","N/A", true) end end addEventHandler("onPlayerJoin",root, addLoc) Edited September 25, 2012 by Guest Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 ok, try this:exports.scoreboard:addScoreboardColumn('Location') function addLoc() local Loc = exports.admin:getPlayerCountry ( source ) if Loc then setElementData(source,"Location",":ENLLoc/flags/"..Loc..".png", true) else setElementData(source,"Location","N/A", true) end end addEventHandler("onPlayerJoin",root, addLoc) Same error outputs.... I'm guessing the export is returning an uppercase code? Because the flags are lowercase'd. Dunno if that'll interfere in anyway... Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 ok, copy the code again Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 ok, copy the code again Noticed you added an "outputChatBox", works perfectly... Still the same error... My flag is not in the folder as i'm Venezuelan, but it should atleast show "N/A" but neh... Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 ok, and for the dxscoreboard, try this: elseif column.name == "Location" then if not dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) then dxDrawText(content,topX+theX, y+s(1), 16, 11,cWhite,1,"default","left","top",false,false,drawOverGUI) end else Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 (edited) ok, and for the dxscoreboard, try this: elseif column.name == "Location" then if not dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) then dxDrawText(content,topX+theX, y+s(1), 16, 11,cWhite,1,"default","left","top",false,false,drawOverGUI) end else The error still persists... I added more flags, including my country's one... So here... This is what it looks like now Dx I'm still thinking it's because of the upper-case/lower-case problem~ EDIT: Wait what? A player entered the server and worked for him/her ? o_o EDIT2: Silly me forgot to add to meta... Edited September 25, 2012 by Guest Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 I'm not sure what to say... ok, try lower-casing the resource name, actually, post screenshots of you going to the folder with the flags please Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 I'm not sure what to say...ok, try lower-casing the resource name, actually, post screenshots of you going to the folder with the flags please Is there anyway to add all the flags to meta? (I got most, but new flags were added and idk which) Without having to copy one by one? Link to comment
Jaysds1 Posted September 25, 2012 Share Posted September 25, 2012 well, you could make a system, but it's just going to be a waste of time other than that, no Link to comment
WolfPire Posted September 25, 2012 Author Share Posted September 25, 2012 well, you could make a system, but it's just going to be a waste of timeother than that, no It should be working now then... Thanks for the help man I really appreciate it! 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