nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 وكيف اضيفها للسؤال ؟ يعني كيف اجيب السؤال الاول والثاني من التيبل Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 table [ "ما اسمي ؟" ] if ( table [ "ما اسمي ؟" ] == true ) then return "اجابة صحيحة ." else return "اجابة خاطئة" end Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 طيب يازاحف اقدر اضيف على return return isElementWithinMarker ? Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 هذا شي وهذا شي هذا مجرد مثال عشان تفهم وش تسوي . Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 تقصد اسويها كذا ؟ local Table = { [ "ما اسمي ؟" ] = true, [ "ما اسمكـ ؟" ] = false, } if ( Table [ "ما اسمي ؟" ] == true ) then and elseif isElementWithinMarker ( localPlayer, mrr1 ) then return "اجابة صحيحة ." elseif return "اجابة خاطئة" end Link to comment
#DRAGON!FIRE Posted July 20, 2014 Share Posted July 20, 2014 لأ .. سوي يوم يجي السؤال بالشات تحط له داتا او متغير ويوم يخش الماركر حق الصح تتحقق لو صح تسوي كودك لو غلط تسوي كودك ونفس الامر مع ماركر الغلط Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 هكزا local Table = { [ "ما اسمي ؟" ] = true, [ "ما اسمكـ ؟" ] = false, } local isElement1 = isElementWithinMarker ( localPlayer, mrr1 ) if ( Table [ "ما اسمي ؟" ] == true ) then elseif isElement1 then return "اجابة صحيحة ." elseif return "اجابة خاطئة" end Link to comment
nxFairlywell Posted July 20, 2014 Author Share Posted July 20, 2014 جبت العيد طيب كيف اتحقق وهذا السطر if ( Table [ "ما اسمي ؟" ] == true ) then قدام هذا isElementWithinMarker ^ يحتاج if Link to comment
#DRAGON!FIRE Posted July 21, 2014 Share Posted July 21, 2014 هذا مثال بسيط .. : marker = createMarker ( .... ) local table = { [ "ما اسمي ؟" ] = true, [ "ما اسمكـ ؟" ] = false, } local values = { "ما اسمي ؟", "ما اسمكـ ؟" } setElementData ( marker, "data", table[values[math.random(1,#values)]] ) addEventHandler ( "onMarkerHit", resourceRoot, function ( element ) if ( source == marker ) then if ( getElementType ( element ) == "player" ) then if ( getElementData ( marker, "data" ) == true ) then outputChatBox ( "* الاجابة هي صحيحة .", element ) else outputChatBox ( "* الاجابة هي خطا .", element ) end end end end ) Link to comment
#DRAGON!FIRE Posted July 21, 2014 Share Posted July 21, 2014 تشوفني مسوي مخرج شات بالسؤال مجرد مثال وانت سوي .. ولا اسويلك كل شي انا ؟ Link to comment
nxFairlywell Posted July 21, 2014 Author Share Posted July 21, 2014 لا بس اقلك يعني الحين سويت مخرج الشات بس اقصد السؤال الي في التيبل كيف اخليه يطلع بالشات Link to comment
nxFairlywell Posted July 21, 2014 Author Share Posted July 21, 2014 outputChatBox ( "السؤال : "..#values, source, 222, 1, 1, true ) Link to comment
#DRAGON!FIRE Posted July 21, 2014 Share Posted July 21, 2014 marker = createMarker ( .... ) local table = { [ "ما اسمي ؟" ] = true, [ "ما اسمكـ ؟" ] = false, } local values = { "ما اسمي ؟", "ما اسمكـ ؟" } local randomvalue = values[math.random(1,#values)] local random = table[randomvalue] setElementData ( marker, "data", random ) outputChatBox( "* السؤال : "..randomvalue, root ) addEventHandler ( "onMarkerHit", resourceRoot, function ( element ) if ( source == marker ) then if ( getElementType ( element ) == "player" ) then if ( getElementData ( marker, "data" ) == true ) then outputChatBox ( "* الاجابة هي صحيحة .", element ) else outputChatBox ( "* الاجابة هي خطا .", element ) end end end end ) Link to comment
nxFairlywell Posted July 21, 2014 Author Share Posted July 21, 2014 مشكورين ماكس وزاحف تعبتكم معي الصراحه بس اصبروا عاد مبتدأ ماهو فاهم التيبل ض1 Link to comment
Max+ Posted July 21, 2014 Share Posted July 21, 2014 مشكورين ماكس وزاحفتعبتكم معي الصراحه بس اصبروا عاد مبتدأ ماهو فاهم التيبل ض1 حياك الله , 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