Sasu Posted March 27, 2013 Posted March 27, 2013 Me explican como hacer un export? Y eso de return tambien. Muchas gracias. State: Inactive
Castillo Posted March 27, 2013 Posted March 27, 2013 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. Education is the most powerful weapon which you can use to change the world.
Sasu Posted March 27, 2013 Author Posted March 27, 2013 Y como paso argumentos como player, element, etc? Y me podes explicar un poco mejor el return? State: Inactive
Castillo Posted March 27, 2013 Posted March 27, 2013 Los pasas igual que en cualquier funcion. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Sasu Posted March 27, 2013 Author Posted March 27, 2013 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
Castillo Posted March 27, 2013 Posted March 27, 2013 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. Education is the most powerful weapon which you can use to change the world.
Sasu Posted March 27, 2013 Author Posted March 27, 2013 Y si quiero que la funcion sea buscar a un gang x nombre (getGangFromName) como deberia agregar el segundo argumento? State: Inactive
Castillo Posted March 27, 2013 Posted March 27, 2013 Igual que el primero... San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Sasu Posted March 27, 2013 Author Posted March 27, 2013 Ahh ok gracias. Cualquier cosa si nesecito ayuda posteo. State: Inactive
Castillo Posted March 27, 2013 Posted March 27, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts