Jump to content

Error NO lo ENTIENDO :|


Arsilex

Recommended Posts

Posted
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

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted
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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 :(

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted

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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted

Uhm, disculpa, copia mi codigo de nuevo, me habia olvidado de algo :P.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

  • Recently Browsing   0 members

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