AliAlanzi Posted August 2, 2017 Share Posted August 2, 2017 الحين انا عندي لوحة كل ما اشغل مود تجي على طول انا ابيها ما تجي الا بالامر و ابي الزر يسكرها كاتب الاكواد بس ما يسكرها و تجي بوجهي لمن اشغلها ليه؟ addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(509, 175, 311, 452, "Revive Panel", false) guiWindowSetSizable(window1, false) guiGetVisible( window1 ,false) gridlist1 = guiCreateGridList(13, 26, 288, 341, false, window1) guiGridListAddColumn(gridlist1, "Players", 0.9) Button1 = guiCreateButton(17, 379, 139, 63, "Revive Player", false, window1) Button2 = guiCreateButton(166, 379, 135, 63, "Close", false, window1) end ) addCommandHandler('rp', function () guiGetVisible(window1,not guiGetVisible(window1)) showCursor(guiGetVisible(window1)) end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button2) then guiGetVisible( window1 ,false) showCursor(false) end end ) و ابي كود يجيب اسماء لاعبين القريبين مني و يكون دمهم ناقص Link to comment
iMr.WiFi..! Posted August 2, 2017 Share Posted August 2, 2017 (edited) الطلب الأول : انت مستعمل guiGetVisible المفروض تستعمل guiSetVisible الطلب الثاني : سويت لك فنكشن بسيط يجيب اللاعبين الي حولك بالرينج المعين ,, بس انت عدله بحيث انه الي دمه اقل من المطلوب يضعه بالجريد ليست function isElementInRange(ele, x, y, z, range) if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -- returns true if it the range of the element to the main point is smaller than (or as big as) the maximum range. end return false end function changeGridListToPlayersAround ( gridlist, column, range ) if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist ) == 'gui-gridlist' then for i,v in ipairs ( getElementsByType ( 'player' ) ) do local x,y,z = getElementPosition ( localPlayer ) if isElementInRange ( v, x, y, z, range ) then local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, column, getPlayerName ( v ), false, false ) end end return true end return false end السينتاكس bool changeGridListToPlayerAround ( element gridlist, int column, int range ) مثال : function isElementInRange(ele, x, y, z, range) if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -- returns true if it the range of the element to the main point is smaller than (or as big as) the maximum range. end return false end function changeGridListToPlayersAround ( gridlist, column, range ) if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist ) == 'gui-gridlist' then for i,v in ipairs ( getElementsByType ( 'player' ) ) do local x,y,z = getElementPosition ( localPlayer ) if isElementInRange ( v, x, y, z, range ) then local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, column, getPlayerName ( v ), false, false ) end end return true end return false end mygridList = guiCreateGridList ( 13, 26, 288, 341, false ) guiSetVisible ( mygridList, not guiGetVisible ( mygridList ) ) guiGridListAddColumn( mygridList, "players:", 0.9 ) bindKey ( "1", "down", function ( ) guiSetVisible ( mygridList, not guiGetVisible ( mygridList ) ) showCursor ( not isCursorShowing () ) changeGridListToPlayersAround ( mygridList, 1, 20 ) end ) Edited August 2, 2017 by iMr.WiFi..! Link to comment
AliAlanzi Posted August 2, 2017 Author Share Posted August 2, 2017 rang اغيرها بالرقم الي ابيه صح؟ Link to comment
#BrosS Posted August 2, 2017 Share Posted August 2, 2017 23 minutes ago, Ghost-Gamer said: rang اغيرها بالرقم الي ابيه صح؟ rang المسافة Link to comment
AliAlanzi Posted August 2, 2017 Author Share Posted August 2, 2017 ادري قصدي امسح range و اخليه بالمساحة الي ابيها Link to comment
iMr.WiFi..! Posted August 2, 2017 Share Posted August 2, 2017 (edited) 7 minutes ago, Ghost-Gamer said: ادري قصدي امسح range و اخليه بالمساحة الي ابيها لا تلعب بالفنكشن , بس انت ضيف الفنكشن وحط الارقمنتات Edited August 2, 2017 by iMr.WiFi..! Link to comment
Abdul KariM Posted August 2, 2017 Share Posted August 2, 2017 @iMr.WiFi..! مفروض تضيف تحقق ان اللوكال بلاير ينافي الاعبين باللوب if ( v ~= getLocalPlayer ( ) ) then لانه راح يضيف اسمه بالقريد ليست وناقصك فنكشن guiGridListClear راح يكرر الاسماء بكل مره يفتح فيها النافذة 1 Link to comment
AliAlanzi Posted August 2, 2017 Author Share Posted August 2, 2017 طيب طيب ودي اسالك ما ابيه بس كذا مثلا الحين بسوي انه يعطيه دم طيب؟ الكود بستخدمه addEventHandler ( "onClientGUIClick",root, function () if (source == Button1) then setElementHealth( player, 100) guiSetVisible(window1,not guiSetVisible(window1)) showCursor(false) end end ) و لمن الشخص يدعس على زر رقم 1 يطلع تحميل و هذا الكود حقه ويسكر اللوحة addEventHandler("onClientResourceStart", resourceRoot, function() progressbar = guiCreateProgressBar(569, 519, 212, 27, false ) guiSetVisible(progressbar,false) local timee = guiProgressBarGetProgress(progressbar) setTimer( guiProgressBarSetProgress, 500, 1,progressbar,timee+10 ) setTimer( guiProgressBarSetProgress, 1000, 1,progressbar,timee+20 ) setTimer( guiProgressBarSetProgress, 1500, 1,progressbar,timee+30 ) setTimer( guiProgressBarSetProgress, 2000, 1,progressbar,timee+40 ) setTimer( guiProgressBarSetProgress, 2500, 1,progressbar,timee+50 ) setTimer( guiProgressBarSetProgress, 3000, 1,progressbar,timee+60 ) setTimer( guiProgressBarSetProgress, 3500, 1,progressbar,timee+70 ) setTimer( guiProgressBarSetProgress, 4000, 1,progressbar,timee+80 ) setTimer( guiProgressBarSetProgress, 4500, 1,progressbar,timee+90 ) setTimer( guiProgressBarSetProgress, 5000, 1,progressbar,timee+100 ) timer = setTimer(function () guiSetVisible(progressbar, false) guiProgressBarSetProgress(progressbar, 0) end,5000, 1) end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button1) then guiSetVisible( progressbar ,true) end end ) لاحظ الكود الاول انه guiSetVisible يعني ابيه يسكر اللوحة لمن يدعس الزر رقم 1 و لمن يدعس الزر رقم واحد شف الكود رقم 2 تلاقي اخر شي انه لمن يدعسه يطلع التحميل طيب انا ابيه لمن يدعس الزر يكون وقت محدد و يعطيه دم استخدم setTimer اذا في شي غلط انا مسويه قلي عليه Link to comment
AliAlanzi Posted August 3, 2017 Author Share Posted August 3, 2017 يا Wifi الكود حقك ما يشتغل ما يطلع لي اسم الاشخاص قريبين مني addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(509, 175, 311, 452, "Revive Panel", false) guiWindowSetSizable(window1, false) guiSetVisible( window1 ,false) gridlist1 = guiCreateGridList(13, 26, 288, 341, false, window1) guiGridListAddColumn(gridlist1, "Players", 0.9) Button1 = guiCreateButton(17, 379, 139, 63, "Revive Player", false, window1) Button2 = guiCreateButton(166, 379, 135, 63, "Close", false, window1) guiGridListClear(gridlist1 ) end ) addCommandHandler('rp', function () guiSetVisible(window1,not guiSetVisible(window1)) showCursor(guiGetVisible(window1)) end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button2) then guiSetVisible( window1 ,false) showCursor(false) end end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button1) then guiSetVisible( window1 ,false) guiSetVisible(progressbar,true) showCursor(false) end end ) function isElementInRange(ele, x, y, z, range) if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -- returns true if it the range of the element to the main point is smaller than (or as big as) the maximum range. end return false end function changeGridListToPlayersAround ( gridlist1, column, range ) if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist1 ) == 'gui-gridlist' then for i,v in ipairs ( getElementsByType ( 'player' ) ) do local x,y,z = getElementPosition ( localPlayer ) if isElementInRange ( v, x, y, z, range ) then local row = guiGridListAddRow ( gridlist1 ) guiGridListSetItemText ( gridlist1, row, column, getPlayerName ( v ), false, false ) if ( v ~= getLocalPlayer ( ) ) then end end return true end return false end end Link to comment
iMr.WiFi..! Posted August 3, 2017 Share Posted August 3, 2017 addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(509, 175, 311, 452, "Revive Panel", false) guiWindowSetSizable(window1, false) guiSetVisible( window1 ,false) gridlist1 = guiCreateGridList(13, 26, 288, 341, false, window1) guiGridListAddColumn(gridlist1, "Players", 0.9) Button1 = guiCreateButton(17, 379, 139, 63, "Revive Player", false, window1) Button2 = guiCreateButton(166, 379, 135, 63, "Close", false, window1) guiGridListClear(gridlist1 ) end ) addCommandHandler('rp', function () guiSetVisible(window1,not guiSetVisible(window1)) showCursor(guiGetVisible(window1)) changeGridListToPlayersAround ( gridlist1, 1, 5 ) end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button2) then guiSetVisible( window1 ,false) showCursor(false) end end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button1) then guiSetVisible( window1 ,false) guiSetVisible(progressbar,true) showCursor(false) end end ) function isElementInRange(ele, x, y, z, range) if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -- returns true if it the range of the element to the main point is smaller than (or as big as) the maximum range. end return false end function changeGridListToPlayersAround ( gridlist, column, range ) if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist ) == 'gui-gridlist' then guiGridListClear ( gridlist ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do if ( v == getLocalPlayer ( ) ) then return end local x,y,z = getElementPosition ( localPlayer ) if isElementInRange ( v, x, y, z, range ) then local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, column, getPlayerName ( v ), false, false ) end end return true else return false end end Link to comment
AliAlanzi Posted August 4, 2017 Author Share Posted August 4, 2017 12 hours ago, iMr.WiFi..! said: addEventHandler("onClientResourceStart", resourceRoot, function() window1 = guiCreateWindow(509, 175, 311, 452, "Revive Panel", false) guiWindowSetSizable(window1, false) guiSetVisible( window1 ,false) gridlist1 = guiCreateGridList(13, 26, 288, 341, false, window1) guiGridListAddColumn(gridlist1, "Players", 0.9) Button1 = guiCreateButton(17, 379, 139, 63, "Revive Player", false, window1) Button2 = guiCreateButton(166, 379, 135, 63, "Close", false, window1) guiGridListClear(gridlist1 ) end ) addCommandHandler('rp', function () guiSetVisible(window1,not guiSetVisible(window1)) showCursor(guiGetVisible(window1)) changeGridListToPlayersAround ( gridlist1, 1, 5 ) end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button2) then guiSetVisible( window1 ,false) showCursor(false) end end ) addEventHandler ( "onClientGUIClick",root, function () if (source == Button1) then guiSetVisible( window1 ,false) guiSetVisible(progressbar,true) showCursor(false) end end ) function isElementInRange(ele, x, y, z, range) if isElement(ele) and type(x) == "number" and type(y) == "number" and type(z) == "number" and type(range) == "number" then return getDistanceBetweenPoints3D(x, y, z, getElementPosition(ele)) <= range -- returns true if it the range of the element to the main point is smaller than (or as big as) the maximum range. end return false end function changeGridListToPlayersAround ( gridlist, column, range ) if type ( column ) == 'number' and type ( range ) == 'number' and getElementType ( gridlist ) == 'gui-gridlist' then guiGridListClear ( gridlist ) for i,v in ipairs ( getElementsByType ( 'player' ) ) do if ( v == getLocalPlayer ( ) ) then return end local x,y,z = getElementPosition ( localPlayer ) if isElementInRange ( v, x, y, z, range ) then local row = guiGridListAddRow ( gridlist ) guiGridListSetItemText ( gridlist, row, column, getPlayerName ( v ), false, false ) end end return true else return false end end وش سويت كان في خطا او شي؟ Link to comment
Rockyz Posted August 4, 2017 Share Posted August 4, 2017 مافي شي خطأ بس انت نسيت تحط هذا الحدث changeGridListToPlayersAround ( gridlist1, 1, 5 ) 1 Link to comment
AliAlanzi Posted August 4, 2017 Author Share Posted August 4, 2017 4 hours ago, #,+( _xiRoc[K]; > said: مافي شي خطأ بس انت نسيت تحط هذا الحدث changeGridListToPlayersAround ( gridlist1, 1, 5 ) هو اصلن موجود Link to comment
Rockyz Posted August 4, 2017 Share Posted August 4, 2017 24 minutes ago, Ghost-Gamer said: هو اصلن موجود $_$ addCommandHandler('rp', function () guiSetVisible(window1,not guiSetVisible(window1)) showCursor(guiGetVisible(window1)) end ) addCommandHandler('rp', function () guiSetVisible(window1,not guiSetVisible(window1)) showCursor(guiGetVisible(window1)) changeGridListToPlayersAround ( gridlist1, 1, 5 ) end ) 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