FatDai Posted February 22, 2019 Share Posted February 22, 2019 (edited) السلام عليكم ورحمة الله و بركاته بما اني تعلمت القليل من لغة برمجة لوا تعليم ذاتي واجهت مشكلة بسيطة في اللوب و ابحث عن حل ليها و يا ريت شرح بسيط للغلط الي وقعت فيه و شكرا مقدما... ملاحظة: check pass or failed بس عشان اعرف مصدر الخطأ code: local AdminSerials = { ["dai"] = { "D46516DC5E6FDDFF9D58BEF643086E42" } ["x"] = { "1D6F76CF8D7193792D13789849498452" } ["test2"] = { "D46516DC5E6FDDFF9D58BEF643086E42" } ["test1"] = { "1D6F76CF8D7193792D13789849498455" } } addEventHandler("onPlayerLogin", root, function() local serial = getPlayerSerial( source ) local check = getPlayerAccount( source ) for k, v in pairs ( AdminSerials ) do if v == serial then outputChatBox("check 1 passed",getRootElement()) if k == check then adminName = getPlayerName( source ) outputChatBox("#000000[#FF0000Server#000000]#FF0000 Admin "..adminName.." #FF0000Has Logged In!",getRootElement(),nil,nil,nil,true) else cancelEvent( true,"unauthorised login!") end end outputChatBox("check 1 failed",getRootElement()) end outputChatBox("check 2 failed",getRootElement()) end resault: check 1 failed check 1 failed check 1 failed check 1 failed check 2 failed أي الغلط باللوب فأرجو الافادة و اعتذر عالاطالة Edited February 22, 2019 by FatDai Link to comment
Rakan# Posted February 22, 2019 Share Posted February 22, 2019 local AdminSerials = { ["dai"] = "D46516DC5E6FDDFF9D58BEF643086E42", ["x"] = "1D6F76CF8D7193792D13789849498452", ["test2"] = "D46516DC5E6FDDFF9D58BEF643086E42", ["test1"] = "1D6F76CF8D7193792D13789849498455" } addEventHandler("onPlayerLogin", root, function() local serial = getPlayerSerial( source ) local check = getAccountName(getPlayerAccount( source )) for k, v in pairs ( AdminSerials ) do if v == serial then outputChatBox("check 1 passed",getRootElement()) if k == check then adminName = getPlayerName( source ) outputChatBox("#000000[#FF0000Server#000000]#FF0000 Admin "..adminName.." #FF0000Has Logged In!",getRootElement(),nil,nil,nil,true) else cancelEvent( true,"unauthorised login!") end end outputChatBox("check 1 failed",getRootElement()) end outputChatBox("check 2 failed",getRootElement()) end 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