AHMED MOSTAFA Posted January 22, 2018 Share Posted January 22, 2018 ثلاث طرق لإنشاء وظيفة / أمر ------------------------------------------------------------------------------------- ----------------------------------- killerProject ----------------------------------- ------------------------------------------------------------------------------------- ---------------- [[ 1 ]] ---------------- ---------------- [[ 1 ]] ---------------- ---------------- [[ 1 ]] ---------------- function functionName ( Argument ) -- -- YourCode -- end functionName ( Argument ) setTimer ( functionName, 50, 0, Argument ) addEventHandler ( "EventName", root, functionName ) ---------------- [[ 2 ]] ---------------- ---------------- [[ 2 ]] ---------------- ---------------- [[ 2 ]] ---------------- functionName = function ( Argument ) -- -- YourCode -- end functionName ( Argument ) setTimer ( functionName, 50, 0, Argument ) addEventHandler ( "EventName", root, functionName ) ---------------- [[ 3 ]] ---------------- ---------------- [[ 3 ]] ---------------- ---------------- [[ 3 ]] ---------------- addEventHandler ( "EventName", root, function ( Argument ) -- -- YourCode -- end ) setTimer ( function ( Argument ) -- -- YourCode -- end , 50, 0) ---------------- [[ Ex ]] ---------------- ---------------- [[ Ex ]] ---------------- ---------------- [[ Ex ]] ---------------- function functionName ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة مكتوب فيها -- end functionName ( "Hello" ) -- إشارة لأمر / وظيفة --- [[ Or ]] --- functionName = function ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة مكتوب فيها -- end functionName ( "Hello" ) -- إشارة لأمر / وظيفة ----------------------------------------- ----------------------------------------- ----------------------------------------- function functionName ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة تظهر كل 5 ثواني في الشات العام مكتوب فيها -- end --- [[ Or ]] --- function functionName ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة تظهر كل 5 ثواني في الشات العام مكتوب فيها -- end setTimer ( functionName, 5000, 0, "Hello" ) -- مؤقت ----------------------------------------- ----------------------------------------- ----------------------------------------- function functionName ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة تظهر كل 5 ثواني في الشات العام مكتوب فيها -- end --- [[ Or ]] --- function functionName ( Argument ) -- outputChatBox ( Argument ) -- Hello رسالة تظهر كل 5 ثواني في الشات العام مكتوب فيها -- end setTimer ( functionName, 5000, 0, "Hello" ) -- مؤقت ----------------------------------------- ----------------------------------------- ----------------------------------------- addEventHandler ( "onPlayerChat", root, function ( Text ) takePlayerMoney ( source, 1 ) -- اخذ 1 دولار عند ارسال رسالة outputChatBox ( getPlayerName ( source ) .. " : " .. Text ) -- اخراج الرسالة مع الاسم end ) --- [[ Or ]] --- onChat = function ( Text ) takePlayerMoney ( source, 1 ) -- اخذ 1 دولار عند ارسال رسالة outputChatBox ( getPlayerName ( source ) .. " : " .. Text ) -- اخراج الرسالة مع الاسم end addEventHandler ( "onPlayerChat", root, onChat ) -- حدث --- [[ Or ]] --- function onChat ( Text ) takePlayerMoney ( source, 1 ) -- اخذ 1 دولار عند ارسال رسالة outputChatBox ( getPlayerName ( source ) .. " : " .. Text ) -- اخراج الرسالة مع الاسم end addEventHandler ( "onPlayerChat", root, onChat ) -- حدث ----------------------------------------- ----------------------------------------- ----------------------------------------- 1 Link to comment
Guest Posted January 22, 2018 Share Posted January 22, 2018 الشرح روعةة مثل صآحبه , .. ! تقبل بصمتي البسيطة Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now