Jump to content

exports


Recommended Posts

Posted (edited)

...السلام عليكم ورحمه الله وبركآته

... ياريت مثال بسيط على export,

كيف اسوي الكود والميتا ذذ ,

:)

Edited by Guest

Sha67 سابقاً

Posted

تضيف في الميتا حق المود إللي تبغى تستخرج منه الوظيفة :

function="functionName" type="server" />

وبعدين في المود إللي تبغى تستخدمها فيه تسوي كذا :

exports.resourceName:functionName( ... ) 
-- or 
exports[ "resourceName" ]:functionName( ... ) 
-- or  
call( getResourceFromName( "resourceName" ), "functionName", ... ) 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted

عادي سوي اي فنكشن على حسب مودك ذذ

function output( msg ) 
    outputChatBox( msg ) 
    outputServerLog( msg ) 
    outputDebugString( msg ) 
    outputConsole( msg ) 
    return true 
end 

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Posted
يعني مثلا لو على الكود الي فوق يصير كذا,

exports.NoName:output('Nothing') 

?

يب

----

مثآل آخر :

والكود إلي بداخله كذا The-Best-Script لنفرض أن السكربت حقكـ إلي تبي تتصل فيه إسمه :

-- Server Side # 
-- Script Name: The-Best-Script 
function theBest ( player ) 
    setElementFrozen ( player, not isElementFrozen ( player ) ) 
end 

من سكربت آخر ، رح تسوي كذا theBest الآن تبي تتصل بالوظيفة إلي بإسم :

-- Server Side # 
addEventHandler ( "onMarkerHit", root, 
    function ( plr ) 
        if ( getElementType ( plr ) == "player" ) then 
            exports [ "The-Best-Script" ]:theBest ( plr ) 
        end 
    end 
) 

بجانب سيرفر The-Best-Script بالميتا حقت السكربت إلي بإسم theBest طبعاً بالحالة ذي رح تعرف الوظيفة إلي بإسم

لأنه انت استخدمتها بجانب سيرفر ..

Posted

الله يعافيك ,,

" Keep Thinking Different . " - Steve Jops

--------------------

Don't send me PMs asking for help, I Won't reply !

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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