Reflex# Posted March 25, 2012 Author Share Posted March 25, 2012 ReFleX add your script to the acl.xml ( group Admin ).Admin Panel -> Resources Tab -> Manage ACL -> Double click in Admin Group -> Add object -> Type "resource.yourJoinquitResourceName" -> Ok -> Restart resource or maybe not needed Note: Change "yourJoinquitResourceName" to your joinquit resource name, understand? Yes yes ok And link of resource for Kenix: http://www.mediafire.com/?n9wrun98tu7dn8h Link to comment
Kenix Posted March 25, 2012 Share Posted March 25, 2012 local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" } function onJoin( ) local country = exports['admin']:getPlayerCountry( source ) if not country then country = 'N/A' end setElementData( source,'Country', country ) outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. country ~= 'N/A' and countryNames[ tostring( country ) ] or 'N/A', root, 255, 100, 100 ) end addEventHandler ( "onPlayerJoin", root, onJoin ) Link to comment
Reflex# Posted March 25, 2012 Author Share Posted March 25, 2012 When player join writing only: N/A But in scoreboard country is showing Link to comment
CapY Posted March 25, 2012 Share Posted March 25, 2012 When player join writing only: N/A But in scoreboard country is showing Then your country is not in the table! Link to comment
myyusuf Posted March 25, 2012 Share Posted March 25, 2012 When player join writing only: N/A But in scoreboard country is showing Then your country is not in the table! exports.scoreboard:addScoreboardColumn('country') countryNames = { ['AD'] = 'Andorra', ['AE'] = 'United Arab Emirates', ['AF'] = 'Afghanistan', ['AG'] = 'Antigua and Barbuda', ['AI'] = 'Anguilla', ['AL'] = 'Albania', ['AM'] = 'Armenia', ['AO'] = 'Angola', ['AP'] = 'ARIPO', ['AR'] = 'Argentina', ['AT'] = 'Austria', ['AU'] = 'Australia', ['AW'] = 'Aruba', ['AZ'] = 'Azerbaijan', ['BA'] = 'Bosnia and Herzegovina', ['BB'] = 'Barbados', ['BD'] = 'Bangladesh', ['BE'] = 'Belgium', ['BF'] = 'Burkina Faso', ['BG'] = 'Bulgaria', ['BH'] = 'Bahrain', ['BI'] = 'Burundi', ['BJ'] = 'Benin', ['BM'] = 'Bermuda', ['BN'] = 'Brunei Darussalam', ['BO'] = 'Bolivia', ['BQ'] = 'Bonaire', ['BR'] = 'Brazil', ['BS'] = 'Bahamas', ['BT'] = 'Bhutan', ['BV'] = 'Bouvet Island', ['BW'] = 'Botswana', ['BY'] = 'Belarus', ['BZ'] = 'Belize', ['CA'] = 'Canada', ['CD'] = 'Congo', ['CF'] = 'Central African Republic', ['CG'] = 'Congo', ['CH'] = 'Switzerland', ['CI'] = 'Cote d?Ivoire', ['CK'] = 'Cook Islands', ['CL'] = 'Chile', ['CM'] = 'Cameroon', ['CN'] = 'China', ['CO'] = 'Colombia', ['CR'] = 'Costa Rica', ['CU'] = 'Cuba', ['CV'] = 'Cape Verde', ['CW'] = 'Curacao', ['CY'] = 'Cyprus', ['CZ'] = 'Czech Republic', ['DE'] = 'Germany', ['DJ'] = 'Djibouti', ['DK'] = 'Denmark', ['DM'] = 'Dominica', ['DO'] = 'Dominican Republic', ['DZ'] = 'Algeria', ['EC'] = 'Ecuador', ['EE'] = 'Estonia', ['EG'] = 'Egypt', ['EH'] = 'Western Sahara', ['ER'] = 'Eritrea', ['ES'] = 'Spain', ['ET'] = 'Ethiopia', ['FI'] = 'Finland', ['FJ'] = 'Fiji', ['FK'] = 'Malvinas', ['FO'] = 'Faroe Islands', ['FR'] = 'France', ['GA'] = 'Gabon', ['GB'] = 'United Kingdom', ['GD'] = 'Grenada', ['GE'] = 'Georgia', ['GG'] = 'Guernsey', ['GH'] = 'Ghana', ['GI'] = 'Gibraltar', ['GL'] = 'Greenland', ['GM'] = 'Gambia', ['GN'] = 'Guinea', ['GQ'] = 'Equatorial Guinea', ['GR'] = 'Greece', ['GT'] = 'Guatemala', ['GW'] = 'Guinea-Bissau', ['GY'] = 'Guyana', ['HN'] = 'Honduras', ['HR'] = 'Croatia', ['HT'] = 'Haiti', ['HU'] = 'Hungary', ['ID'] = 'Indonesia', ['IE'] = 'Ireland', ['IL'] = 'Israel', ['IM'] = 'Isle of Man', ['IN'] = 'India', ['IQ'] = 'Iraq', ['IR'] = 'Iran', ['IS'] = 'Iceland', ['IT'] = 'Italy', ['JE'] = 'Jersey', ['JM'] = 'Jamaica', ['JO'] = 'Jordan', ['JP'] = 'Japan', ['KE'] = 'Kenya', ['KG'] = 'Kyrgyzstan', ['KH'] = 'Cambodia', ['KI'] = 'Kiribati', ['KM'] = 'Comoros', ['KN'] = 'Saint Kitts and Nevis', ['KP'] = 'Korea', ['KR'] = 'Korea', ['KW'] = 'Kuwait', ['KY'] = 'Cayman Islands', ['KZ'] = 'Kazakhstan', ['LA'] = 'Lao People?s Republic', ['LB'] = 'Lebanon', ['LC'] = 'Saint Lucia', ['LI'] = 'Liechtenstein', ['LK'] = 'Sri Lanka', ['LR'] = 'Liberia', ['LS'] = 'Lesotho', ['LT'] = 'Lithuania', ['LU'] = 'Luxembourg', ['LV'] = 'Latvia', ['LY'] = 'Libyan Arab Jamahiriya', ['MA'] = 'Morocco', ['MC'] = 'Monaco', ['MD'] = 'Moldova', ['ME'] = 'Montenegro', ['MG'] = 'Madagascar', ['MK'] = 'Macedonia', ['ML'] = 'Mali', ['MM'] = 'Myanmar', ['MN'] = 'Mongolia', ['MO'] = 'Macao', ['MP'] = 'Northern Mariana Islands', ['MR'] = 'Mauritania', ['MS'] = 'Montserrat', ['MT'] = 'Malta', ['MU'] = 'Mauritius', ['MV'] = 'Maldives', ['MW'] = 'Malawi', ['MX'] = 'Mexico', ['MY'] = 'Malaysia', ['MZ'] = 'Mozambique', ['NA'] = 'Namibia', ['NE'] = 'Niger', ['NG'] = 'Nigeria', ['NI'] = 'Nicaragua', ['NL'] = 'Netherlands', ['NO'] = 'Norway', ['NP'] = 'Nepal', ['NR'] = 'Nauru', ['NZ'] = 'New Zealand', ['OM'] = 'Oman', ['PA'] = 'Panama', ['PE'] = 'Peru', ['PG'] = 'Papua New Guinea', ['PH'] = 'Philippines', ['PK'] = 'Pakistan', ['PL'] = 'Poland', ['PT'] = 'Portugal', ['PW'] = 'Palau', ['PY'] = 'Paraguay', ['QA'] = 'Qatar', ['RO'] = 'Romania', ['RS'] = 'Serbia', ['RU'] = 'Russian Federation', ['RW'] = 'Rwanda', ['SA'] = 'Saudi Arabia', ['SB'] = 'Solomon Islands', ['SC'] = 'Seychelles', ['SD'] = 'Sudan', ['SE'] = 'Sweden', ['SG'] = 'Singapore', ['SH'] = 'Saint Helena', ['SI'] = 'Slovenia', ['SK'] = 'Slovakia', ['SL'] = 'Sierra Leone', ['SM'] = 'San Marino', ['SN'] = 'Senegal', ['SO'] = 'Somalia', ['SR'] = 'Suriname', ['ST'] = 'Sao Tome and Principe', ['SV'] = 'Salvador', ['SX'] = 'Sint Maarten (Dutch part)', ['SY'] = 'Syrian Arab Republic', ['SZ'] = 'Swaziland', ['TC'] = 'Turks and Caicos Islands', ['TD'] = 'Chad', ['TG'] = 'Togo', ['TH'] = 'Thailand', ['TJ'] = 'Tajikistan', ['TL'] = 'Timor?Leste', ['TM'] = 'Turkmenistan', ['TN'] = 'Tunisia', ['TO'] = 'Tonga', ['TR'] = 'Turkey', ['TT'] = 'Trinidad and Tobago', ['TV'] = 'Tuvalu', ['TW'] = 'Taiwan', ['TZ'] = 'Tanzania', ['UA'] = 'Ukraine', ['UG'] = 'Uganda', ['US'] = 'United States of America', ['UY'] = 'Uruguay', ['UZ'] = 'Uzbekistan', ['VA'] = 'Holy See', ['VC'] = 'Saint Vincent', ['VE'] = 'Venezuela', ['VG'] = 'Virgin Islands', ['VN'] = 'Viet Nam', ['VU'] = 'Vanuatu', ['WS'] = 'Samoa', ['YE'] = 'Yemen', ['ZA'] = 'South Africa', ['ZZ'] = 'n/a', ['ZM'] = 'Zambia', } function showHome () local countryCode = exports["admin"]:getPlayerCountry(source) setElementData(source,"country",countryNames[countryCode]) outputChatBox(getPlayerName(source) .." has joined the game. [".. tostring(countryNames[countryCode]) .."]",getRootElement(), 255, 255, 255, true ) end addEventHandler("onPlayerJoin",getRootElement(),showHome) use this one Link to comment
Al3grab Posted March 25, 2012 Share Posted March 25, 2012 Are you testing it in a local server ? Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 Are you testing it in a local server ? Yes i tested..but..look in this lua local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" } function onJoin( ) local country = exports['admin']:getPlayerCountry( source ) if not country then country = 'N/A' end setElementData( source,'Country', country ) outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. country ~= 'N/A' and countryNames[ tostring( country ) ] or 'N/A', root, 255, 100, 100 ) end addEventHandler ( "onPlayerJoin", root, onJoin ) When player join,writing only: N/A and nothing else.. Link to comment
drk Posted March 26, 2012 Share Posted March 26, 2012 It doesn't work with local. You need join from external IP or from other machine. Link to comment
Al3grab Posted March 26, 2012 Share Posted March 26, 2012 Are you testing it in a local server ? Yes i tested..but..look in this lua local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" } function onJoin( ) local country = exports['admin']:getPlayerCountry( source ) if not country then country = 'N/A' end setElementData( source,'Country', country ) outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. country ~= 'N/A' and countryNames[ tostring( country ) ] or 'N/A', root, 255, 100, 100 ) end addEventHandler ( "onPlayerJoin", root, onJoin ) When player join,writing only: N/A and nothing else.. You cant test it in a local server , your ip will be 127.0.0.1 and that is your localhost ip address .. you need to test it in another server Link to comment
drk Posted March 26, 2012 Share Posted March 26, 2012 Are you testing it in a local server ? Yes i tested..but..look in this lua local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" } function onJoin( ) local country = exports['admin']:getPlayerCountry( source ) if not country then country = 'N/A' end setElementData( source,'Country', country ) outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. country ~= 'N/A' and countryNames[ tostring( country ) ] or 'N/A', root, 255, 100, 100 ) end addEventHandler ( "onPlayerJoin", root, onJoin ) When player join,writing only: N/A and nothing else.. You cant test it in a local server , your ip will be 127.0.0.1 and that is your localhost ip address .. you need to test it in another server He can simply join from external IP. Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 Join from external IP. Dnt work.. Link to comment
drk Posted March 26, 2012 Share Posted March 26, 2012 (edited) local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" }; addEventHandler ( 'onPlayerJoin', root, function ( ) local country = exports [ 'admin' ]:getPlayerCountry ( source ); country = country or 'N/A' setElementData ( source, 'Country', country ); outputChatBox ( getPlayerName ( source ) .. ' has joined the game from ' .. tostring( getElementData ( source, 'Country' ) ), root, 255, 100, 100, false ); end ); Try. Edited March 26, 2012 by Guest Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" }; addEventHandler ( 'onPlayerJoin', root, function ( ) local country = exports [ 'admin' ]:getPlayerCountry ( source ); country = country or 'N/A' setElementData ( source, 'Country', country ); outputChatBox ( getPlayerName source ) .. ' has joined the game from ' .. country, root, 255, 100, 100, false ); end ); Try. Now when player join write PlayerName has joined the game from 'N/A' Link to comment
drk Posted March 26, 2012 Share Posted March 26, 2012 That's because your country is not in the table. You must add it to the table. Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 That's because your country is not in the table. You must add it to the table. i'm from Ukraine..country must showing..in scoreboard show.. Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 Copy my last code. Now dont work Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 Show errors. Oh sorry..work..but writing only PlayerName has joined the game from N/A Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" }; addEventHandler ( 'onPlayerJoin', root, function ( ) local country = exports [ 'admin' ]:getPlayerCountry ( source ); country = countryNames or 'N/A' setElementData ( source, 'Country', country ); outputChatBox ( getPlayerName ( source ) .. ' has joined the game from ' .. tostring( getElementData ( source, 'Country' ) ), root, 255, 100, 100, false ); end ); I try this and now write: PlayerName has joined the game from table: and number Link to comment
drk Posted March 26, 2012 Share Posted March 26, 2012 (edited) Ok. I wrote my code and it seems to work now. Here: local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" }; addEventHandler ( 'onPlayerJoin', root, function ( ) local myCountry = exports [ 'admin' ]:getPlayerCountry ( source ); setmetatable ( { theCountry = myCountry or 'N/A' }, countryNames ); if ( countryNames [ myCountry ] ) then outputChatBox ( getPlayerName ( source ) .. ' has joined the game from ' .. countryNames [ myCountry ], root, 255, 100, 100, false ); else outputChatBox ( getPlayerName ( source ) .. ' has joined the game from N/A', root, 255, 100, 100, false ); end end ) Edited March 26, 2012 by Guest Link to comment
Reflex# Posted March 26, 2012 Author Share Posted March 26, 2012 Ok. I wrote my code and it seems to work now.Here: local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" }; countryNames.__index = countryNames addEventHandler ( 'onPlayerJoin', root, function ( ) local myCountry = exports [ 'admin' ]:getPlayerCountry ( source ); setmetatable ( { theCountry = myCountry or 'N/A' }, countryNames ); if ( countryNames [ myCountry ] ) then outputChatBox ( getPlayerName ( source ) .. ' has joined the game from ' .. countryNames [ myCountry ], root, 255, 100, 100, false ); else outputChatBox ( getPlayerName ( source ) .. ' has joined the game from N/A', root, 255, 100, 100, false ); end end ) Yeah it work on local server..but write N/A..i'm from Ukraine..but thx you try hard to help me..you good guy 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