Jump to content

nxFairlywell

Members
  • Posts

    1,849
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by nxFairlywell

  1. انت حاط عنصر من اللوحه في الترايقر وهذا ماينفع تختلف من شخص لشخص GUI لأن حاط الميمو في الترايقر , وعناصر ليه حاط الميمو في الترايقر ؟
  2. ممم , اللغة تشبه للجافا بس لحدٍّ ما , حاولت اضبطه بس ما عرفت (voidعندك قوس ناقص ب سطر 31 (قوس اغلاق الـ + بعد ما تضيفه احذف اخر قوس
  3. مافيه خطأ , الكود كذا شغلته , انت وش الفكره اللي تبغى توصل لها ؟
  4. شوف يا صاحبي , هو الكود المفروض يكون شغال 100% لكن تأكد انت من اللاعبين هل جميعهم بنفس العالم اللي انت محدده أو لا
  5. الدي بق وش يقول ؟
  6. use these functions : getResources () -- this function returns a table, so you need a loop for get the resources getResourceName() -- use this function in the loop for get the name of the resource -- or use directly: restartResource(value) -- use this function in the loop when you want to restart the resource , value = value of the loop
  7. على اساس المنطق افرض اني بسويه على طريقتك مقاس شاشتي 1920x1080 مقاسات شاشة مصطفى 1366x768 ولتكن مقاسات المستطيل على هذا النحو x=683,y=200,width=64,height=64 طبعاً x = نصف شاشة مصطفى هل تعتقد ان 1366/1920 * x = نفس المقاس في شاشتي وشاشة مصطفى ؟؟ 1366 / 1920 = 0.711 يكون في نصف شاشتي ايضاً xمن البديهي اني ابغى الـ 0.711 * 683 = 485.6 x = 485.6 إذن 1920 و أنا متأكد تماماً ان نصف 485.6 لا يساوي لكن لو بالطريقه اللي حطيتها انا x/1366 = 0.5 0.5 * 1920 = 960 x = 960 هذي جات بالنص الآن #EDIT عفواً تأكدت من كودك و حصلتك قاسم شاشة اللاعب على شاشة المصمم وأنا احسبه العكس أعتذر
  8. ليه ؟ عندي نفس كرته والعب اللعبه ولو كان عندي تيتان راح ابقى العبها =L
  9. غريبه , جربت تحدث كرت الشاشه ؟
  10. أما إذا كنت تريد تجيب اللاعبين بدون ماتحدد الداتا إستخدم هذا ملف سيرفر فقط , لا يعمل في الكلينت * function table.findKey(tbl,key) if tbl and type(tbl) == "table" then if key and type(key) == "string" then for tblKey, _ in pairs (tbl) do if tblKey == key then return true end end return false else return false end end return false end function getPlayersInDimensionHaveSameData(players,dimension) if players and type(players) =="table" then if dimension and type(dimension) == "number" then local __players = {}; for k, player in ipairs (players) do if getElementDimension(player) == dimension then for _, data in ipairs (getAllElementData(player)) do if not (table.findKey(players,data)) then __players[data] = {}; end table.insert(__players[data],player); end end end for data, _ in pairs (__players) do if #__players[data] < 2 then __players[data] = nil; end end return __players end return false end return false end -- مثال local players = getElementsByType("player"); local __players = getPlayersInDimensionHaveSameData(players,5); for data, player in pairs (__players) do outputChatBox("Data name : "..data.." & Player name : "..getPlayerName(player):gsub("#%x%x%x%x%x%x",""),root); end
  11. : ارقمنتات اجباريه dimension data : ارقمنتات اختيارية players تقدر تحط جدول وتتحقق من اللاعبين المحددين اللي فيه dimension وتقدر ماتحط جدول وتتحقق من كل اللاعبين في السيرفر طبعاً اللي في العالم المحدد اللي هو function doPlayersHaveSameData(players,dimension,data) if dimension and type(dimension)=="number" and data and type(data) == "string" then if players and type(players) == "table" and #players > 0 then local playersHaveData = {}; for key, player in ipairs (players) do if player and isElement(player) and getElementType(player) == "player" and getElementDimension(player) == dimension then local plrData = getElementData(player,data); if plrData then table.insert(playersHaveData,player); end end end if #playersHaveData == #players then return true else return false end else local players = getElementsByType("player"); local playersHaveData = {}; for key, player in ipairs (players) do if player and isElement(player) and getElementType(player) == "player" and getElementDimension(player) == dimension then local plrData = getElementData(player,data); if plrData then table.insert(playersHaveData,player); end end end if #playersHaveData == #players then return true else return false end end end return false end -- Example : مثال players = {} players[1] = localPlayer; players[2] = localPlayer; if doPlayersHaveSameData(players,5,"myData") then outputChatBox("TRUE"); end -- مثال 2 : if doPlayersHaveSameData(5,"myData") then outputChatBox("TRUE"); end
  12. إذا وقفت على 5 دولار لا والله احذفه ولا ابيعه =D
  13. خطأ فادح , إذا قسمت عرض شاشة المصمم على شاشة اللاعب تساوي كارثة الطريقة الصحيحه كالتالي local screenWidth, screenHeight = guiGetScreenSize(); local desW,desH = 1366,768; dxDrawRectangle( 300/desW*screenWidth, 200/desH*screenHeight, 50/desW*screenWidth, 50/desH*screenHeight ); -- وهكذا مع : dxDrawText dxDrawImage ...etc
  14. ماراح تفرق معك غالباً (لأن القيمة في النهاية لا شيء او خاطئة وهي بنفس المعنى (غالباً
  15. جميل جداً و أتمنى مستقبلاً تطور السكربت و تضبط الواجهة استمر يا صاحبي
  16. Table = { {1,"Hello "}, {2,"World"}, }; local num = 0; local word = ""; for i = 1, #Table do if Table[ i ][ 1 ] > num then num = Table[ i ] [ 1 ]; word = type(Table[ i ] [ 2 ]) == "string" and Table[ i ] [ 2 ] or ""; end end print (tostring(num).." : "..word);
  17. ما قريت سطر الإيفنت كامل =D
  18. sound = playSound3D(link, -1233.9285888672, 456.3063659668, 6.4603748321533, true) addEventHandler("onClientSoundStarted", sound, function(rsn) if rsn == "play" and source == sound then length_s = getSoundLength(sound) outputChatBox(length_s,255,0,0,true) end end )
  19. قيمه ولا مفتاح ؟ اذا عندك جدول فيه ارقام سوي كذا Table = { 1,2,3,4,5,22,7,8,4 }; local num=0; for i = 1, #Table do if Table[i] > num then num=Table[i]; end end print(num)
×
×
  • Create New...