Jump to content

geoip


sagi100

Recommended Posts

i try to make a join quit with geoip country + city .

i got this for now:

  1. countryNames = {
  2. ['AD'] = 'Andorra',
  3. ['AE'] = 'United Arab Emirates',
  4. ['AF'] = 'Afghanistan',
  5. ['AG'] = 'Antigua and Barbuda',
  6. ['AI'] = 'Anguilla',
  7. ['AL'] = 'Albania',
  8. ['AM'] = 'Armenia',
  9. ['AO'] = 'Angola',
  10. ['AP'] = 'ARIPO',
  11. ['AR'] = 'Argentina',
  12. ['AT'] = 'Austria',
  13. ['AU'] = 'Australia',
  14. ['AW'] = 'Aruba',
  15. ['AZ'] = 'Azerbaijan',
  16. ['BA'] = 'Bosnia and Herzegovina',
  17. ['BB'] = 'Barbados',
  18. ['BD'] = 'Bangladesh',
  19. ['BE'] = 'Belgium',
  20. ['BF'] = 'Burkina Faso',
  21. ['BG'] = 'Bulgaria',
  22. ['BH'] = 'Bahrain',
  23. ['BI'] = 'Burundi',
  24. ['BJ'] = 'Benin',
  25. ['BM'] = 'Bermuda',
  26. ['BN'] = 'Brunei Darussalam',
  27. ['BO'] = 'Bolivia',
  28. ['BQ'] = 'Bonaire',
  29. ['BR'] = 'Brazil',
  30. ['BS'] = 'Bahamas',
  31. ['BT'] = 'Bhutan',
  32. ['BV'] = 'Bouvet Island',
  33. ['BW'] = 'Botswana',
  34. ['BY'] = 'Belarus',
  35. ['BZ'] = 'Belize',
  36. ['CA'] = 'Canada',
  37. ['CD'] = 'Congo',
  38. ['CF'] = 'Central African Republic',
  39. ['CG'] = 'Congo',
  40. ['CH'] = 'Switzerland',
  41. ['CI'] = 'Cote d?Ivoire',
  42. ['CK'] = 'Cook Islands',
  43. ['CL'] = 'Chile',
  44. ['CM'] = 'Cameroon',
  45. ['CN'] = 'China',
  46. ['CO'] = 'Colombia',
  47. ['CR'] = 'Costa Rica',
  48. ['CU'] = 'Cuba',
  49. ['CV'] = 'Cape Verde',
  50. ['CW'] = 'Curacao',
  51. ['CY'] = 'Cyprus',
  52. ['CZ'] = 'Czech Republic',
  53. ['DE'] = 'Germany',
  54. ['DJ'] = 'Djibouti',
  55. ['DK'] = 'Denmark',
  56. ['DM'] = 'Dominica',
  57. ['DO'] = 'Dominican Republic',
  58. ['DZ'] = 'Algeria',
  59. ['EC'] = 'Ecuador',
  60. ['EE'] = 'Estonia',
  61. ['EG'] = 'Egypt',
  62. ['EH'] = 'Western Sahara',
  63. ['ER'] = 'Eritrea',
  64. ['ES'] = 'Spain',
  65. ['ET'] = 'Ethiopia',
  66. ['FI'] = 'Finland',
  67. ['FJ'] = 'Fiji',
  68. ['FK'] = 'Malvinas',
  69. ['FO'] = 'Faroe Islands',
  70. ['FR'] = 'France',
  71. ['GA'] = 'Gabon',
  72. ['GB'] = 'United Kingdom',
  73. ['GD'] = 'Grenada',
  74. ['GE'] = 'Georgia',
  75. ['GG'] = 'Guernsey',
  76. ['GH'] = 'Ghana',
  77. ['GI'] = 'Gibraltar',
  78. ['GL'] = 'Greenland',
  79. ['GM'] = 'Gambia',
  80. ['GN'] = 'Guinea',
  81. ['GQ'] = 'Equatorial Guinea',
  82. ['GR'] = 'Greece',
  83. ['GT'] = 'Guatemala',
  84. ['GW'] = 'Guinea-Bissau',
  85. ['GY'] = 'Guyana',
  86. ['HN'] = 'Honduras',
  87. ['HR'] = 'Croatia',
  88. ['HT'] = 'Haiti',
  89. ['HU'] = 'Hungary',
  90. ['ID'] = 'Indonesia',
  91. ['IE'] = 'Ireland',
  92. ['IL'] = 'Israel',
  93. ['IM'] = 'Isle of Man',
  94. ['IN'] = 'India',
  95. ['IQ'] = 'Iraq',
  96. ['IR'] = 'Iran',
  97. ['IS'] = 'Iceland',
  98. ['IT'] = 'Italy',
  99. ['JE'] = 'Jersey',
  100. ['JM'] = 'Jamaica',
  101. ['JO'] = 'Jordan',
  102. ['JP'] = 'Japan',
  103. ['KE'] = 'Kenya',
  104. ['KG'] = 'Kyrgyzstan',
  105. ['KH'] = 'Cambodia',
  106. ['KI'] = 'Kiribati',
  107. ['KM'] = 'Comoros',
  108. ['KN'] = 'Saint Kitts and Nevis',
  109. ['KP'] = 'Korea',
  110. ['KR'] = 'Korea',
  111. ['KW'] = 'Kuwait',
  112. ['KY'] = 'Cayman Islands',
  113. ['KZ'] = 'Kazakhstan',
  114. ['LA'] = 'Lao People?s Republic',
  115. ['LB'] = 'Lebanon',
  116. ['LC'] = 'Saint Lucia',
  117. ['LI'] = 'Liechtenstein',
  118. ['LK'] = 'Sri Lanka',
  119. ['LR'] = 'Liberia',
  120. ['LS'] = 'Lesotho',
  121. ['LT'] = 'Lithuania',
  122. ['LU'] = 'Luxembourg',
  123. ['LV'] = 'Latvia',
  124. ['LY'] = 'Libyan Arab Jamahiriya',
  125. ['MA'] = 'Morocco',
  126. ['MC'] = 'Monaco',
  127. ['MD'] = 'Moldova',
  128. ['ME'] = 'Montenegro',
  129. ['MG'] = 'Madagascar',
  130. ['MK'] = 'Macedonia',
  131. ['ML'] = 'Mali',
  132. ['MM'] = 'Myanmar',
  133. ['MN'] = 'Mongolia',
  134. ['MO'] = 'Macao',
  135. ['MP'] = 'Northern Mariana Islands',
  136. ['MR'] = 'Mauritania',
  137. ['MS'] = 'Montserrat',
  138. ['MT'] = 'Malta',
  139. ['MU'] = 'Mauritius',
  140. ['MV'] = 'Maldives',
  141. ['MW'] = 'Malawi',
  142. ['MX'] = 'Mexico',
  143. ['MY'] = 'Malaysia',
  144. ['MZ'] = 'Mozambique',
  145. ['NA'] = 'Namibia',
  146. ['NE'] = 'Niger',
  147. ['NG'] = 'Nigeria',
  148. ['NI'] = 'Nicaragua',
  149. ['NL'] = 'Netherlands',
  150. ['NO'] = 'Norway',
  151. ['NP'] = 'Nepal',
  152. ['NR'] = 'Nauru',
  153. ['NZ'] = 'New Zealand',
  154. ['OM'] = 'Oman',
  155. ['PA'] = 'Panama',
  156. ['PE'] = 'Peru',
  157. ['PG'] = 'Papua New Guinea',
  158. ['PH'] = 'Philippines',
  159. ['PK'] = 'Pakistan',
  160. ['PL'] = 'Poland',
  161. ['PT'] = 'Portugal',
  162. ['PW'] = 'Palau',
  163. ['PY'] = 'Paraguay',
  164. ['QA'] = 'Qatar',
  165. ['RO'] = 'Romania',
  166. ['RS'] = 'Serbia',
  167. ['RU'] = 'Russian Federation',
  168. ['RW'] = 'Rwanda',
  169. ['SA'] = 'Saudi Arabia',
  170. ['SB'] = 'Solomon Islands',
  171. ['SC'] = 'Seychelles',
  172. ['SD'] = 'Sudan',
  173. ['SE'] = 'Sweden',
  174. ['SG'] = 'Singapore',
  175. ['SH'] = 'Saint Helena',
  176. ['SI'] = 'Slovenia',
  177. ['SK'] = 'Slovakia',
  178. ['SL'] = 'Sierra Leone',
  179. ['SM'] = 'San Marino',
  180. ['SN'] = 'Senegal',
  181. ['SO'] = 'Somalia',
  182. ['SR'] = 'Suriname',
  183. ['ST'] = 'Sao Tome and Principe',
  184. ['SV'] = 'Salvador',
  185. ['SX'] = 'Sint Maarten (Dutch part)',
  186. ['SY'] = 'Syrian Arab Republic',
  187. ['SZ'] = 'Swaziland',
  188. ['TC'] = 'Turks and Caicos Islands',
  189. ['TD'] = 'Chad',
  190. ['TG'] = 'Togo',
  191. ['TH'] = 'Thailand',
  192. ['TJ'] = 'Tajikistan',
  193. ['TL'] = 'Timor?Leste',
  194. ['TM'] = 'Turkmenistan',
  195. ['TN'] = 'Tunisia',
  196. ['TO'] = 'Tonga',
  197. ['TR'] = 'Turkey',
  198. ['TT'] = 'Trinidad and Tobago',
  199. ['TV'] = 'Tuvalu',
  200. ['TW'] = 'Taiwan',
  201. ['TZ'] = 'Tanzania',
  202. ['UA'] = 'Ukraine',
  203. ['UG'] = 'Uganda',
  204. ['US'] = 'United States of America',
  205. ['UY'] = 'Uruguay',
  206. ['UZ'] = 'Uzbekistan',
  207. ['VA'] = 'Holy See',
  208. ['VC'] = 'Saint Vincent',
  209. ['VE'] = 'Venezuela',
  210. ['VG'] = 'Virgin Islands',
  211. ['VN'] = 'Viet Nam',
  212. ['VU'] = 'Vanuatu',
  213. ['WS'] = 'Samoa',
  214. ['YE'] = 'Yemen',
  215. ['ZA'] = 'South Africa',
  216. ['ZM'] = 'Zambia',
  217. ['ZW'] = 'Zimbabwe'
  218. }
  219. -------------------------------------------------------------------------------------------------------------------------
  220. function getPlayerLocation(player)
  221. local ip = getPlayerIP(player)
  222. local countryCode = exports["admin"]:getPlayerCountry(player)
  223. local country = "San Andreas"
  224. if countryCode and countryNames[countryCode] then
  225. country = countryNames[countryCode]
  226. end
  227. setElementData(player, "Country", country)
  228.  
  229. function displayPlayerLocation( resp, errno, player)
  230. if errno == 0 then
  231. local data = fromJSON("[".. resp .. "]")
  232. local status = data["status"] or "fail"
  233. if status == "success" then
  234. for k,v in ipairs(getElementsByType"player") do
  235. if v ~= player then
  236. outputChatBox("✶ Joined: #FFFFFF"..getPlayerName(player).."#FF6464 ("..data["city"]..", ".. data["country"]..") joined the server.", v, 255, 100, 100, true)
  237. end
  238. end
  239. else
  240. outputDebugString("Cannot retrieve network details")
  241. for k,v in ipairs(getElementsByType"player") do
  242. if v ~= player then
  243. outputChatBox("✶ Joined: #FFFFFF"..getPlayerName(player).."#FF6464 ("..country..") joined the server.", v, 255, 100, 100, true)
  244. end
  245. end
  246. end
  247. else
  248. outputDebugString("Error @fetchRemote, ERRNO: " .. errno)
  249. end
  250. end
  251.  
  252. fetchRemote("http://ip-api.com/json/" .. ip, displayPlayerLocation, "", false, player)
  253. end
  254. -------------------------------------------------------------------------------------------------------------------------
  255. function OnPlayerJoin ()
  256. getPlayerLocation(source)
  257. end
  258. addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoin)
