billal Posted April 27, 2016 Share Posted April 27, 2016 السلام عليكم انا عملت ماركر وحطيت اوبجكت باب يفتح بكلمة سر لكني بدي الكلمة تكون متغيرة لذلك استخدمت الكودlocal Pass = math.random (1, 10) لكن المشكلة يجيب رقم عشوائي من1الى10 * * * * انا بدي كلمة السر لا تتغير الا اذا طلعت من المركر ثم دخلت تاني مش تتغير عشوائي وانا داخل الماركر NaRoTu~~~~~~~~~~~~~~DZ Link to comment
Jupi Posted April 27, 2016 Share Posted April 27, 2016 "onMarkerLeave" removeCommandHandler addCommandHandler table + table.random بلنسبة ل table.random تلاقيها هنا https://wiki.multitheftauto.com/wiki/Table.random مع السورس كود بللتوفيق Link to comment
billal Posted April 27, 2016 Author Share Posted April 27, 2016 شكرا يا اصدقاء انا الحين راح اجرب اعملها Link to comment
#Soking Posted April 27, 2016 Share Posted April 27, 2016 دابل كيف بيستخدم removeCommandHandler وهو لازم يحدد الكلمه البده يشيلها وحنا مانعرف وش الكلمه لانه انت حاط table.random Link to comment
Jupi Posted April 27, 2016 Share Posted April 27, 2016 دابلكيف بيستخدم removeCommandHandler وهو لازم يحدد الكلمه البده يشيلها وحنا مانعرف وش الكلمه لانه انت حاط table.random اها صح ما تنبهت لها setElementData, getElementData Link to comment
billal Posted April 27, 2016 Author Share Posted April 27, 2016 كلينت Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"} Pass = math.random (#Pass) if Pass == 1 then Pass = "1" elseif Pass == 2 then Pass = "2" elseif Pass == 3 then Pass = "3" elseif Pass == 4 then Pass = "4" elseif Pass == 5 then Pass = "5" elseif Pass == 6 then Pass = "6" elseif Pass == 7 then Pass = "7" elseif Pass == 8 then Pass = "8" elseif Pass == 9 then Pass = "9" elseif Pass == 10 then Pass = "10" end addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end guiSetVisible ( window , true ) showCursor ( true ) end) addEventHandler('onClientGUIClick', button,function ( ) if guiGetText ( edit ) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window , false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false ) انا جربت كدا لكن ما ضبطت كلمة السر مش تتغير الا اذا رسترت المود بدي كلمة السر تتغير كلما اطلع من الماركر وادخله تاني تجي كلمة السر الجديدة Link to comment
iMr.SFA7 Posted April 27, 2016 Share Posted April 27, 2016 Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end Pass = math.random (#Pass) guiSetVisible ( window, true ) showCursor ( true ) end) addEventHandler('onClientGUIClick', button,function() if Pass and tonumber(guiGetText ( edit )) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window, false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false ) Link to comment
Jupi Posted April 27, 2016 Share Posted April 27, 2016 Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"} Pass = Pass[math.random(#Pass)] addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end guiSetVisible(window, true) showCursor(true) end) addEventHandler("onClientMarkerLeave", Marker, function (player) Pass = Pass[math.random(#Pass)] end ) addEventHandler('onClientGUIClick', button, function () if guiGetText ( edit ) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window , false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false ) Link to comment
billal Posted April 27, 2016 Author Share Posted April 27, 2016 Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end Pass = math.random (#Pass) guiSetVisible ( window, true ) showCursor ( true ) end) addEventHandler('onClientGUIClick', button,function() if Pass and tonumber(guiGetText ( edit )) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window, false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false ) يا سفاح لما اطلع من الماركر وارجع تاني مب تجي اللوحة Link to comment
billal Posted April 27, 2016 Author Share Posted April 27, 2016 Marker = createMarker ( -302.21, 1507.3, 75, "cylinder",4,0,0,0, 170 ) blip = createBlip (-302.21, 1507.3, 75, 56) window = guiCreateWindow(522, 239, 307, 180, "نظام فتح الباب المشفر", false) guiSetVisible (window , false ) edit = guiCreateEdit(82, 70, 150, 34, "", false, window ) button = guiCreateButton(118, 114, 78, 34, "فتح البوابة", false, window ) label = guiCreateLabel(82, 40, 155, 20, " ضع كلمة المرور هنا لفتح البوابة", false, window ) local Pass = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"} Pass = Pass[math.random(#Pass)] addEventHandler("onClientMarkerHit",Marker, function (player) if player ~= localPlayer then return end guiSetVisible(window, true) showCursor(true) end) addEventHandler("onClientMarkerLeave", Marker, function (player) Pass = Pass[math.random(#Pass)] end ) addEventHandler('onClientGUIClick', button, function () if guiGetText ( edit ) == Pass then triggerServerEvent('open', localPlayer) guiSetVisible ( window , false ) showCursor ( false ) outputChatBox('Welcome!',255,0,0,true) else --guiSetVisible ( window , false ) --showCursor ( false ) outputChatBox('Error!',255,0,0,true) end end, false ) ياDABL اول مرة يفتح الباب لكن لما اطلع من الماركر وارجع كل الارقام من1الى10مب تفتح Link to comment
billal Posted April 27, 2016 Author Share Posted April 27, 2016 طلب صغير بس بدي احط الرقم واكبس انتر بدل بوتون addEventHandler('onClientGUIClick', button,function ( ) Link to comment
iMr.SFA7 Posted April 27, 2016 Share Posted April 27, 2016 طلب صغير بس بدي احط الرقم واكبس انتر بدل بوتونaddEventHandler('onClientGUIClick', button,function ( ) أطرح أكوادك بعد ما عدلـت عليهـا وحليـت المشـكلة 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