Jump to content

export


Sasu

Recommended Posts

Posted

Es muy simple, en el meta.xml pones asi:

function="tuFuncion" type="elTipoDeScript ( client o server )" /> 

Y luego para llamarla es asi:

exports [ "nombreDelRecurso" ]:tuFuncion ( ) 

Return: http://www.lua.org/pil/4.4.html

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 como paso argumentos como player, element, etc? Y me podes explicar un poco mejor el return?

State: Inactive

Posted

Los pasas igual que en cualquier funcion.

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

Por ejemplo:

function getPlayerGang ( player, gangName ) 
local gangName = getElementData ( player , "gang") 
end 
  
function exportedOtherScript(thePlayer) 
export.gang_system:getPlayerGang( thePlayer, "test") 
end 
  

Eso estaria bien?

State: Inactive

Posted

Si, pero te falta devolver el valor:

function getPlayerGang ( player ) 
    return getElementData ( player , "gang") 
end 
  
function exportedOtherScript ( thePlayer ) 
    gang = export.gang_system:getPlayerGang ( thePlayer ) 
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 si quiero que la funcion sea buscar a un gang x nombre (getGangFromName) como deberia agregar el segundo argumento?

State: Inactive

Posted

Igual que el primero...

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

De nada.

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.

  • Recently Browsing   0 members

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