xiRocKyz

Members
  • Content Count

    1,853
  • Joined

  • Days Won

    8

Everything posted by xiRocKyz

  1. اتوقع هذا الي تبيه, جرب : allowedwps = { [1] = true, [2] = true, [3] = true, [5] = true, [6] = true, [7] = true, [8] = true, } addEventHandler("onClientPlayerWeaponSwitch", root, function(previous_weapon, next_weapon) if getElementData(localPlayer, "nodm") == true then if not allowedwps[next_weapon] then cancelEvent() local current_weapon = (next_weapon+1)%13 while current_weapon ~= next_weapon do if allowedwps[current_weapon] then setPedWeaponSlot(localPlayer, current_weapon) break end current_weapon = (current_weapon+1)%13 end end end end)
  2. function replaceText() local text = guiGetText(source) local replacedText = text:gsub("[^A-Za-z0-9%._@]", "") if text ~= replacedText then guiSetText(source, replacedText) end end addEventHandler("onClientGUIChanged", login_edit, replaceText, false)
  3. getTickCount interpolateBetween
  4. Which code were you using, maybe you used the first code that I gave you not the second.
  5. Sorry, I missed up a little bit on the previous code and I didn't notice. Use this code instead : addEventHandler("onResourceStart", resourceRoot, function() local accounts = getAccounts() local accountsList = {} for index = 1, #statsList do accountsList[statsList[index][1]] = {} end for index = 1, #accounts do local account = accounts[index] for index = 1, #statsList do local key = statsList[index][1] local data = exports["ZA-account"]:getAccountData(account, key) local name = exports["ZA-account"]:getAccountData(account, "nick") if tonumber(data) then table.insert(accountsList[key], {name, tonumber(data)}) end end end for index = 1, #statsList do local accountsCount = #accountsList[statsList[index][1]] local accounts = {} if accountsCount >= 1 then table.sort(accountsList[statsList[index][1]], function(a, b) return a[2] > b[2] end) accounts = {unpack(accountsList[statsList[index][1]], 1, math.min(20, accountsCount))} end statsList[index][4] = accounts end end)
  6. addEventHandler("onResourceStart", resourceRoot, function() local accounts = getAccounts() local accountsList = {} local keys = {} for index = 1, #statsList do accountsList[statsList[index][1]] = {} table.insert(keys, statsList[index][1]) end for index = 1, #accounts do local account = accounts[index] local toRemove = {} for index = 1, #keys do local key = keys[index] local data = exports["ZA-account"]:getAccountData(account, key) local name = exports["ZA-account"]:getAccountData(account, "nick") if tonumber(data) then table.insert(accountsList[key], {name, tonumber(data)}) if accountsList[key] >= 20 then table.insert(toRemove, index) end end end for index = 1, #toRemove do table.remove(keys, toRemove[index]) end end for index = 1, #statsList do table.sort(accountsList[statsList[index][1]], function(a, b) return a[2] > b[2] end) statsList[index][4] = accountsList[statsList[index][1]] end end)
  7. If you want to whitelist the values that is in the table use this code: local zifr = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"} function editCheck() local chars = table.concat(zifr, ""):gsub("[%(%)%.%%%+%-%*%?%[%^%$]", "%%%1") local editText = guiGetText(source) local replacedText = editText:gsub("[^"..chars.."]", "") if editText ~= replacedText then guiSetText(source, replacedText) playSoundFrontEnd(2) end end addEventHandler("onClientGUIChanged", editMoney, editCheck, false) If you want to simply whitelist all the numbers use this code: function editCheck() local editText = guiGetText(source) local replacedText = editText:gsub("[^0-9]", "") if editText ~= replacedText then guiSetText(source, replacedText) playSoundFrontEnd(2) end end addEventHandler("onClientGUIChanged", editMoney, editCheck, false) * Both codes are not tested
  8. * Not tested local blacklisted = {"A", "a"} local edit = guiCreateEdit(...) function editCheck() local chars = table.concat(blacklisted, ""):gsub("[%(%)%.%%%+%-%*%?%[%^%$]", "%%%1") local editText = guiGetText(source) local replacedText = editText:gsub("["..chars.."]", "") if editText ~= replacedText then guiSetText(source, replacedText) end end addEventHandler("onClientGUIChanged", edit, editCheck, false)
  9. xiRocKyz

    سؤال

    فيه اكثر من طريقة outputChatBox(table.concat(myTable[1], ", "), source, 255, 0, 0) outputChatBox(myTable[1][1]..", "..myTable[1][2], source, 255, 0, 0)
  10. xiRocKyz

    سؤال

    مثالك غلط
  11. يمكن يقصد 1660 ti
  12. راجع معلوماتك https://wiki.multitheftauto.com/wiki/Element_tree
  13. الكرت عادي وش المشكلة 😂 و اصلا وش دخل عنق الزجاجة في مشكلته يمكن انت فاهم عنق الزجاجة غلط، لصاحب الموضوع تأكد دائما انك محدث النظام و كرت الشاشة
  14. replace "skin" on line 23 to "model" I know that the position is not going to change but if the position is not changed then his code is working already so he must have another script that changes the position
  15. You must get the player position when he dies not after the timer starts
  16. @HassoN Check your code again @holuzs That's not what he wanted Try this
  17. hosp_loc = { {-2655, 635, 14, 180}, -- San Fierro {2038, -1411, 17, 130}, --Jefferson {1173, -1323, 15, 270}, -- All Saints {1242, 327, 19, 340}, -- Red County {1609, 1816, 12, 360}, -- Las Venturas {-2200, -2311, 30, 320}, -- Angel Pine {-320, 1049, 20, 0}, --Fort Carson - Bone County {-1514.5, 2524, 56, 0} --Tierra Robada } addEventHandler("onPlayerWasted", root, function() setTimer(function(thePlayer, position, model) local positions = {} local px, py, pz = unpack(position) for index = 1, #hosp_loc do table.insert(positions, {getDistanceBetweenPoints3D(px, py, pz, unpack(hosp_loc[index], 1, 3)), hosp_loc[index]}) end table.sort(positions, function(a, b) return a[1] < b[1] end) local x, y, z, r = unpack(positions[1][2]) spawnPlayer(thePlayer, x, y, z, r, skin) fadeCamera(thePlayer, true, 2.5) end, 7500, 1, source, {getElementPosition(source)}, getElementModel(source)) end)
  18. addEventHandler("onClientSoundStarted", resourceRoot, function(reason) if source == mysound and reason == "play" then outputChatBox("started", 255, 0, 0, true) local length_s = getSoundLength(source) outputChatBox(tostring(length_s), 255, 0, 0, true) end end)
  19. انا اشوف من سنوات تقولون ان اللعبة انتهت ومن هذا الكلام، اذا انت او الي تعرفهم ما صرتوا تلعبوا اللعبة هذا ما يعني انها انتهت، ترا في الآف من الأشخاص غيرك يلعبونها، اذا تفكر ان اللعبة انتهت لمجرد انك انت او الي تعرفهم اعتزلوا فأنت غلطان و انا اصلا ما صرت العبها من زمان بس شوف كثير يقولون ان اللعبة انتهت
  20. السلام عليكم, استقبل طلبات البرمجة بمقابل مادي السعر الأدنى لأي طلب هو 5 دولار ويزيد السعر على حسب الوقت و الجهد المبذول طريقة الدفع المتوفرة حاليا هي PayPal للتواصل : Discord : xiRockyz#8488
  21. Visual studio code, و استخدم هذي الإضافة في البرنامج عشان اللعبة https://marketplace.visualstudio.com/items?itemName=subtixx.mtasa-Lua
  22. xiRocKyz

    Working limit

    for index = 1, #playersInJobs["job-name"] do if playersInJobs["job-name"][index] == element then table.remove(playersInJobs["job-name"], index) break end end