Link to comment
2 minutes ago, DNL291 said:

Show the code you're using.

  1. countryNames = {
  2. ['AD'] = 'Andorra',
  3. ['AE'] = 'United Arab Emirates',
  4. ['AF'] = 'Afghanistan',
  5. ['AG'] = 'Antigua and Barbuda',
  6. ['AI'] = 'Anguilla',
  7. ['AL'] = 'Albania',
  8. ['AM'] = 'Armenia',
  9. ['AO'] = 'Angola',
  10. ['AP'] = 'ARIPO',
  11. ['AR'] = 'Argentina',
  12. ['AT'] = 'Austria',
  13. ['AU'] = 'Australia',
  14. ['AW'] = 'Aruba',
  15. ['AZ'] = 'Azerbaijan',
  16. ['BA'] = 'Bosnia and Herzegovina',
  17. ['BB'] = 'Barbados',
  18. ['BD'] = 'Bangladesh',
  19. ['BE'] = 'Belgium',
  20. ['BF'] = 'Burkina Faso',
  21. ['BG'] = 'Bulgaria',
  22. ['BH'] = 'Bahrain',
  23. ['BI'] = 'Burundi',
  24. ['BJ'] = 'Benin',
  25. ['BM'] = 'Bermuda',
  26. ['BN'] = 'Brunei Darussalam',
  27. ['BO'] = 'Bolivia',
  28. ['BQ'] = 'Bonaire',
  29. ['BR'] = 'Brazil',
  30. ['BS'] = 'Bahamas',
  31. ['BT'] = 'Bhutan',
  32. ['BV'] = 'Bouvet Island',
  33. ['BW'] = 'Botswana',
  34. ['BY'] = 'Belarus',
  35. ['BZ'] = 'Belize',
  36. ['CA'] = 'Canada',
  37. ['CD'] = 'Congo',
  38. ['CF'] = 'Central African Republic',
  39. ['CG'] = 'Congo',
  40. ['CH'] = 'Switzerland',
  41. ['CI'] = 'Cote d?Ivoire',
  42. ['CK'] = 'Cook Islands',
  43. ['CL'] = 'Chile',
  44. ['CM'] = 'Cameroon',
  45. ['CN'] = 'China',
  46. ['CO'] = 'Colombia',
  47. ['CR'] = 'Costa Rica',
  48. ['CU'] = 'Cuba',
  49. ['CV'] = 'Cape Verde',
  50. ['CW'] = 'Curacao',
  51. ['CY'] = 'Cyprus',
  52. ['CZ'] = 'Czech Republic',
  53. ['DE'] = 'Germany',
  54. ['DJ'] = 'Djibouti',
  55. ['DK'] = 'Denmark',
  56. ['DM'] = 'Dominica',
  57. ['DO'] = 'Dominican Republic',
  58. ['DZ'] = 'Algeria',
  59. ['EC'] = 'Ecuador',
  60. ['EE'] = 'Estonia',
  61. ['EG'] = 'Egypt',
  62. ['EH'] = 'Western Sahara',
  63. ['ER'] = 'Eritrea',
  64. ['ES'] = 'Spain',
  65. ['ET'] = 'Ethiopia',
  66. ['FI'] = 'Finland',
  67. ['FJ'] = 'Fiji',
  68. ['FK'] = 'Malvinas',
  69. ['FO'] = 'Faroe Islands',
  70. ['FR'] = 'France',
  71. ['GA'] = 'Gabon',
  72. ['GB'] = 'United Kingdom',
  73. ['GD'] = 'Grenada',
  74. ['GE'] = 'Georgia',
  75. ['GG'] = 'Guernsey',
  76. ['GH'] = 'Ghana',
  77. ['GI'] = 'Gibraltar',
  78. ['GL'] = 'Greenland',
  79. ['GM'] = 'Gambia',
  80. ['GN'] = 'Guinea',
  81. ['GQ'] = 'Equatorial Guinea',
  82. ['GR'] = 'Greece',
  83. ['GT'] = 'Guatemala',
  84. ['GW'] = 'Guinea-Bissau',
  85. ['GY'] = 'Guyana',
  86. ['HN'] = 'Honduras',
  87. ['HR'] = 'Croatia',
  88. ['HT'] = 'Haiti',
  89. ['HU'] = 'Hungary',
  90. ['ID'] = 'Indonesia',
  91. ['IE'] = 'Ireland',
  92. ['IL'] = 'Israel',
  93. ['IM'] = 'Isle of Man',
  94. ['IN'] = 'India',
  95. ['IQ'] = 'Iraq',
  96. ['IR'] = 'Iran',
  97. ['IS'] = 'Iceland',
  98. ['IT'] = 'Italy',
  99. ['JE'] = 'Jersey',
  100. ['JM'] = 'Jamaica',
  101. ['JO'] = 'Jordan',
  102. ['JP'] = 'Japan',
  103. ['KE'] = 'Kenya',
  104. ['KG'] = 'Kyrgyzstan',
  105. ['KH'] = 'Cambodia',
  106. ['KI'] = 'Kiribati',
  107. ['KM'] = 'Comoros',
  108. ['KN'] = 'Saint Kitts and Nevis',
  109. ['KP'] = 'Korea',
  110. ['KR'] = 'Korea',
  111. ['KW'] = 'Kuwait',
  112. ['KY'] = 'Cayman Islands',
  113. ['KZ'] = 'Kazakhstan',
  114. ['LA'] = 'Lao People?s Republic',
  115. ['LB'] = 'Lebanon',
  116. ['LC'] = 'Saint Lucia',
  117. ['LI'] = 'Liechtenstein',
  118. ['LK'] = 'Sri Lanka',
  119. ['LR'] = 'Liberia',
  120. ['LS'] = 'Lesotho',
  121. ['LT'] = 'Lithuania',
  122. ['LU'] = 'Luxembourg',
  123. ['LV'] = 'Latvia',
  124. ['LY'] = 'Libyan Arab Jamahiriya',
  125. ['MA'] = 'Morocco',
  126. ['MC'] = 'Monaco',
  127. ['MD'] = 'Moldova',
  128. ['ME'] = 'Montenegro',
  129. ['MG'] = 'Madagascar',
  130. ['MK'] = 'Macedonia',
  131. ['ML'] = 'Mali',
  132. ['MM'] = 'Myanmar',
  133. ['MN'] = 'Mongolia',
  134. ['MO'] = 'Macao',
  135. ['MP'] = 'Northern Mariana Islands',
  136. ['MR'] = 'Mauritania',
  137. ['MS'] = 'Montserrat',
  138. ['MT'] = 'Malta',
  139. ['MU'] = 'Mauritius',
  140. ['MV'] = 'Maldives',
  141. ['MW'] = 'Malawi',
  142. ['MX'] = 'Mexico',
  143. ['MY'] = 'Malaysia',
  144. ['MZ'] = 'Mozambique',
  145. ['NA'] = 'Namibia',
  146. ['NE'] = 'Niger',
  147. ['NG'] = 'Nigeria',
  148. ['NI'] = 'Nicaragua',
  149. ['NL'] = 'Netherlands',
  150. ['NO'] = 'Norway',
  151. ['NP'] = 'Nepal',
  152. ['NR'] = 'Nauru',
  153. ['NZ'] = 'New Zealand',
  154. ['OM'] = 'Oman',
  155. ['PA'] = 'Panama',
  156. ['PE'] = 'Peru',
  157. ['PG'] = 'Papua New Guinea',
  158. ['PH'] = 'Philippines',
  159. ['PK'] = 'Pakistan',
  160. ['PL'] = 'Poland',
  161. ['PT'] = 'Portugal',
  162. ['PW'] = 'Palau',
  163. ['PY'] = 'Paraguay',
  164. ['QA'] = 'Qatar',
  165. ['RO'] = 'Romania',
  166. ['RS'] = 'Serbia',
  167. ['RU'] = 'Russian Federation',
  168. ['RW'] = 'Rwanda',
  169. ['SA'] = 'Saudi Arabia',
  170. ['SB'] = 'Solomon Islands',
  171. ['SC'] = 'Seychelles',
  172. ['SD'] = 'Sudan',
  173. ['SE'] = 'Sweden',
  174. ['SG'] = 'Singapore',
  175. ['SH'] = 'Saint Helena',
  176. ['SI'] = 'Slovenia',
  177. ['SK'] = 'Slovakia',
  178. ['SL'] = 'Sierra Leone',
  179. ['SM'] = 'San Marino',
  180. ['SN'] = 'Senegal',
  181. ['SO'] = 'Somalia',
  182. ['SR'] = 'Suriname',
  183. ['ST'] = 'Sao Tome and Principe',
  184. ['SV'] = 'Salvador',
  185. ['SX'] = 'Sint Maarten (Dutch part)',
  186. ['SY'] = 'Syrian Arab Republic',
  187. ['SZ'] = 'Swaziland',
  188. ['TC'] = 'Turks and Caicos Islands',
  189. ['TD'] = 'Chad',
  190. ['TG'] = 'Togo',
  191. ['TH'] = 'Thailand',
  192. ['TJ'] = 'Tajikistan',
  193. ['TL'] = 'Timor?Leste',
  194. ['TM'] = 'Turkmenistan',
  195. ['TN'] = 'Tunisia',
  196. ['TO'] = 'Tonga',
  197. ['TR'] = 'Turkey',
  198. ['TT'] = 'Trinidad and Tobago',
  199. ['TV'] = 'Tuvalu',
  200. ['TW'] = 'Taiwan',
  201. ['TZ'] = 'Tanzania',
  202. ['UA'] = 'Ukraine',
  203. ['UG'] = 'Uganda',
  204. ['US'] = 'United States of America',
  205. ['UY'] = 'Uruguay',
  206. ['UZ'] = 'Uzbekistan',
  207. ['VA'] = 'Holy See',
  208. ['VC'] = 'Saint Vincent',
  209. ['VE'] = 'Venezuela',
  210. ['VG'] = 'Virgin Islands',
  211. ['VN'] = 'Viet Nam',
  212. ['VU'] = 'Vanuatu',
  213. ['WS'] = 'Samoa',
  214. ['YE'] = 'Yemen',
  215. ['ZA'] = 'South Africa',
  216. ['ZM'] = 'Zambia',
  217. ['ZW'] = 'Zimbabwe'
  218. }
  219. -------------------------------------------------------------------------------------------------------------------------
  220. function getPlayerLocation(player)
  221. local ip = getPlayerIP(player)
  222. local countryCode = exports["admin"]:getPlayerCountry(player)
  223. local country = "San Andreas"
  224. if countryCode and countryNames[countryCode] then
  225. country = countryNames[countryCode]
  226. end
  227. setElementData(player, "Country", country)
  228.  
  229. function displayPlayerLocation( resp, errno, player)
  230. if errno == 0 then
  231. local data = fromJSON("[".. resp .. "]")
  232. local status = data["status"] or "fail"
  233. if status == "success" then
  234. for k,v in ipairs(getElementsByType"player") do
  235. if v ~= player then
  236. outputChatBox("✶ Joined: #FFFFFF"..getPlayerName(player).."#FF6464 ("..data["city"]..", ".. data["country"]..") joined the server.", v, 255, 100, 100, true)
  237. end
  238. end
  239. else
  240. outputDebugString("Cannot retrieve network details")
  241. for k,v in ipairs(getElementsByType"player") do
  242. if v ~= player then
  243. outputChatBox("✶ Joined: #FFFFFF"..getPlayerName(player).."#FF6464 ("..country..") joined the server.", v, 255, 100, 100, true)
  244. end
  245. end
  246. end
  247. else
  248. outputDebugString("Error @fetchRemote, ERRNO: " .. errno)
  249. end
  250. end
  251.  
  252. fetchRemote("http://ip-api.com/json/" .. ip, displayPlayerLocation, "", false, player)
  253. end
  254. -------------------------------------------------------------------------------------------------------------------------
  255. function OnPlayerJoin ()
  256. getPlayerLocation(source)
  257. end
  258. addEventHandler("onPlayerJoin", getRootElement(), OnPlayerJoin)
