orcun99 Posted February 13, 2018 Share Posted February 13, 2018 (edited) I add this code in scoreboard dxscoreboard_client.lua line 705 elseif column.name == "Home" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) and my script exports.a:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) but don't work exports.a:addScoreboardColumn('Home') a = my score board script Edited February 13, 2018 by orcun99 Link to comment
MIKI785 Posted February 13, 2018 Share Posted February 13, 2018 (edited) It really doesn't work that way, the scoreboard doesn't magically know that it's supposed to draw an image. Do something like this instead: exports.a:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..flag..".png"}) else flag = "N/A" --What's this for? It's never used. end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) Edited February 13, 2018 by MIKI785 Link to comment
orcun99 Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) 12 minutes ago, MIKI785 said: It really doesn't work that way, the scoreboard doesn't magically know that it's supposed to draw an image. Do something like this instead: exports.a:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..flag..".png"}) else flag = "N/A" --What's this for? It's never used. end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) still don't work pic scoreboard: https://prntscr.com/ie8b8i no debug and my flags localtion is : C:\Users\whoami\Desktop\mta server 25.11.2017\mods\deathmatch\resources\[admin]\admin\client\images\flags Edited February 13, 2018 by orcun99 Link to comment
TorNix~|nR Posted February 13, 2018 Share Posted February 13, 2018 Use /debugscript 3, and tell us Use this server-side on your script function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) add it on admin panel, use resource."yourfoldername" and use this scoreboard code elseif column.name == "Country" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) That should 100% work, because I tested it PS: do not forget to add this on scoreboard exports { ["name"] = "Country", ["width"] = 16, ["friendlyName"] = "Country", ["priority"] = 1 }, --add your placement instead of "1" Tell me if you got a problem Link to comment
orcun99 Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) 1 hour ago, TorNix~|nR said: Use /debugscript 3, and tell us Use this server-side on your script function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) add it on admin panel, use resource."yourfoldername" and use this scoreboard code elseif column.name == "Country" then dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) That should 100% work, because I tested it PS: do not forget to add this on scoreboard exports { ["name"] = "Country", ["width"] = 16, ["friendlyName"] = "Country", ["priority"] = 1 }, --add your placement instead of "1" Tell me if you got a problem so thanks for your helps but I still have problem so you can see myscript name : "ulke" acl is okay? : http://prntscr.com/ie9kjc and ulke: server side exports.a:addScoreboardColumn('Country') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Country",":admin/client/images/flags/"..flag..".png") else flag = "N/A" end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) there is no client side meta: <meta> <info author="x" name="Country Script" version="1.0.0" type="script"/> <script src="server.lua" type="server" /> </meta> this is dxscoreboard_client.lua : http://prntscr.com/ie9mba and exports: https://prnt.sc/ie9o7w ingame and debugscript3 there no error about this script: https://prnt.sc/ie9p07 still can't see flag what's wrong Edited February 13, 2018 by orcun99 Link to comment
MIKI785 Posted February 13, 2018 Share Posted February 13, 2018 The file names are lower case. exports.a:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..string.lower(flag)..".png"}) else flag = "N/A" --What's this for? It's never used. end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) Link to comment
orcun99 Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) 18 minutes ago, MIKI785 said: The file names are lower case. exports.a:addScoreboardColumn('Home') function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..string.lower(flag)..".png"}) else flag = "N/A" --What's this for? It's never used. end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) already all lower case I send u private message can u check ? Edited February 13, 2018 by orcun99 Link to comment
ÆBKV Posted February 13, 2018 Share Posted February 13, 2018 else setElementData(source,"Home","N/A") 1 Link to comment
orcun99 Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..string.lower(flag)..".png"}) outputChatBox("1") else setElementData(source,"Home","N/A") outputChatBox("2") end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) when i reconnect message 2 ... and N/A don't work I think problem : exports.admin:getPlayerCountry ( source ) Edited February 13, 2018 by orcun99 Link to comment
ÆBKV Posted February 13, 2018 Share Posted February 13, 2018 wait 19 minutes ago, orcun99 said: function showcountry() local flag = exports.admin:getPlayerCountry ( source ) if flag then setElementData(source,"Home", {type = "image", src = ":admin/client/images/flags/"..string.lower(flag)..".png"}) outputChatBox("1") else setElementData(source,"Home","N/A") outputChatBox("2") end end addEventHandler("onPlayerJoin",getRootElement(),showcountry) when i reconnect message 2 ... and N/A don't work I think problem : exports.admin:getPlayerCountry ( source ) and no that's not the problem Link to comment
orcun99 Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) 15 minutes ago, ÆBKV said: wait and no that's not the problem uh there is debug : dxscoreboard_client.lua:699 badargument dxdrawImage [Expected material at argument 5 ,got table] line699: dxDrawImage( topX+theX, y+s(1), 16, 11, content, 0, 0, 0, cWhite, drawOverGUI ) Edited February 13, 2018 by orcun99 Link to comment
TorNix~|nR Posted February 13, 2018 Share Posted February 13, 2018 Try to download the simple dx scoreboard from the community and make sure the admin panel file is named admin inside [admin] Like I told you, the code I gave you is working, try and tell me Link to comment
ÆBKV Posted February 13, 2018 Share Posted February 13, 2018 (edited) dxDrawImage(topX+theX,y+s(1),16,11,content,0,0,0,cWhite,drawOverGUI) The problem here is that probably nobody knows in which line this belongs. Edited February 13, 2018 by ÆBKV Link to comment
orcun99 Posted February 14, 2018 Author Share Posted February 14, 2018 9 hours ago, ÆBKV said: dxDrawImage(topX+theX,y+s(1),16,11,content,0,0,0,cWhite,drawOverGUI) The problem here is that probably nobody knows in which line this belongs. https://prnt.sc/ie9mba wrong? Link to comment
ÆBKV Posted February 14, 2018 Share Posted February 14, 2018 (edited) 7 hours ago, orcun99 said: https://prnt.sc/ie9mba wrong? Yes it's wrong, you can't start with "elseif" and use "else". Use "if" instead of "elseif". And I think the flags are only visible if your server is hosted. I'm not sure but that can probably be the problem. Edited February 14, 2018 by ÆBKV 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