A7M8D Posted January 31, 2018 Share Posted January 31, 2018 MissionsName = { [0] = "value1", [1] = "value2", [2] = "value3", } function outputNewValue() aValue = MissionsName[source] + 1 outputChatBox(""..aValue.."") end setTimer(outputNewValue,5000,0) في مشكلة هنا لاني ضعيف في الجداول عايزه يطلع قيمة واحد بعدين اتنين بعد تلاتة بعدين يبدا يعد من الاول شكرا مقدما Link to comment
Ahmed Ly Posted January 31, 2018 Share Posted January 31, 2018 MissionsName = { [0] = "value1", [1] = "value2", [2] = "value3", } function outputNewValue() for i = 0,#MissionsName do outputChatBox(""..MissionsName[i].."|"..i.."") end end setTimer(outputNewValue,5000,0) Link to comment
A7M8D Posted January 31, 2018 Author Share Posted January 31, 2018 @Ahmed Ly بيطلع 3 رسايل انا عايز كل 5 ثواني يطلع رسالة واحدة Link to comment
Abdul KariM Posted January 31, 2018 Share Posted January 31, 2018 جرب هذا MissionsName = { [1] = "value1", [2] = "value2", [3] = "value3", } aValue = 1 function outputNewValue( ) aValue = MissionsName [ aValue ] outputChatBox ( aValue ) if ( aValue > #MissionsName ) then aValue = 1 else aValue = aValue +1 end end setTimer( outputNewValue , 5000 , 0 ) Link to comment
Rockyz Posted January 31, 2018 Share Posted January 31, 2018 MissionsName = { [1] = 'value1', [2] = 'value2', [3] = 'value3', } aValue=1 function outputNewValue() outputChatBox(MissionsName[aValue]) aValue=(aValue+1)%#MissionsName end setTimer(outputNewValue, 5000, 0) Link to comment
Abdul KariM Posted January 31, 2018 Share Posted January 31, 2018 @#,+( _xiRoc[K]; > راجع كودك Link to comment
Rockyz Posted January 31, 2018 Share Posted January 31, 2018 5 minutes ago, Abdul KariM said: @#,+( _xiRoc[K]; > راجع كودك ؟؟ Link to comment
Abdul KariM Posted January 31, 2018 Share Posted January 31, 2018 8 minutes ago, #,+( _xiRoc[K]; > said: ؟؟ السطر هذا بكودك فيه غلط aValue=(aValue+1)%#MissionsName اوضحلك بشكل ثاني aValue=3%#MissionsName -- 3 عدد قيم الجدول وبتصير aValue=3%3 والنتيجة بتكون 0 وهذا خطأ لان مافي قيمة برقم 0 وحتى لو فيه يعتبر خطأ Link to comment
Rockyz Posted January 31, 2018 Share Posted January 31, 2018 (edited) 10 minutes ago, Abdul KariM said: السطر هذا بكودك فيه غلط aValue=(aValue+1)%#MissionsName اوضحلك بشكل ثاني aValue=3%#MissionsName -- 3 عدد قيم الجدول وبتصير aValue=3%3 والنتيجة بتكون 0 وهذا خطأ لان مافي قيمة برقم 0 وحتى لو فيه يعتبر خطأ يب فهمت قبل ماترد بس من زمان ماكتبت كود الكود يصير كذا : MissionsName = { [1] = 'value1', [2] = 'value2', [3] = 'value3', } aValue=1 function outputNewValue() if aValue>#MissionsName then aValue=1 end outputChatBox(MissionsName[aValue]) aValue = aValue+1 end setTimer(outputNewValue, 5000, 0) Edited January 31, 2018 by #,+( _xiRoc[K]; > Link to comment
Rockyz Posted January 31, 2018 Share Posted January 31, 2018 1 hour ago, Abdul KariM said: جرب هذا MissionsName = { [1] = "value1", [2] = "value2", [3] = "value3", } aValue = 1 function outputNewValue( ) aValue = MissionsName [ aValue ] outputChatBox ( aValue ) if ( aValue > #MissionsName ) then aValue = 1 else aValue = aValue +1 end end setTimer( outputNewValue , 5000 , 0 ) ولكن انت ايضا راجع كودك Link to comment
Abdul KariM Posted February 1, 2018 Share Posted February 1, 2018 @#,+( _xiRoc[K]; > امم ماشوف اي خطأ ممكن تقولي وش الخطا ؟ لان لي فترة طويلة مابرمجت Link to comment
Rockyz Posted February 1, 2018 Share Posted February 1, 2018 9 hours ago, Abdul KariM said: @#,+( _xiRoc[K]; > امم ماشوف اي خطأ ممكن تقولي وش الخطا ؟ لان لي فترة طويلة مابرمجت MissionsName = { [1] = "value1", [2] = "value2", [3] = "value3", } aValue = 1 -- Number function outputNewValue( ) aValue = MissionsName [ aValue ] -- String outputChatBox ( aValue ) if ( aValue > #MissionsName ) then -- String - Number aValue = 1 else aValue = aValue +1 end end setTimer( outputNewValue , 5000 , 0 ) 1 Link to comment
#Soking Posted February 2, 2018 Share Posted February 2, 2018 انت تبيه نظام مهمات لو بدئت وحده يشوف الـ بعدها !_! مابينفع كلينت سايد -- Server Side Table, NumberValue, SendMessage = { { 'Derby' }, { 'LastMan' }, { 'LastTeam' }, { 'Hunter' } }, 0, function ( ) NumberValue = ( ( NumberValue == #Table ) and 1 ) or NumberValue + 1 return outputChatBox( Table[NumberValue][1] ), '-_-' end setTimer( SendMessage, 1000, 0 ) Link to comment
^iiEcoo'x_) Posted February 2, 2018 Share Posted February 2, 2018 انا سويت مهمات ونظمتها , وسويتها كذا : Value = 'WarMission' setTimer ( function ( ) if ( Value == 'WarMission' ) then -- Function Start Of War Mission elseif ( Value == 'DerbyMission' ) then -- etc end end , 1000 * 2 , 1 ) 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