Link to comment
  1. countryNames = {
  2. ['AD'] = 'Andorra',
  3. ['AE'] = 'United Arab Emirates',
  4. ['AF'] = 'Afghanistan',
  5. ['AG'] = 'Antigua and Barbuda',
  6. ['AI'] = 'Anguilla',
  7. ['AL'] = 'Albania',
  8. ['AM'] = 'Armenia',
  9. ['AO'] = 'Angola',
  10. ['AP'] = 'ARIPO',
  11. ['AR'] = 'Argentina',
  12. ['AT'] = 'Austria',
  13. ['AU'] = 'Australia',
  14. ['AW'] = 'Aruba',
  15. ['AZ'] = 'Azerbaijan',
  16. ['BA'] = 'Bosnia and Herzegovina',
  17. ['BB'] = 'Barbados',
  18. ['BD'] = 'Bangladesh',
  19. ['BE'] = 'Belgium',
  20. ['BF'] = 'Burkina Faso',
  21. ['BG'] = 'Bulgaria',
  22. ['BH'] = 'Bahrain',
  23. ['BI'] = 'Burundi',
  24. ['BJ'] = 'Benin',
  25. ['BM'] = 'Bermuda',
  26. ['BN'] = 'Brunei Darussalam',
  27. ['BO'] = 'Bolivia',
  28. ['BQ'] = 'Bonaire',
  29. ['BR'] = 'Brazil',
  30. ['BS'] = 'Bahamas',
  31. ['BT'] = 'Bhutan',
  32. ['BV'] = 'Bouvet Island',
  33. ['BW'] = 'Botswana',
  34. ['BY'] = 'Belarus',
  35. ['BZ'] = 'Belize',
  36. ['CA'] = 'Canada',
  37. ['CD'] = 'Congo',
  38. ['CF'] = 'Central African Republic',
  39. ['CG'] = 'Congo',
  40. ['CH'] = 'Switzerland',
  41. ['CI'] = 'Cote d?Ivoire',
  42. ['CK'] = 'Cook Islands',
  43. ['CL'] = 'Chile',
  44. ['CM'] = 'Cameroon',
  45. ['CN'] = 'China',
  46. ['CO'] = 'Colombia',
  47. ['CR'] = 'Costa Rica',
  48. ['CU'] = 'Cuba',
  49. ['CV'] = 'Cape Verde',
  50. ['CW'] = 'Curacao',
  51. ['CY'] = 'Cyprus',
  52. ['CZ'] = 'Czech Republic',
  53. ['DE'] = 'Germany',
  54. ['DJ'] = 'Djibouti',
  55. ['DK'] = 'Denmark',
  56. ['DM'] = 'Dominica',
  57. ['DO'] = 'Dominican Republic',
  58. ['DZ'] = 'Algeria',
  59. ['EC'] = 'Ecuador',
  60. ['EE'] = 'Estonia',
  61. ['EG'] = 'Egypt',
  62. ['EH'] = 'Western Sahara',
  63. ['ER'] = 'Eritrea',
  64. ['ES'] = 'Spain',
  65. ['ET'] = 'Ethiopia',
  66. ['FI'] = 'Finland',
  67. ['FJ'] = 'Fiji',
  68. ['FK'] = 'Malvinas',
  69. ['FO'] = 'Faroe Islands',
  70. ['FR'] = 'France',
  71. ['GA'] = 'Gabon',
  72. ['GB'] = 'United Kingdom',
  73. ['GD'] = 'Grenada',
  74. ['GE'] = 'Georgia',
  75. ['GG'] = 'Guernsey',
  76. ['GH'] = 'Ghana',
  77. ['GI'] = 'Gibraltar',
  78. ['GL'] = 'Greenland',
  79. ['GM'] = 'Gambia',
  80. ['GN'] = 'Guinea',
  81. ['GQ'] = 'Equatorial Guinea',
  82. ['GR'] = 'Greece',
  83. ['GT'] = 'Guatemala',
  84. ['GW'] = 'Guinea-Bissau',
  85. ['GY'] = 'Guyana',
  86. ['HN'] = 'Honduras',
  87. ['HR'] = 'Croatia',
  88. ['HT'] = 'Haiti',
  89. ['HU'] = 'Hungary',
  90. ['ID'] = 'Indonesia',
  91. ['IE'] = 'Ireland',
  92. ['IL'] = 'Israel',
  93. ['IM'] = 'Isle of Man',
  94. ['IN'] = 'India',
  95. ['IQ'] = 'Iraq',
  96. ['IR'] = 'Iran',
  97. ['IS'] = 'Iceland',
  98. ['IT'] = 'Italy',
  99. ['JE'] = 'Jersey',
  100. ['JM'] = 'Jamaica',
  101. ['JO'] = 'Jordan',
  102. ['JP'] = 'Japan',
  103. ['KE'] = 'Kenya',
  104. ['KG'] = 'Kyrgyzstan',
  105. ['KH'] = 'Cambodia',
  106. ['KI'] = 'Kiribati',
  107. ['KM'] = 'Comoros',
  108. ['KN'] = 'Saint Kitts and Nevis',
  109. ['KP'] = 'Korea',
  110. ['KR'] = 'Korea',
  111. ['KW'] = 'Kuwait',
  112. ['KY'] = 'Cayman Islands',
  113. ['KZ'] = 'Kazakhstan',
  114. ['LA'] = 'Lao People?s Republic',
  115. ['LB'] = 'Lebanon',
  116. ['LC'] = 'Saint Lucia',
  117. ['LI'] = 'Liechtenstein',
  118. ['LK'] = 'Sri Lanka',
  119. ['LR'] = 'Liberia',
  120. ['LS'] = 'Lesotho',
  121. ['LT'] = 'Lithuania',
  122. ['LU'] = 'Luxembourg',
  123. ['LV'] = 'Latvia',
  124. ['LY'] = 'Libyan Arab Jamahiriya',
  125. ['MA'] = 'Morocco',
  126. ['MC'] = 'Monaco',
  127. ['MD'] = 'Moldova',
  128. ['ME'] = 'Montenegro',
  129. ['MG'] = 'Madagascar',
  130. ['MK'] = 'Macedonia',
  131. ['ML'] = 'Mali',
  132. ['MM'] = 'Myanmar',
  133. ['MN'] = 'Mongolia',
  134. ['MO'] = 'Macao',
  135. ['MP'] = 'Northern Mariana Islands',
  136. ['MR'] = 'Mauritania',
  137. ['MS'] = 'Montserrat',
  138. ['MT'] = 'Malta',
  139. ['MU'] = 'Mauritius',
  140. ['MV'] = 'Maldives',
  141. ['MW'] = 'Malawi',
  142. ['MX'] = 'Mexico',
  143. ['MY'] = 'Malaysia',
  144. ['MZ'] = 'Mozambique',
  145. ['NA'] = 'Namibia',
  146. ['NE'] = 'Niger',
  147. ['NG'] = 'Nigeria',
  148. ['NI'] = 'Nicaragua',
  149. ['NL'] = 'Netherlands',
  150. ['NO'] = 'Norway',
  151. ['NP'] = 'Nepal',
  152. ['NR'] = 'Nauru',
  153. ['NZ'] = 'New Zealand',
  154. ['OM'] = 'Oman',
  155. ['PA'] = 'Panama',
  156. ['PE'] = 'Peru',
  157. ['PG'] = 'Papua New Guinea',
  158. ['PH'] = 'Philippines',
  159. ['PK'] = 'Pakistan',
  160. ['PL'] = 'Poland',
  161. ['PT'] = 'Portugal',
  162. ['PW'] = 'Palau',
  163. ['PY'] = 'Paraguay',
  164. ['QA'] = 'Qatar',
  165. ['RO'] = 'Romania',
  166. ['RS'] = 'Serbia',
  167. ['RU'] = 'Russian Federation',
  168. ['RW'] = 'Rwanda',
  169. ['SA'] = 'Saudi Arabia',
  170. ['SB'] = 'Solomon Islands',
  171. ['SC'] = 'Seychelles',
  172. ['SD'] = 'Sudan',
  173. ['SE'] = 'Sweden',
  174. ['SG'] = 'Singapore',
  175. ['SH'] = 'Saint Helena',
  176. ['SI'] = 'Slovenia',
  177. ['SK'] = 'Slovakia',
  178. ['SL'] = 'Sierra Leone',
  179. ['SM'] = 'San Marino',
  180. ['SN'] = 'Senegal',
  181. ['SO'] = 'Somalia',
  182. ['SR'] = 'Suriname',
  183. ['ST'] = 'Sao Tome and Principe',
  184. ['SV'] = 'Salvador',
  185. ['SX'] = 'Sint Maarten (Dutch part)',
  186. ['SY'] = 'Syrian Arab Republic',
  187. ['SZ'] = 'Swaziland',
  188. ['TC'] = 'Turks and Caicos Islands',
  189. ['TD'] = 'Chad',
  190. ['TG'] = 'Togo',
  191. ['TH'] = 'Thailand',
  192. ['TJ'] = 'Tajikistan',
  193. ['TL'] = 'Timor?Leste',
  194. ['TM'] = 'Turkmenistan',
  195. ['TN'] = 'Tunisia',
  196. ['TO'] = 'Tonga',
  197. ['TR'] = 'Turkey',
  198. ['TT'] = 'Trinidad and Tobago',
  199. ['TV'] = 'Tuvalu',
  200. ['TW'] = 'Taiwan',
  201. ['TZ'] = 'Tanzania',
  202. ['UA'] = 'Ukraine',
  203. ['UG'] = 'Uganda',
  204. ['US'] = 'United States of America',
  205. ['UY'] = 'Uruguay',
  206. ['UZ'] = 'Uzbekistan',
  207. ['VA'] = 'Holy See',
  208. ['VC'] = 'Saint Vincent',
  209. ['VE'] = 'Venezuela',
  210. ['VG'] = 'Virgin Islands',
  211. ['VN'] = 'Viet Nam',
  212. ['VU'] = 'Vanuatu',
  213. ['WS'] = 'Samoa',
  214. ['YE'] = 'Yemen',
  215. ['ZA'] = 'South Africa',
  216. ['ZM'] = 'Zambia',
  217. ['ZW'] = 'Zimbabwe'
  218. }

