imCEASER Posted December 13, 2014 Share Posted December 13, 2014 These resources are giving the following errors: ERROR: HelloMessages\script\server.lua:218: call: failed to call 'admin:getPlayerCountry' [string "?"]ERROR: HelloMessages\script\server.lua:220: attempt to concatenate field '?' (a nil value) ERROR: Scoreboard\scripts\dxscoreboard_exports.lua:260: call: failed to call 'admin:getPlayerCountry' HelloMessages\script\server.lua g_Root = getRootElement() countryNames = { AD="Andorra", AE="Arabian", AF="Afghanistan", AG="Antigua Bardura", AI="Anguilla", AL="Albania", AM="Armenia", AN="Netherlands Antilles", AO="Angola", AP="Asia", AR="Argentina", AS="American Samoa", AT="Austria", AU="Australia", AW="Aruba", AZ="Azerbaijan", BA="Bosnia Herzrgowina", BB="Barbados", BD="Bangladesh", BE="Belgium", BF="Burkina Faso", BG="Bulgaria", BH="Bahrain", BI="Burundi", BJ="Benin", BM="Bermuda", BN="Brunei Darussalam", BO="Bolivia", BR="Brasil", BS="Bahamas", BT="Bhutan", BW="Botswana", BY="Belarus", BZ="Belize", CA="Canada", CD="Congo The Democratic", CF="Centra African Republic", CH="Switzerland", CI="Cote Divoire", CK="Cook Isladinds", CL="Chile", CM="Cameroon", CN="China", CO="Colombia", CR="Costa Rica", CS="Serbia and Montenegro", CU="Cuba", CY="CY", CZ="Czech Republic", DE="Alemania", DJ="Djibouti", DK="Denmark", DO="Dominican Republic", DZ="Algeria", EC="Ecuador", EE="Estonia", EG="Egipto", ER="Eritrea", ES="España", ET="Ethiopia", EU="Europa", FI="Finland", FJ="Fiji", FM="Microdencia", FO="Faroe Islands", FR="Francia", GA="Gabon", GB="United Kingdom", GD="Grenada", GE="Gorgia", GF="Frech Guinia", GH="Ghana", GI="GibraItar", GL="Greenland", GM="Gambia", GR="Greece", GT="Guatelama", GU="Guam", GW="Guinea", GY="GUYANA", HK="HONG KONG", HN="HONDURAS", HR="Croacia", HT="Haiti", HU="Hungary", ID="Indonecia", IE="Ireland", IL="Isral", IN="India", IO="India Ocean", IQ="Iraq", IR="Iran", IS="Iceland", IT="Italia", JM="Jamaica", JO="Jorlan", JP="Japon", KE="Kenya", KG="Kyrgyzstan", KH="Cambodia", KI="Kiribati", KN="Saint Kitts And Nevis", KR="Korea", KW="Kuwait", KY="Cayman Islands", KZ="Kazakhstan", LA="Democratic Republic", LB="Lebaton", LC="Santa Lucia", LI="Liechtenstein", LK="Sri Lanka", LR="Liberia", LS="Lesotho", LT="LithuaniaI", LU="Luxembourg", LV="LATVIA", LY="Libyan Arab", MA="Morocco", MC="Monaco", MD="Moldoca Republic", MG="MadagascarA", MK="MK", ML="Malia", MM="Myanmar", MN="Mongolia", MO="MACAU", MP="MP", MR="Mauritania", MT="Malta", MU="Mauritius", MV="Maldives", MW="Malawi", MX="Mexcio", MY="Malaysia", MZ="Mozambique", NA="NAMIBIA", NC="NEW CALEDONIA", NE="Nigger", NF="Norfolk Island", NG="Nigeria", NI="Nicaragua", NL="Netherlands", NO="Norway", NP="Nepal", NR="Nauru", NU="Niuse", NZ="New Zealand", OM="Oman", PA="Parama", PE="Peru", PF="French Polynesia", PG="Papua New Guinea", PH="Philippines", PK="Pakistan", PL="Polonia", PR="Puerto Rico", PS="Palestian", PT="Portugal", PW="Palau", PY="Paraguay", QA="Qatar", RO="Romania", RU="Russian", RW="Rwanda", SA="Saudi Arabian", SB="Solomon Islands", SC="Seychelles", SD="Sudan", SE="Sweden", SG="Singapore", SI="Slovenia", SK="Slovak Republic", SL="Sierra Leone", SM="San Marino", SN="Senegal", SR="Suriname", SV="El Salvador", SY="Syrian Arab Republic", SZ="Swaziland", TG="Togo", TH="Thailand", TJ="Tajikistan", TM="Turkmenistan", TN="Tunisia", TO="Tonga", TR="Turkey", TT="Trinidad Tobago", TV="Tuvalu", TW="Taiwan Province China", TZ="Tanzania", UA="Ukranie", UG="Uganda", US="United States", UY="Uruguat", UZ="Uzbekistan", VA="Vatican City", VE="Venezuela", VG="Virgin Islands (British)", VI="Virgin Islands (U.S.)", VN="Vietnam", VU="Vauanuatu", WS="Samoa", YE="Yemen", YU="Formally Yugoslavia", ZA="Sudrafica", ZM="Zambia", ZW="Zimbabwe", ZZ="Reserved" } addEventHandler('onPlayerJoin',g_Root, function () local ping = getPlayerPing(source) local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..getPlayerName(source)..' #FFFFFFentrou no Servidor - País [#7EC0EE'.. countryNames[tostring(country)] ..'#FFFFFF] / Ping [#7EC0EE'..ping..'#FFFFFF]', getRootElement(), 126, 192, 238, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..oldNick..' #FFFFFFmudou o seu nick para: #7EC0EE'..newNick, getRootElement(), 126, 192, 238, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) if (reason == "Quit") then outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..getPlayerName(source)..' #FFFFFFsaiu do Servidor - Motivo [#FF0000SAIU#FFFFFF]', getRootElement(), 126, 192, 238, true) elseif (reason == "Timed out") then outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..getPlayerName(source)..' #FFFFFFsaiu do Servidor - Motivo [#FF0000NET CAIU#FFFFFF]', getRootElement(), 126, 192, 238, true) elseif (reason == "Banned") then outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..getPlayerName(source)..' #FFFFFFsaiu do Servidor - Motivo [#FF0000BANIDO#FFFFFF]', getRootElement(), 126, 192, 238, true) elseif (reason == "Kicked") then outputChatBox('['..getPlayerCount()..'#FFFFFF / #7EC0EE'..getMaxPlayers()..'] '..getPlayerName(source)..' #FFFFFFsaiu do Servidor - Motivo [#FF0000KICKADO#FFFFFF]', getRootElement(), 126, 192, 238, true) end end ) Scoreboard\scripts\dxscoreboard_exports.lua MAX_PRIRORITY_SLOT = 500 scoreboardColumns = { { ["name"] = "ID", ["width"] = 20, ["friendlyName"] = "ID", ["priority"] = 1 }, { ["name"] = "name", ["width"] = 200, ["friendlyName"] = "Name", ["priority"] = 2 }, { ["name"] = "fps", ["width"] = 30, ["friendlyName"] = "FPS", ["priority"] = 3 }, { ["name"] = "country", ["width"] = 140, ["friendlyName"] = "Country", ["priority"] = MAX_PRIRORITY_SLOT-1 }, { ["name"] = "ping", ["width"] = 40, ["friendlyName"] = "Ping", ["priority"] = MAX_PRIRORITY_SLOT } } resourceColumns = {} function toboolean( bool ) bool = tostring( bool ) if bool == "true" then return true elseif bool == "false" then return false else return nil end end forceShowTeams = toboolean( get( "forceShowTeams" ) ) or false forceHideTeams = toboolean( get( "forceHideTeams" ) ) or false allowColorcodedNames = toboolean( get( "allowColorcodedNames" ) ) or false scrollStep = tonumber( get( "scrollStep" ) ) or 1 local function iif( cond, arg1, arg2 ) if cond then return arg1 end return arg2 end function scoreboardAddColumn( name, forElement, width, friendlyName, priority ) if type( name ) == "string" then width = tonumber( width ) or 70 friendlyName = friendlyName or name priority = tonumber( priority ) or getNextFreePrioritySlot( scoreboardGetColumnPriority( "name" ) ) fixPrioritySlot( priority ) forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) if forElement == getRootElement() then if not (priority > MAX_PRIRORITY_SLOT or priority < 1) then for key, value in ipairs( scoreboardColumns ) do if name == value.name then return false end end table.insert( scoreboardColumns, { ["name"] = name, ["width"] = width, ["friendlyName"] = friendlyName, ["priority"] = priority } ) table.sort( scoreboardColumns, function ( a, b ) return a.priority < b.priority end ) if sourceResource then if not resourceColumns[sourceResource] then resourceColumns[sourceResource] = {} end table.insert ( resourceColumns[sourceResource], name ) end return triggerClientEvent( getRootElement(), "doScoreboardAddColumn", getRootElement(), name, width, friendlyName, priority, sourceResource ) end else return triggerClientEvent( forElement, "doScoreboardAddColumn", getRootElement(), name, width, friendlyName, priority, sourceResource ) end end return false end function scoreboardRemoveColumn( name, forElement ) if type( name ) == "string" then forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) if forElement == getRootElement() then for key, value in ipairs( scoreboardColumns ) do if name == value.name then table.remove( scoreboardColumns, key ) for resource, content in pairs( resourceColumns ) do table.removevalue( content, name ) end return triggerClientEvent( getRootElement(), "doScoreboardRemoveColumn", getRootElement(), name ) end end else return triggerClientEvent( forElement, "doScoreboardRemoveColumn", getRootElement(), name ) end end return false end function scoreboardClearColumns( forElement ) forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) if forElement == getRootElement() then while ( scoreboardColumns[1] ) do table.remove( scoreboardColumns, 1 ) resourceColumns = {} end return triggerClientEvent( getRootElement(), "doScoreboardClearColumns", getRootElement() ) else return triggerClientEvent( forElement, "doScoreboardClearColumns", getRootElement() ) end end function scoreboardResetColumns( forElement ) forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) if forElement == getRootElement() then while ( scoreboardColumns[1] ) do table.remove( scoreboardColumns, 1 ) resourceColumns = {} end local result = triggerClientEvent( getRootElement(), "doScoreboardResetColumns", getRootElement() ) if result then scoreboardAddColumn( "name", 200, "Name" ) scoreboardAddColumn( "ping", 40, "Ping" ) end return result else return triggerClientEvent( forElement, "doScoreboardResetColumns", getRootElement(), false ) end end function scoreboardSetForced( forced, forElement ) if type( forced ) == "boolean" then forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) return triggerClientEvent( forElement, "doScoreboardSetForced", getRootElement(), forced ) else return false end end function scoreboardSetSortBy( name, desc, forElement ) if type( name ) == "string" or name == nil then if name == nil then forElement = iif( type( desc ) == "userdata" and isElement( desc ), desc, getRootElement() ) else forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) end desc = iif( type( desc ) == "boolean", desc, true ) return triggerClientEvent( forElement, "doScoreboardSetSortBy", getRootElement(), name, desc ) else return false end end function scoreboardGetColumnPriority( name ) if type( name ) == "string" then for key, value in ipairs( scoreboardColumns ) do if name == value.name then return value.priority end end end return false end function scoreboardSetColumnPriority( name, priority, forElement ) if type( name ) == "string" and type( priority ) == "number" then if not (priority > MAX_PRIRORITY_SLOT or priority < 1) then forElement = iif( type( forElement ) == "userdata" and isElement( forElement ), forElement, getRootElement() ) if forElement == getRootElement() then local columnIndex = false for key, value in ipairs( scoreboardColumns ) do if name == value.name then columnIndex = key end end if columnIndex then scoreboardColumns[columnIndex].priority = -1 -- To empty out the current priority fixPrioritySlot( priority ) scoreboardColumns[columnIndex].priority = priority table.sort( scoreboardColumns, function ( a, b ) return a.priority < b.priority end ) return triggerClientEvent( forElement, "doScoreboardSetColumnPriority", getRootElement(), name, priority ) end else return triggerClientEvent( forElement, "doScoreboardSetColumnPriority", getRootElement(), name, priority ) end end end return false end function scoreboardForceTeamsVisible( enabled ) if type( enabled ) == "boolean" then forceShowTeams = enabled return true end return false end function scoreboardForceTeamsHidden( enabled ) if type( enabled ) == "boolean" then forceHideTeams = enabled return true end return false end function scoreboardGetColumnCount() return #scoreboardColumns end function onClientDXScoreboardResourceStart() for key, column in ipairs( scoreboardColumns ) do triggerClientEvent( client, "doScoreboardAddColumn", getRootElement(), column.name, column.width, column.friendlyName, column.priority ) end end addEvent( "onClientDXScoreboardResourceStart", true ) addEventHandler( "onClientDXScoreboardResourceStart", getResourceRootElement( getThisResource() ), onClientDXScoreboardResourceStart ) function requestServerInfoHandler() local mapmanager = getResourceFromName( "mapmanager" ) local output = {} output.forceshowteams = forceShowTeams output.forcehideteams = forceHideTeams output.allowcolorcodes = allowColorcodedNames output.scrollStep = scrollStep output.server = getServerName() output.players = getMaxPlayers() output.gamemode = false output.map = false if mapmanager and getResourceState( mapmanager ) == "running" then local gamemode = exports.mapmanager:getRunningGamemode() if gamemode then output.gamemode = getResourceInfo( gamemode, "name" ) or getResourceName( gamemode ) end local map = exports.mapmanager:getRunningGamemodeMap() if map then output.map = getResourceInfo( map, "name" ) or getResourceName( map ) end end triggerClientEvent( source, "sendServerInfo", getRootElement(), output ) end addEvent( "requestServerInfo", true ) addEventHandler( "requestServerInfo", getRootElement(), requestServerInfoHandler ) function removeResourceScoreboardColumns( resource ) if resourceColumns[resource] then while resourceColumns[resource][1] do local success = scoreboardRemoveColumn( resourceColumns[resource][1], getRootElement() ) if not success then break end end resourceColumns[resource] = nil end end addEventHandler( "onResourceStop", getRootElement(), removeResourceScoreboardColumns ) -- Compability addScoreboardColumn = function( name, forElement, position, size ) if type( size ) == "number" and size >= 0 and size <= 1.0 then size = size*700 end return scoreboardAddColumn( name, forElement, size, name, position ) end removeScoreboardColumn = scoreboardRemoveColumn resetScoreboardColumns = scoreboardResetColumns Link to comment
Buffalo Posted December 13, 2014 Share Posted December 13, 2014 Seems like you have admin resource turned off. Start it. Link to comment
imCEASER Posted December 13, 2014 Author Share Posted December 13, 2014 But the 'admin' resource is already on. Link to comment
Pipeekz Posted December 16, 2014 Share Posted December 16, 2014 Perhaps the admin does not get the country of the player for some other reason (Sorry for bad english ) In the scoreboard you changed the value "?" for other? Link to comment
imCEASER Posted December 17, 2014 Author Share Posted December 17, 2014 In the scoreboard you changed the value "?" for other? No Link to comment
Pipeekz Posted December 21, 2014 Share Posted December 21, 2014 You testing it in local server? 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