MrXz Posted July 11, 2012 Share Posted July 11, 2012 Hola a todos, tengo un problema, tengo esto que cuando entras al servidor sale el país. Pero no funciona. Cual es el problema? =/ g_Root = getRootElement() function Initiate() country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end setElementData(source, "country", country) end addEventHandler('onPlayerJoin', g_Root, Initiate) addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() addEventHandler('onPlayerJoin', g_Root, function() country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end outputChatBox('#FF0000*ENTRANDO: #ffffff' .. getPlayerName(source) .. ' #339999Se ha Unido al server Desde #ffffff"'..country..'"#0fc0fc', getRootElement(), 255, 100, 100, true) setElementData(source, "country", country) end ) function() country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end setElementData(source, "country", country) end, 4000, 1) end ) aCountries = {} function getPlayerCountry ( player ) return getIpCountry ( getPlayerIP ( player ) ) end Link to comment
Arsilex Posted July 11, 2012 Share Posted July 11, 2012 Esta eso muy buen digo yo primero por que un evento no puede ser para dos function a la vez..... como en tu caso addEventHandler("onResourceStart",getResourceRootElement(getThisResource()),function() Te lo remodele un poco aver si te sirve. g_Root = getRootElement() function Initiate() country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end setElementData(source, "country", country) end addEventHandler('onPlayerJoin', g_Root, Initiate) addEventHandler('onPlayerJoin', g_Root, function() country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end outputChatBox('#FF0000*ENTRANDO: #ffffff' .. getPlayerName(source) .. ' #339999Se ha Unido al server Desde #ffffff"'..country..'"#0fc0fc', getRootElement(), 255, 100, 100, true) setElementData(source, "country", country) end ) addEventHandler("onResourceStart",getResourceRootElement(getThisResource(), function () country = getPlayerCountry(source) if country == nil or country == false then country = "n/a" end setElementData(source, "country", country) end, 4000, 1) ) aCountries = {} function getPlayerCountry ( player ) return getIpCountry ( getPlayerIP ( player ) ) end Link to comment
Carlossg Posted July 11, 2012 Share Posted July 11, 2012 No me explico porque hay 2 funciones con el mismo handler y que hacen lo mismo, es gastar recursos del servidor a lo tonto. Link to comment
BorderLine Posted July 11, 2012 Share Posted July 11, 2012 Me parece que debes darle derechos de admin o simplemente usa este https://community.multitheftauto.com/index.php?p= ... ls&id=1995 Link to comment
MrXz Posted July 11, 2012 Author Share Posted July 11, 2012 Muchas Gracias pekio. Si funciono Link to comment
Recommended Posts