Jump to content

Error NO lo ENTIENDO :|


Arsilex

Recommended Posts

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
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
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

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

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 :S

Link to comment

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...