1LoL1 Posted November 3, 2015 Share Posted November 3, 2015 Hello, why this my code not work? 0 errors 0 warning i see only AR but image not AR = Argentina i want to: AR please can anyone help me ? local countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="SK", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } exports.scoreboard:addScoreboardColumn ( "Country", getRootElement(), 9, 0.07 ) function wtf () local countryCode = exports.admin:getPlayerCountry(source) if countryCode and countryNames[countryCode] then local name = countryNames[countryCode] setElementData(source, "Country", name) else setElementData(source", Country", "N/A") end Link to comment
SpecT Posted November 3, 2015 Share Posted November 3, 2015 Check the admin resource if it has AR.png . If it is missing download the latest Admin Panel resource from here: https://mirror.multitheftauto.com/mtasa/resources/mtasa-resources-latest.zip and replace the files. Link to comment
1LoL1 Posted November 3, 2015 Author Share Posted November 3, 2015 I have latest but again i see only AR but not Image Link to comment
SpecT Posted November 3, 2015 Share Posted November 3, 2015 I have latest but again i see only AR but not Image Have you checked the meta.xml of the admin resource and the flags folder ? Oh and are you sure that your scoreboard is made to draw the flag ? Link to comment
1LoL1 Posted November 3, 2015 Author Share Posted November 3, 2015 I have latest but again i see only AR but not Image Have you checked the meta.xml of the admin resource and the flags folder ? Oh and are you sure that your scoreboard is made to draw the flag ? i used this code and work all so why not work my code? exports.scoreboard:addScoreboardColumn('Home') addEventHandler("onPlayerJoin", root, function () local country = exports.admin:getPlayerCountry(source) local flag = country and ":admin/client/images/flags/"..country..".png" setElementData(source, "Home", flag and {type = "image", src = flag, height = 12, width = 16} or "N/A") end) Link to comment
SpecT Posted November 3, 2015 Share Posted November 3, 2015 Then just replace the setElementData function. local countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="SK", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } exports.scoreboard:addScoreboardColumn ( "Country", getRootElement(), 9, 0.07 ) function wtf () local countryCode = exports.admin:getPlayerCountry(source) if countryCode and countryNames[countryCode] then local name = countryNames[countryCode] local flag = name and ":admin/client/images/flags/"..name..".png" setElementData(source, "Country", flag and {type = "image", src = flag, height = 12, width = 16}) else Link to comment
1LoL1 Posted November 3, 2015 Author Share Posted November 3, 2015 This work on 50% i don't see countryNames only image i see now: i need: Link to comment
SpecT Posted November 4, 2015 Share Posted November 4, 2015 (edited) This should work. local countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="SK", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } exports.scoreboard:addScoreboardColumn ( "Country", getRootElement(), 9, 0.07 ) function wtf () local countryCode = exports.admin:getPlayerCountry(source) if countryCode and countryNames[countryCode] then local name = countryNames[countryCode] local flag = name and ":admin/client/images/flags/"..countryCode ..".png" setElementData(source, "Country", flag and {type = "image", src = flag, height = 12, width = 16} or "N/A") else Edited November 4, 2015 by Guest Link to comment
1LoL1 Posted November 4, 2015 Author Share Posted November 4, 2015 Not work now i see: only Image Link to comment
SpecT Posted November 4, 2015 Share Posted November 4, 2015 Not work now i see:only Image Hm .. thats weird. I edited the code above, replace your code with it and tell me if there are any errors in the debugscript. Link to comment
1LoL1 Posted November 4, 2015 Author Share Posted November 4, 2015 Not work now i see:only Image Hm .. thats weird. I edited the code above, replace your code with it and tell me if there are any errors in the debugscript. Again i see only image Link to comment
SpecT Posted November 4, 2015 Share Posted November 4, 2015 Not work now i see:only Image Hm .. thats weird. I edited the code above, replace your code with it and tell me if there are any errors in the debugscript. Again i see only image Well by that logic the code that you said works fine actually it doesn't work. I made it to set the element data just like the working script just using full country name. I don't know .. wait the others to help. Link to comment
aka Blue Posted November 5, 2015 Share Posted November 5, 2015 This should work. local countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="SK", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } exports.scoreboard:addScoreboardColumn ( "Country", getRootElement(), 9, 0.07 ) function wtf () local countryCode = exports.admin:getPlayerCountry(source) if countryCode and countryNames[countryCode] then local name = countryNames[countryCode] local flag = name and ":admin/client/images/flags/"..countryCode ..".png" Link to comment
1LoL1 Posted November 5, 2015 Author Share Posted November 5, 2015 This should work. local countryNames = { ["IT"]="Italy", ["MX"]="Mexico", ["SA"]="SAUDI ARBIA", ["PK"]="Pakistan", ["AF"]="Afghanistan", ["DZ"]="Algeria", ["AS"]="American samoa", ["AU"]="Australlia", ["AO"]="Anqola", ["AI"]="Anquilla", ["AQ"]="Antarctica", ["AG"]="Antigua and Barbuda", ["AR"]="Argentina", ["AM"]="Armenia", ["AW"]="Aruba", ["AT"]="Austria", ["AZ"]="Azerbaijan", ["BS"]="Bahamas", ["BH"]="Bahrain", ["BD"]="Bangladesh", ["BB"]="Barbados", ["BY"]="Belarus", ["BE"]="Belgium", ["BZ"]="Belize", ["BJ"]="Benin", ["BM"]="Bermuda", ["BT"]="Bhutan", ["BO"]="Bolivia", ["BA"]="Bosnia", ["BH"]="Herzegovina", ["BW"]="Botswana", ["BR"]="Brazil", ["IO"]="British Indian Ocean Territory", ["VG"]="British Virgin Islands", ["BN"]="Brunei", ["BG"]="Bulgaria", ["BF"]="Burkina Faso", ["MM"]="Burma (Myanmar)", ["BI"]="Burundi", ["KH"]="Cambodia", ["CM"]="Cameroon", ["CA"]="Canada", ["CV"]="Cape Verde", ["KY"]="Cayman Islands", ["CF"]="Central African Republic", ["TD"]="Chad", ["CL"]="Chile", ["CN"]="China", ["CX"]="Christmas Island", ["CC"]="Cocos (Keeling) Islands", ["CO"]="Colombia", ["KM"]="Comoros", ["CK"]="Cook Islands", ["CR"]="Costa Rica", ["HR"]="Croatia", ["CU"]="Cuba", ["CY"]="Cyprus", ["CZ"]="Czech Republic", ["CD"]="Democratic Republic of the Congo", ["DK"]="Denmark", ["DJ"]="Djibouti", ["DM"]="Dominica", ["DO"]="Dominican Republic", ["EC"]="Ecuador", ["SV"]="El Salvador", ["GQ"]="Equatorial Guinea", ["ER"]="Eritrea", ["EE"]="Estonia", ["ET"]="Ethiopia", ["FK"]="Falkland Islands", ["FO"]="Faroe Islands", ["FJ"]="Fiji", ["FI"]="Finland", ["FR"]="France", ["PF"]="French Polynesia", ["GA"]="Gabon", ["GM"]="Gambia", ["GE"]="Georgia", ["DE"]="Germany", ["GH"]="Ghana", ["GI"]="Gibraltar", ["GR"]="Greece", ["GL"]="Greenland", ["GD"]="Grenada", ["GU"]="Guam", ["GT"]="Guatemala", ["GN"]="Guinea", ["GW"]="Guinea-Bissau", ["GY"]="Guyana", ["HT"]="Haiti", ["VA"]="Holy See (Vatican City)", ["HN"]="Honduras", ["HK"]="Hong Kong", ["HU"]="Hungary", ["IS"]="Iceland", ["IN"]="India", ["ID"]="Indonesia", ["IR"]="Iran", ["IQ"]="Iraq", ["IE"]="Ireland", ["IM"]="Isle of Man", ["IL"]="Israel", ["IT"]="Italy", ["CI"]="Ivory Coast", ["JM"]="Jamaica", ["JP"]="Japan", ["JE"]="Jersey", ["JO"]="Jordan", ["KZ"]="Kazakhstan", ["KE"]="Kenya", ["KI"]="Kiribati", ["KO"]="Kosovo", ["KW"]="Kuwait", ["KG"]="Kyrgyzstan", ["LA"]="Laos", ["LV"]="Latvia", ["LB"]="Lebanon", ["LS"]="Lesotho", ["LR"]="Liberia", ["LY"]="Libya", ["LI"]="Liechtenstein", ["LT"]="Lithuania", ["LU"]="Luxembourg", ["MO"]="Macau", ["MK"]="Macedonia", ["MG"]="Madagascar", ["MW"]="Malawi", ["MY"]="Malaysia", ["MV"]="Maldives", ["ML"]="Mali", ["MT"]="Malta", ["MH"]="Marshall Islands", ["MR"]="Mauritania", ["MU"]="Mauritius", ["YT"]="Mayotte", ["MX"]="Mexico", ["FM"]="Micronesia", ["MD"]="Moldova", ["MC"]="Monaco", ["MN"]="Mongolia", ["ME"]="Montenegro", ["MS"]="Montserrat", ["MA"]="Morocco", ["MZ"]="Mozambique", ["NA"]="Namibia", ["NR"]="Nauru", ["NP"]="Nepal", ["NL"]="Netherlands", ["AN"]="Netherlands Antilles", ["NC"]="New Caledonia", ["NZ"]="New Zealand", ["NI"]="Nicaragua", ["NE"]="Niger", ["NG"]="Nigeria", ["NU"]="Niue", ["NI"]="Norfolk Island", ["KP"]="North Korea", ["MP"]="Northern Mariana Islands", ["NO"]="Norway", ["OM"]="Oman", ["PK"]="Pakistan", ["PW"]="Palau", ["PA"]="Panama", ["PG"]="Papua New Guinea", ["PY"]="Paraguay", ["PE"]="Peru", ["PH"]="Philippines", ["PN"]="Pitcairn Islands", ["PL"]="Poland", ["PT"]="Portugal", ["PR"]="Puerto Rico", ["QA"]="Qatar", ["CG"]="Republic of the Congo", ["RO"]="Romania", ["RU"]="Russia", ["RW"]="Rwanda", ["BL"]="Saint Barthelemy", ["SH"]="Saint Helena", ["KN"]="Saint Kitts and Nevis", ["LC"]="Saint Lucia", ["MF"]="Saint Martin", ["PM"]="Saint Pierre and Miquelon", ["VC"]="Saint Vincent and the Grenadines", ["WS"]="Samoa", ["SM"]="San Marino", ["ST"]="Sao Tome and Principe", ["SA"]="Saudi Arabia", ["SN"]="Senegal", ["RS"]="Serbia", ["SC"]="Seychelles", ["SL"]="Sierra Leone", ["SG"]="Singapore", ["SK"]="SK", ["SI"]="Slovenia", ["SB"]="Solomon Islands", ["SO"]="Somalia", ["ZA"]="South Africa", ["KR"]="South Korea", ["ES"]="Spain", ["LK"]="Sri Lanka", ["SD"]="Sudan", ["SR"]="Suriname", ["SJ"]="Svalbard", ["SZ"]="Swaziland", ["SE"]="Sweden", ["CH"]="Switzerland", ["SY"]="Syria", ["TW"]="Taiwan", ["TJ"]="Tajikistan", ["TZ"]="Tanzania", ["TH"]="Thailand", ["TL"]="Timor-Leste", ["TG"]="Togo", ["TK"]="Tokelau", ["TO"]="Tonga", ["TT"]="Trinidad and Tobago", ["TN"]="Tunisia", ["TR"]="Turkey", ["TM"]="Turkmenistan", ["TC"]="Turks and Caicos Islands", ["TV"]="Tuvalu", ["UG"]="Uganda", ["UA"]="Ukraine", ["AE"]="United Arab Emirates", ["GB"]="United Kingdom", ["US"]="United States", ["UY"]="Uruguay", ["VI"]="US Virgin Islands", ["UZ"]="Uzbekistan", ["VU"]="Vanuatu", ["VE"]="Venezuela", ["VN"]="Vietnam", ["WF"]="Wallis and Futuna", ["WB"]="West Bank", ["EH"]="Western Sahara", ["YE"]="Yemen", ["ZM"]="Zambia", ["ZW"]="Zimbabwe" } exports.scoreboard:addScoreboardColumn ( "Country", getRootElement(), 9, 0.07 ) function wtf () local countryCode = exports.admin:getPlayerCountry(source) if countryCode and countryNames[countryCode] then 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