Arsilex Posted January 3, 2012 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
Castillo Posted January 3, 2012 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 )
Arsilex Posted January 3, 2012 Author 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
Castillo Posted January 3, 2012 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 )
Arsilex Posted January 4, 2012 Author 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
Castillo Posted January 4, 2012 Posted January 4, 2012 Uhm, disculpa, copia mi codigo de nuevo, me habia olvidado de algo .
Castillo Posted January 4, 2012 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 )
Serginix Posted January 9, 2012 Posted January 9, 2012 Lol, creo que en la comu habia un resource que hacia eso mismo con Scoreboard...
12p Posted January 9, 2012 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).
Recommended Posts