nxFairlywell Posted June 30, 2014 Posted June 30, 2014 السسلام عليكم ورحمة الله وبركاته , رمضان كريم وكل عام وانتو بخير وصحة ي شباب انا سويت قريد ليست حق انتقالات بس ابي منكم طلب الي هو " الكود الي لما يحدد اللاعب المكان من القريد ليست ويضغط على زر يخليه ينتقل لـمكان انا احدده بالكود في القريد لست row يعني كود يوزع احداثيات لكل امم مثلا الدائري احداثياته كذا كذا بالكود , لما يحدده اللاعب وبعدين يضغط على زر مثلا " موافق " ينقله للدائري وكذا مع باقي الاماكن وانتو خبره م يحتاج اشرح الطلب الي عارف الكود لا يبـخل علينا , #والسسسلآم_عليكممء_ورحمة_الله_وبركاته
nxFairlywell Posted June 30, 2014 Author Posted June 30, 2014 (edited) Thank's <$: ^ بسس كيف استخدم الكود Edited June 30, 2014 by Guest
nxFairlywell Posted June 30, 2014 Author Posted June 30, 2014 ي عيال ابي طريقة ربط row بـ زر لأني مسوي اكثر من رو يمكن 12 رو ذذ اسسف ازعجتكم بس بخلص المود اليوم ولاني عارف اكواد القريد لست
nxFairlywell Posted June 30, 2014 Author Posted June 30, 2014 (edited) شوف هنا , نفس طلبك , viewtopic.php?f=160&t=76908 تسلم ي ذيب الحين باقي كود الاحداثيات بروح الويكي ادوره Edited June 30, 2014 by Guest
nxFairlywell Posted June 30, 2014 Author Posted June 30, 2014 setElementPosition يجيء والله ضبط كفو والله ي ماكس عاجز عن شكرك
i,xAhmed Posted July 16, 2015 Posted July 16, 2015 addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == gridlist ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local text = guiGridListGetItemText ( gridlist, row, col ) setElementPosition(localPlayer,-5401.8640136719,-2044.1335449219,21.49062538147) setPedRotation(localPlayer,91.98) end end addEventHandler("onClientGUIClick", root, onGuiClick) end end end ) للمعلومية بعد م سويته كذا صار م يشتغل كليا
#|_oskar_|# Posted July 16, 2015 Posted July 16, 2015 addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == gridlist ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local text = guiGridListGetItemText ( gridlist, row, col ) setElementPosition(localPlayer,-5401.8640136719,-2044.1335449219,21.49062538147) setPedRotation(localPlayer,91.98) end end addEventHandler("onClientGUIClick", root, onGuiClick) end end end ) للمعلومية بعد م سويته كذا صار م يشتغل كليا ناقصك تسوى جدول للاماكن عشان تحطهم بالقريد
i S6O Posted July 16, 2015 Posted July 16, 2015 كيف طريقة الجداول ؟ List = { { x, y, z }, { x, y, z }, { x, y, z }, { x, y, z }, { x, y, z }, } -- Or Tabel = { [1] = { x, y, z }, [2] = { x, y, z }, [3] = { x, y, z }, [4] = { x, y, z }, }
#Wizard Posted July 17, 2015 Posted July 17, 2015 addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == gridlist ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local text = guiGridListGetItemText ( gridlist, row, col ) setElementPosition(localPlayer,-5401.8640136719,-2044.1335449219,21.49062538147) setPedRotation(localPlayer,91.98) end end addEventHandler("onClientGUIClick", root, onGuiClick) end end end ) للمعلومية بعد م سويته كذا صار م يشتغل كليا اولاً ياعقيد ماوضحت مرة له شوف ذا تنطيل وضح الشرح كــأإمل - viewtopic.php?f=164&t=89424 - - وش يقول لك الديبق ~؟
i,xAhmed Posted July 17, 2015 Posted July 17, 2015 شفت الديبق وحليت مشكلة المود م يشتغل وصار دبل كلك لاكن انا ابيه كمان الزر + يوديني لمكان محدد وسويت جدول هل صحيح هذا row = { {"المكان"}, {"الدايري", "x ,y ,z"}, {"الغروب", "xD,WxY,xS"}, {"الفروسية", "xD,xY,xS"}, } هذا الكود wnd = guiCreateWindow(0.28, 0.31, 0.45, 0.58, ".:[Warp System]:.", true) guiWindowSetMovable(wnd, false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "FFF30000") gridlist = guiCreateGridList(9, 70, 342, 225, false, wnd) guiGridListAddColumn(gridlist, "المكان", 0.9) for i = 1, 5 do guiGridListAddRow(gridlist) end guiGridListSetItemText(gridlist, 0, 1, "1- آلدايري", false, false) guiGridListSetItemColor(gridlist, 0, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 1, 1, "2- آلغروب", false, false) guiGridListSetItemColor(gridlist, 1, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 2, 1, "3- آلفروسية", false, false) guiGridListSetItemColor(gridlist, 2, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 3, 1, "4- آلنخيل", false, false) guiGridListSetItemColor(gridlist, 3, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 4, 1, "5- آلعوشزية", false, false) guiGridListSetItemColor(gridlist, 4, 1, 243, 0, 0, 255) btn = guiCreateButton(122, 307, 119, 31, "آنتقال", false, wnd) وهذا الدبل كلك addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == gridlist ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local ,xY,xS = setElementPosition(localPlayer,12, 3222, 1111) local ,WxY,xS = setElementPosition(localPlayer,32, 2311, 1132) setPedRotation(localPlayer,91.98) end end ) addEventHandler("onClientGUIClick", root, onGuiClick) انا ابي اخليهم دبل و زر ويرحو للمكان المحدد بس م ضبط والدبل الكلك يروحون كلهم لمكان واحد row = { {"المكان"}, {"الدايري", "x ,y ,z"}, {"الغروب", "xD,WxY,xS"}, {"الفروسية", "xD,xY,xS"}, } wnd = guiCreateWindow(0.28, 0.31, 0.45, 0.58, ".:[Warp System]:.", true) guiWindowSetMovable(wnd, false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "FFF30000") gridlist = guiCreateGridList(9, 70, 342, 225, false, wnd) guiGridListAddColumn(gridlist, "المكان", 0.9) for i = 1, 5 do guiGridListAddRow(gridlist) end guiGridListSetItemText(gridlist, 0, 1, "1- آلدايري", false, false) guiGridListSetItemColor(gridlist, 0, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 1, 1, "2- آلغروب", false, false) guiGridListSetItemColor(gridlist, 1, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 2, 1, "3- آلفروسية", false, false) guiGridListSetItemColor(gridlist, 2, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 3, 1, "4- آلنخيل", false, false) guiGridListSetItemColor(gridlist, 3, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 4, 1, "5- آلعوشزية", false, false) guiGridListSetItemColor(gridlist, 4, 1, 243, 0, 0, 255) btn = guiCreateButton(122, 307, 119, 31, "آنتقال", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFFF0000") -- Open Windows guiSetVisible (wnd, false) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( wnd, true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F2", "down", OpenWin) -- addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == row ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local text = guiGridListGetItemText ( gridlist, row, col ) local ,xY,xS = setElementPosition(localPlayer,12, 3222, 1111) local ,WxY,xS = setElementPosition(localPlayer,32, 2311, 1132) setPedRotation(localPlayer,91.98) end end ) -- function onGuiClick(button, state, absoluteX, absoluteY) if source == btn then local ,xY,xS = setElementPosition(localPlayer,12, 3222, 1111) local ,WxY,xS = setElementPosition(localPlayer,43, -508, 1132) setPedRotation(localPlayer,91.98) end end addEventHandler("onClientGUIClick", root, onGuiClick) guiSetProperty(d,"NormalTextColour", "FF00FF00")
Mr.R Posted July 17, 2015 Posted July 17, 2015 (edited) local WarpTable = { -- جدول { "الدائــــــــــري -1", 1815.40515, 870.14069, 10.53743 }, } for _,v in ipairs ( WarpTable ) do -- لوب للجدول local Row = guiGridListAddRow ( GridList ) -- هنا نسوي رو وكل مانضيف قيم بالجدول يضيف لها رو تلقائياً guiGridListSetItemText ( GridList, Row, 1, v[1], false, false ) -- نسوي تكست للقيمه الاولى بالجدول وهي اسم المكان عشان يطلع بالكولمن guiGridListSetItemData ( GridList, Row, 1, v[2] ) -- نسوي داتا للاحداثيات الي بالجدول end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == Button ) then -- اذا ضغط الزر if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then -- نتحقق انه اختار شيء من القريد ليست local getSelectPlayer = ( guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) ) -- نجلب الي اختارهـ setElementPosition ( localPlayer, getSelectPlayer ) -- ننقله للمكان الي اختارهـ else outputChatBox ( "! الرجاء اختيار مكان للانتقال إليه", 255, 0, 0, true ) -- لو ماختار مكان وضغط الزر end end end ) Edited July 17, 2015 by Guest
i,xAhmed Posted July 17, 2015 Posted July 17, 2015 WarpTable = { -- جدول { "الدائــــــــــري -1", 1815.40515, 870.14069, 10.53743 }, } for _,v in ipairs ( WarpTable ) do -- لوب للجدول local Row = guiGridListAddRow ( GridList ) -- هنا نسوي رو وكل مانضيف قيم بالجدول يضيف لها رو تلقائياً guiGridListSetItemText ( GridList, Row, 1, v[1], false, false ) -- نسوي تكست للقيمه الاولى بالجدول وهي اسم المكان عشان يطلع بالكولمن guiGridListSetItemData ( GridList, Row, 1, v[2] ) -- نسوي داتا للاحداثيات الي بالجدول end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == Button ) then -- اذا ضغط الزر if ( guiGridListGetSelectedItem ( GridList ) ~= -1 ) then -- نتحقق انه اختار شيء من القريد ليست local getSelectPlayer = ( guiGridListGetItemData ( GridList, guiGridListGetSelectedItem ( GridList ), 1 ) ) -- نجلب الي اختارهـ setElementPosition ( localPlayer, getSelectPlayer ) -- ننقله للمكان الي اختارهـ else outputChatBox ( "! الرجاء اختيار مكان للانتقال إليه", 255, 0, 0, true ) -- لو ماختار مكان وضغط الزر end end end ) كذا صح WarpTable = { -- جدول { "الدائــــــــــري -1", 1815.40515, 870.14069, 10.53743 }, } wnd = guiCreateWindow(0.28, 0.31, 0.45, 0.58, ".:[Warp System]:.", true) guiWindowSetMovable(wnd, false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "FFF30000") gridlist = guiCreateGridList(9, 70, 342, 225, false, wnd) guiGridListAddColumn(gridlist, "المكان", 0.9) for i = 1, 5 do guiGridListAddRow(gridlist) end guiGridListSetItemText(gridlist, 0, 1, "1- آلدايري", false, false) guiGridListSetItemColor(gridlist, 0, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 1, 1, "2- آلغروب", false, false) guiGridListSetItemColor(gridlist, 1, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 2, 1, "3- آلفروسية", false, false) guiGridListSetItemColor(gridlist, 2, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 3, 1, "4- آلنخيل", false, false) guiGridListSetItemColor(gridlist, 3, 1, 243, 0, 0, 255) guiGridListSetItemText(gridlist, 4, 1, "5- آلعوشزية", false, false) guiGridListSetItemColor(gridlist, 4, 1, 243, 0, 0, 255) btn = guiCreateButton(122, 307, 119, 31, "آنتقال", false, wnd) guiSetProperty(btn, "NormalTextColour", "FFFF0000") -- Open Windows guiSetVisible (wnd, false) function OpenWin() if guiGetVisible ( wnd ) then guiSetVisible ( wnd, false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( wnd, true ) showCursor(true) guiSetInputEnabled(true) end end bindKey("F2", "down", OpenWin) -- addEventHandler ("onClientGUIDoubleClick", root, function ( ) if ( source == row ) then local row, col = guiGridListGetSelectedItem ( gridlist ) if ( row == -1 ) then return end local text = guiGridListGetItemText ( gridlist, row, col ) local ,xY,xS = setElementPosition(localPlayer,12, 3222, 1111) local ,WxY,xS = setElementPosition(localPlayer,32, 2311, 1132) setPedRotation(localPlayer,91.98) end end ) -- for _,v in ipairs ( WarpTable ) do -- لوب للجدول local row = guiGridListAddRow ( gridList ) -- هنا نسوي رو وكل مانضيف قيم بالجدول يضيف لها رو تلقائياً guiGridListSetItemText ( gridList, row, 1, v[1], false, false ) -- نسوي تكست للقيمه الاولى بالجدول وهي اسم المكان عشان يطلع بالكولمن guiGridListSetItemData ( gridList, row, 1, v[2] ) -- نسوي داتا للاحداثيات الي بالجدول end addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn ) then -- اذا ضغط الزر if ( guiGridListGetSelectedItem ( gridList ) ~= -1 ) then -- نتحقق انه اختار شيء من القريد ليست local getSelectPlayer = ( guiGridListGetItemData ( gridList, guiGridListGetSelectedItem ( gridList ), 1 ) ) -- نجلب الي اختارهـ setElementPosition ( localPlayer, getSelectPlayer ) -- ننقله للمكان الي اختارهـ outputChatBox ( "! لقد تم نقلك", 255, 0, 0, true ) -- لو ماختار مكان وضغط الزر else outputChatBox ( "! الرجاء اختيار مكان للانتقال إليه", 255, 0, 0, true ) -- لو ماختار مكان وضغط الزر end end end ) + ممكن سكايب حقك
i,xAhmed Posted July 17, 2015 Posted July 17, 2015 ترا الكود لما اضغط على الدايري م ينقلني ولا شي جربت
Mr.R Posted July 18, 2015 Posted July 18, 2015 جرب كذا , ماني متأكد واذا فيه غلط شف الدي بوق وش يقول local WarpTable = { { "الدائــــــــــري -1", 1815.40515, 870.14069, 10.53743 }, { "النــــخــــيــــل -2", 2077.17993, 868.93744, 6.86413 }, } addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) wnd = guiCreateWindow(0.28, 0.31, 0.45, 0.58, ".:[Warp System]:.", true) guiWindowSetSizable(wnd, false) guiSetVisible ( wnd, false ) gridlist = guiCreateGridList(9, 70, 342, 225, false, wnd) guiGridListAddColumn(gridlist, "المكان", 0.9) for _,v in ipairs ( WarpTable ) do local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, 1, v[1], false, false ) guiGridListSetItemData ( gridlist, row, 1, v[2] ) end btn = guiCreateButton(122, 307, 119, 31, "آنتقال", false, wnd) end ) bindKey ( "F2", "down", function ( ) guiSetVisible ( wnd, not guiGetVisible ( wnd ) ) showCursor ( guiGetVisible ( wnd ) ) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) if ( source == btn ) then if ( guiGridListGetSelectedItem ( gridlist ) ~= -1 ) then local GetPlace = guiGridListGetItemText ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) local x, y, z = tonumber ( guiGridListGetItemData ( gridlist, guiGridListGetSelectedItem ( gridlist ), 1 ) ) setElementPosition ( localPlayer, x, y, z ) else outputChatBox ( "* الرجاء اختيار مكان للانتقال إليه", 255, 0, 0, true ) end end end )
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