function Welcome ()
    local countryCode = exports["admin"]:getPlayerCountry(source)
    setElementData(source,"Country",countryNames[countryCode])
    outputChatBox(" " ..getPlayerName(source) .." has joined from ".. tostring(countryNames[countryCode]) ..".",getRootElement(),15,0,215)
end
addEventHandler("onPlayerJoin",getRootElement(),Welcome)

Link to comment
5 minutes ago, LilDawage said:
  1. countryNames = {
  2. ['AD'] = 'Andorra',
  3. ['AE'] = 'United Arab Emirates',
  4. ['AF'] = 'Afghanistan',
  5. ['AG'] = 'Antigua and Barbuda',
  6. ['AI'] = 'Anguilla',
  7. ['AL'] = 'Albania',
  8. ['AM'] = 'Armenia',
  9. ['AO'] = 'Angola',
  10. ['AP'] = 'ARIPO',
  11. ['AR'] = 'Argentina',
  12. ['AT'] = 'Austria',
  13. ['AU'] = 'Australia',
  14. ['AW'] = 'Aruba',
  15. ['AZ'] = 'Azerbaijan',
  16. ['BA'] = 'Bosnia and Herzegovina',
  17. ['BB'] = 'Barbados',
  18. ['BD'] = 'Bangladesh',
  19. ['BE'] = 'Belgium',
  20. ['BF'] = 'Burkina Faso',
  21. ['BG'] = 'Bulgaria',
  22. ['BH'] = 'Bahrain',
  23. ['BI'] = 'Burundi',
  24. ['BJ'] = 'Benin',
  25. ['BM'] = 'Bermuda',
  26. ['BN'] = 'Brunei Darussalam',
  27. ['BO'] = 'Bolivia',
  28. ['BQ'] = 'Bonaire',
  29. ['BR'] = 'Brazil',
  30. ['BS'] = 'Bahamas',
  31. ['BT'] = 'Bhutan',
  32. ['BV'] = 'Bouvet Island',
  33. ['BW'] = 'Botswana',
  34. ['BY'] = 'Belarus',
  35. ['BZ'] = 'Belize',
  36. ['CA'] = 'Canada',
  37. ['CD'] = 'Congo',
  38. ['CF'] = 'Central African Republic',
  39. ['CG'] = 'Congo',
  40. ['CH'] = 'Switzerland',
  41. ['CI'] = 'Cote d?Ivoire',
  42. ['CK'] = 'Cook Islands',
  43. ['CL'] = 'Chile',
  44. ['CM'] = 'Cameroon',
  45. ['CN'] = 'China',
  46. ['CO'] = 'Colombia',
  47. ['CR'] = 'Costa Rica',
  48. ['CU'] = 'Cuba',
  49. ['CV'] = 'Cape Verde',
  50. ['CW'] = 'Curacao',
  51. ['CY'] = 'Cyprus',
  52. ['CZ'] = 'Czech Republic',
  53. ['DE'] = 'Germany',
  54. ['DJ'] = 'Djibouti',
  55. ['DK'] = 'Denmark',
  56. ['DM'] = 'Dominica',
  57. ['DO'] = 'Dominican Republic',
  58. ['DZ'] = 'Algeria',
  59. ['EC'] = 'Ecuador',
  60. ['EE'] = 'Estonia',
  61. ['EG'] = 'Egypt',
  62. ['EH'] = 'Western Sahara',
  63. ['ER'] = 'Eritrea',
  64. ['ES'] = 'Spain',
  65. ['ET'] = 'Ethiopia',
  66. ['FI'] = 'Finland',
  67. ['FJ'] = 'Fiji',
  68. ['FK'] = 'Malvinas',
  69. ['FO'] = 'Faroe Islands',
  70. ['FR'] = 'France',
  71. ['GA'] = 'Gabon',
  72. ['GB'] = 'United Kingdom',
  73. ['GD'] = 'Grenada',
  74. ['GE'] = 'Georgia',
  75. ['GG'] = 'Guernsey',
  76. ['GH'] = 'Ghana',
  77. ['GI'] = 'Gibraltar',
  78. ['GL'] = 'Greenland',
  79. ['GM'] = 'Gambia',
  80. ['GN'] = 'Guinea',
  81. ['GQ'] = 'Equatorial Guinea',
  82. ['GR'] = 'Greece',
  83. ['GT'] = 'Guatemala',
  84. ['GW'] = 'Guinea-Bissau',
  85. ['GY'] = 'Guyana',
  86. ['HN'] = 'Honduras',
  87. ['HR'] = 'Croatia',
  88. ['HT'] = 'Haiti',
  89. ['HU'] = 'Hungary',
  90. ['ID'] = 'Indonesia',
  91. ['IE'] = 'Ireland',
  92. ['IL'] = 'Israel',
  93. ['IM'] = 'Isle of Man',
  94. ['IN'] = 'India',
  95. ['IQ'] = 'Iraq',
  96. ['IR'] = 'Iran',
  97. ['IS'] = 'Iceland',
  98. ['IT'] = 'Italy',
  99. ['JE'] = 'Jersey',
  100. ['JM'] = 'Jamaica',
  101. ['JO'] = 'Jordan',
  102. ['JP'] = 'Japan',
  103. ['KE'] = 'Kenya',
  104. ['KG'] = 'Kyrgyzstan',
  105. ['KH'] = 'Cambodia',
  106. ['KI'] = 'Kiribati',
  107. ['KM'] = 'Comoros',
  108. ['KN'] = 'Saint Kitts and Nevis',
  109. ['KP'] = 'Korea',
  110. ['KR'] = 'Korea',
  111. ['KW'] = 'Kuwait',
  112. ['KY'] = 'Cayman Islands',
  113. ['KZ'] = 'Kazakhstan',
  114. ['LA'] = 'Lao People?s Republic',
  115. ['LB'] = 'Lebanon',
  116. ['LC'] = 'Saint Lucia',
  117. ['LI'] = 'Liechtenstein',
  118. ['LK'] = 'Sri Lanka',
  119. ['LR'] = 'Liberia',
  120. ['LS'] = 'Lesotho',
  121. ['LT'] = 'Lithuania',
  122. ['LU'] = 'Luxembourg',
  123. ['LV'] = 'Latvia',
  124. ['LY'] = 'Libyan Arab Jamahiriya',
  125. ['MA'] = 'Morocco',
  126. ['MC'] = 'Monaco',
  127. ['MD'] = 'Moldova',
  128. ['ME'] = 'Montenegro',
  129. ['MG'] = 'Madagascar',
  130. ['MK'] = 'Macedonia',
  131. ['ML'] = 'Mali',
  132. ['MM'] = 'Myanmar',
  133. ['MN'] = 'Mongolia',
  134. ['MO'] = 'Macao',
  135. ['MP'] = 'Northern Mariana Islands',
  136. ['MR'] = 'Mauritania',
  137. ['MS'] = 'Montserrat',
  138. ['MT'] = 'Malta',
  139. ['MU'] = 'Mauritius',
  140. ['MV'] = 'Maldives',
  141. ['MW'] = 'Malawi',
  142. ['MX'] = 'Mexico',
  143. ['MY'] = 'Malaysia',
  144. ['MZ'] = 'Mozambique',
  145. ['NA'] = 'Namibia',
  146. ['NE'] = 'Niger',
  147. ['NG'] = 'Nigeria',
  148. ['NI'] = 'Nicaragua',
  149. ['NL'] = 'Netherlands',
  150. ['NO'] = 'Norway',
  151. ['NP'] = 'Nepal',
  152. ['NR'] = 'Nauru',
  153. ['NZ'] = 'New Zealand',
  154. ['OM'] = 'Oman',
  155. ['PA'] = 'Panama',
  156. ['PE'] = 'Peru',
  157. ['PG'] = 'Papua New Guinea',
  158. ['PH'] = 'Philippines',
  159. ['PK'] = 'Pakistan',
  160. ['PL'] = 'Poland',
  161. ['PT'] = 'Portugal',
  162. ['PW'] = 'Palau',
  163. ['PY'] = 'Paraguay',
  164. ['QA'] = 'Qatar',
  165. ['RO'] = 'Romania',
  166. ['RS'] = 'Serbia',
  167. ['RU'] = 'Russian Federation',
  168. ['RW'] = 'Rwanda',
  169. ['SA'] = 'Saudi Arabia',
  170. ['SB'] = 'Solomon Islands',
  171. ['SC'] = 'Seychelles',
  172. ['SD'] = 'Sudan',
  173. ['SE'] = 'Sweden',
  174. ['SG'] = 'Singapore',
  175. ['SH'] = 'Saint Helena',
  176. ['SI'] = 'Slovenia',
  177. ['SK'] = 'Slovakia',
  178. ['SL'] = 'Sierra Leone',
  179. ['SM'] = 'San Marino',
  180. ['SN'] = 'Senegal',
  181. ['SO'] = 'Somalia',
  182. ['SR'] = 'Suriname',
  183. ['ST'] = 'Sao Tome and Principe',
  184. ['SV'] = 'Salvador',
  185. ['SX'] = 'Sint Maarten (Dutch part)',
  186. ['SY'] = 'Syrian Arab Republic',
  187. ['SZ'] = 'Swaziland',
  188. ['TC'] = 'Turks and Caicos Islands',
  189. ['TD'] = 'Chad',
  190. ['TG'] = 'Togo',
  191. ['TH'] = 'Thailand',
  192. ['TJ'] = 'Tajikistan',
  193. ['TL'] = 'Timor?Leste',
  194. ['TM'] = 'Turkmenistan',
  195. ['TN'] = 'Tunisia',
  196. ['TO'] = 'Tonga',
  197. ['TR'] = 'Turkey',
  198. ['TT'] = 'Trinidad and Tobago',
  199. ['TV'] = 'Tuvalu',
  200. ['TW'] = 'Taiwan',
  201. ['TZ'] = 'Tanzania',
  202. ['UA'] = 'Ukraine',
  203. ['UG'] = 'Uganda',
  204. ['US'] = 'United States of America',
  205. ['UY'] = 'Uruguay',
  206. ['UZ'] = 'Uzbekistan',
  207. ['VA'] = 'Holy See',
  208. ['VC'] = 'Saint Vincent',
  209. ['VE'] = 'Venezuela',
  210. ['VG'] = 'Virgin Islands',
  211. ['VN'] = 'Viet Nam',
  212. ['VU'] = 'Vanuatu',
  213. ['WS'] = 'Samoa',
  214. ['YE'] = 'Yemen',
  215. ['ZA'] = 'South Africa',
  216. ['ZM'] = 'Zambia',
  217. ['ZW'] = 'Zimbabwe'
  218. }

function Welcome ()
    local countryCode = exports["admin"]:getPlayerCountry(source)
    setElementData(source,"Country",countryNames[countryCode])
    outputChatBox(" " ..getPlayerName(source) .." has joined from ".. tostring(countryNames[countryCode]) ..".",getRootElement(),15,0,215)
end
addEventHandler("onPlayerJoin",getRootElement(),Welcome)

can you make it to show also city?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...