N3xT

Other Languages Moderators
  • Content Count

    2,432
  • Joined

  • Days Won

    16

Everything posted by N3xT

  1. مشكلتك بالشادر نفسه, دور لك على شادر أفضل وعدل شوي على اكوادك وبيزبط معك
  2. N3xT

    سؤال

    for _,v in pairs (markers) do pairs = ipairs
  3. playerPodium = info info تأكد من قيمة
  4. وليس جدول nil قاعد تسوي لوب على
  5. الكود الأول ماني متأكد اذا راح يشتغل معك local dataTable = getElementData ( player, "Data" ) dataTable[2] = true setElementData ( player, "Data", dataTable ) -- local dataTable = getElementData ( player, "Data" ) setElementData ( player, "Data", { dataTable[1], true, dataTable[3], dataTable[4], dataTable[5] } )
  6. للتوضيح, اي سكربت يشتغل راح يشتغل معاه الكود بسبب الحدث resourceRoot الصحيح تعديله الى
  7. Just use this code @juaosilv
  8. يمنع تكرار الضغط على ازرار معينة
  9. N3xT

    trigger ._.

    طيب ما ارسلت تريقر للسيرفر عشان تشوف اذا ادمن ولا لا
  10. كودك خطأ, واحياناً ممكن اللاعب يقدر يرسل رسالة وعليه ميوت الطريقة الصحيحة, كود ارسال الرسالة يكون عند وصول الحدث من السيرفر ايضاً حاول ما تكرر اسماء الأحداث مستقبلاً, واستعمالك للمتغيرات بالسيرفر ماله داعي, تحقق وارسل الحدث مباشرةً
  11. الموضوع مبهم وغير واضح, انت تعرض خدماتك ولا تبحث عن مبرمج؟
  12. save the player serial in a table instead of element datas table[serial] = true table[serial] = nil
  13. غالباً المشكلة من نفس استعمالك للكود, حط الاحداثيات الاساسية فقط بكودك ما يحتاج اي عمليات حسابية
  14. I guess you didn't check them otherwise you would have understood what I'm talking about. addEventHandler ( "onClientRender", g_Root, function() local x,y,z = getCameraMatrix() for player in pairs(nametags) do while true do if not isPedInVehicle(player) or isPedDead(player) then break end local vehicle = getPedOccupiedVehicle(player) local px,py,pz = getElementPosition ( vehicle ) local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz ) if pdistance <= NAMETAG_DISTANCE then local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 ) if not sx or not sy then break end local scale = 1/(NAMETAG_SCALE * (pdistance / NAMETAG_DISTANCE)) local alpha = ((pdistance - NAMETAG_ALPHA_DISTANCE) / NAMETAG_ALPHA_DIFF) alpha = (alpha < 0) and NAMETAG_ALPHA or NAMETAG_ALPHA-(alpha*NAMETAG_ALPHA) scale = math.evalCurve(maxScaleCurve,scale) local textscale = math.evalCurve(textScaleCurve,scale) local textalpha = math.evalCurve(textAlphaCurve,alpha) local outlineThickness = NAMETAG_OUTLINE_THICKNESS*(scale) local r,g,b = 255,255,255 local team = getPlayerTeam(player) if team then r,g,b = getTeamColor(team) end local offset = (scale) * NAMETAG_TEXT_BAR_SPACE/2 dxDrawText ( getPlayerName(player), sx, sy - offset, sx, sy - offset, tocolor(r,g,b,textalpha), textscale*NAMETAG_TEXTSIZE, "default", "center", "bottom", false, false, false ) end break end end end ) And you can do the same like that: local playersUsingMic = {} local x, y = guiGetScreenSize ( ) local sx, sy = 1600, 900 function onStartVoiceChat() local myIndex = getMyValue(source) if (not myIndex or not playersUsingMic[myIndex]) then local p_id = getElementData (source, "ID") or "0" table.insert(playersUsingMic, {source, p_id}) end end addEventHandler("onClientPlayerVoiceStart", root, onStartVoiceChat) function onStopVoiceChat() local myIndex = getMyValue(source) if ( myIndex ) then table.remove(playersUsingMic, myIndex) end end addEventHandler("onClientPlayerVoiceStop", root, onStopVoiceChat) function drawText() if (#playersUsingMic > 0) then for i, v in ipairs(playersUsingMic) do local x, y, z = getElementPosition(v[1]) local x2, y2, z2 = getElementPosition(localPlayer) local distance = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if (distance <= 15) then -- Your dx functions end end end end addEventHandler("onClientRender", root, drawText) function getMyValue(player) for i, v in ipairs(playersUsingMic) do if v[1] == player then return i end end end
  15. I'm not talking about dx functions, a lot of developers thinks that using anything but dx functions inside a render is wrong and might harm your server and things like that, I'm not saying that's true nor false. depends on the way you use the render but do you think using a function like getElementPosition inside a render is wrong? totally not. when I told you race nametags are using the same method I meant getting the position of the player and calculating the scale of the text and we've been using it for years now and I've never seen anybody complain about it, you can check race gamemode and you'll get the full picture of what I'm talking about. and yeah, the same goes for timers.
  16. You got it wrong. using onClientRender correctly won't harm the server performance at all there's a lot of scripts using the same method, for example, race name tags and there's more and more also, you can use variables with onClientPlayerVoiceStart & onClientPlayerVoiceStop to determine if the player using his microphone or not, however, you don't need this because you've already inserted the players using their microphones into a table so you can use this too.
  17. You can use onClientRender for this, and check his position
  18. N3xT

    سوال

    جربت كودي؟
  19. local target = getCameraTarget() if target and getElementType(target) == "player" then localp = target else localp = localPlayer end if(not localp) then return; end if(getPedOccupiedVehicle(localp)) then local veh2 = getPedOccupiedVehicle(localp); local nitro = getVehicleNitroLevel(veh2) or 0; if nitro ~= false and nitro ~= nil and nitro > 0 then dxDrawRectangle(hudbar.x*1.97,hudbar.y*1.83,hudbar.width/10*10*nitro,hudbar.height*0.5, tocolor(0,120,255, 230), false) end end end end
  20. 1920/1366 = 1.405563689604685 683 * 1.405563689604685 = ‭960‬ 1920 / 2 = 960
  21. على اي اساس حكمت ان كودي خطأ؟ يب
  22. طريقة حسابك خاطئة local screenWidth, screenHeight = guiGetScreenSize ( ) local resX, resY = (screenWidth/1366), (screenHeight/768) local _dxDrawRectangle = dxDrawRectangle function dxDrawRectangle ( x, y, width, height, color, postGUI ) _dxDrawRectangle ( resX * x, resY * y, resX * width, resY * height, color, postGUI ) end
  23. N3xT

    سوال

    الكود ينقصه بعض التحققات والتعديلات, لكن عموماً فكرته كذا تقريباً function doesPlayersHaveTheSameDataInDimension ( dataName, dataValue, dimension ) for k, v in ipairs ( getElementsByType ( "player" ) ) do if ( getElementDimension ( v ) == dimension ) then if ( getElementData ( v, dataName ) ~= dataValue ) then return false end end end return true end -- doesPlayersHaveTheSameDataInDimension ( العالم الوهمي, القيمة اللي المفروض الجميع عنده هي, اسم الداتا )
  24. كودي راح يحفظ على السيريال, بحيث انه لو اللاعب خرج ودخل ما راح تروح محاولاته وايضاً ما يحتاج تسجيل لدخول اللاعب عشان يغير اسمه local spam = { } spam.timerTime = 86400000 spam.allowedTimes = 2 spam.timer = {} spam.times = {} addEventHandler ( "onPlayerChangeNick", root, function ( ) local serial = getPlayerSerial ( source ) local times = spam.times[serial] or 0 if ( times >= spam.allowedTimes ) then cancelEvent ( ) kickPlayer ( source, "Console", "You've reached the maximum amount of changing your nickname" ) return end spam.times[serial] = times + 1 if ( not isTimer ( spam.timer[serial] ) ) then spam.timer[serial] = setTimer ( function ( serial ) spam.times[serial] = nil spam.timer[serial] = nil end, spam.timerTime, 1, serial ) end end )