Arsilex Posted January 3, 2012 Share Posted January 3, 2012 g_Root = getRootElement() addEventHandler('onServerPlayerJoin', g_Root, local Home = call(getResourceFromName("admin"), "getPlayerCountry", source) setElementData(source,"Country") function() outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. getPlayerCountry(source) .. ' ', 219, 129, 129, true) end ) addEventHandler("onPlayerJoin",getRootElement()) Alguen me dice cual es mi error quero que cuando entre salga el pais del que entro Link to comment
Castillo Posted January 3, 2012 Share Posted January 3, 2012 addEventHandler("onPlayerJoin",root, local country = exports["admin"]:getPlayerCountry(source) setElementData(source,"Country",country) outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end ) Link to comment
Arsilex Posted January 3, 2012 Author Share Posted January 3, 2012 g_Root = getRootElement() addEventHandler('onClientPlayerJoin',g_Root, local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) function() outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end ) addEventHandler('onClientPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, 219, 129, 129, true) end ) addEventHandler('onClientPlayerQuit', g_Root, function(reason) outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', 255, 0, 0, true) end ) Y nada probe ponerlo en CLient-Side y en Server-Side y nada no funciona Link to comment
Castillo Posted January 3, 2012 Share Posted January 3, 2012 La funcion "getPlayerCountry" en el admin panel es server-side, no podes usarla client-side. -- server side: g_Root = getRootElement() addEventHandler('onPlayerJoin',g_Root, function () local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) end ) Link to comment
Arsilex Posted January 4, 2012 Author Share Posted January 4, 2012 Mira Castillo no se si soy yo o no se tio pero mira pongo joinquit g_Root = getRootElement() addEventHandler('onPlayerJoin',g_Root, local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement() 219, 129, 129, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement() 255, 0, 0, true) end ) Metal.xml Y aun asi no me sale nada Link to comment
Castillo Posted January 4, 2012 Share Posted January 4, 2012 Uhm, disculpa, copia mi codigo de nuevo, me habia olvidado de algo . Link to comment
Arsilex Posted January 4, 2012 Author Share Posted January 4, 2012 copie el codigo de nuevo y sigue sin ir Link to comment
Castillo Posted January 4, 2012 Share Posted January 4, 2012 Ya encontre el error: g_Root = getRootElement() addEventHandler('onPlayerJoin',g_Root, function () local country = exports['admin']:getPlayerCountry(source) setElementData(source,'Country',country) outputChatBox('[JOIN] #ffffff' .. getPlayerName(source) .. '#DB8181 joined game!' .. tostring(country) .. ' ', getRootElement(), 219, 129, 129, true) end ) addEventHandler('onPlayerChangeNick', g_Root, function(oldNick, newNick) outputChatBox('[Change-Nick] #ffffff' .. oldNick .. '#DB8181 is now known as #ffffff' .. newNick, getRootElement(), 219, 129, 129, true) end ) addEventHandler('onPlayerQuit', g_Root, function(reason) outputChatBox('[' .. reason .. '] #ffffff' .. getPlayerName(source) .. ' #DB8181disconnected.', getRootElement(), 255, 0, 0, true) end ) Link to comment
Arsilex Posted January 4, 2012 Author Share Posted January 4, 2012 Ya Funciona Gracias Castillo Link to comment
Serginix Posted January 9, 2012 Share Posted January 9, 2012 Lol, creo que en la comu habia un resource que hacia eso mismo con Scoreboard... Link to comment
Krujitoz Posted January 9, 2012 Share Posted January 9, 2012 Creo que era el countryid Link to comment
12p Posted January 9, 2012 Share Posted January 9, 2012 Y el autor es Timic. Vaya pendejo. Mi sugerencia es que escribas tú mismo el código tan pronto seas un scripter experimentado. Todo lo que Timic haya hecho, puede joder muchas cosas (CPU sobre todo, sus scripts son una mierda en optimizacion). Link to comment
Recommended Posts