xiRocKyz

Members
  • Content Count

    1,860
  • Joined

  • Days Won

    8

xiRocKyz last won the day on May 28 2019

xiRocKyz had the most liked content!

Community Reputation

312 Superstar

About xiRocKyz

  • Rank
    Jacker

Recent Profile Visitors

5,197 profile views
  1. وين مشكلتك بالضبط واطرح جدول players
  2. كودك مابيسوي اي فرق لان التيبل موجود اصلا وانت حاط IF NOT EXISTS اذا يبي يعدل على التيبل يقدر يمسحه وينشئه مرة ثانية مع الاضافات او ببساطة يستخدم ALTER TABLE
  3. جرب كذا local TiempoPr = getTickCount() addEvent("onPlayerSpray", true) addEventHandler("onPlayerSpray", root, function(rockets) local tick = getTickCount() if (tick - TiempoPr > 5000) then outputChatBox("Player #FFFFFF"..getPlayerName(source).." #FFFFFFhas shot #aacccc["..rockets.." #ffffffrockets in #ffffff"..math.floor((tick - TiempoPr) / 1000).." #ffffffseconds]", root, 255, 255, 255, true) TiempoPr = tick end end)
  4. حاول تعدل اسلوبك اذا تبي احد يساعدك المهم, سويت لك الكود على حسب الي فهمته منك ما جربته local tick = getTickCount() local from, to = test.moveX, 1; addEventHandler("onClientRender", root, function() local currentTick = getTickCount() local progress = (currentTick - tick) / 2000 local position = interpolateBetween(from, 0, 0, to, 0, 0, progress, "Linear") dxDrawText("FOR TESTING A SOMETHING ALPHA 1.0", sX*0.35-position, sY*0.15, 250, 250, tocolor(255, 255, 255, 255), 2.00, "default-build", "left", "center", false) if progress >= 1 then tick = currentTick from, to = to, from end end)
  5. Could you explain what is the problem ?
  6. local multiline = [[... multiline string ... ... ]]
  7. Here you go: characters = {"a", "b", "c"} function test(username) if string.find(username, "["..table.concat(characters, "").."]") then end end
  8. اتوقع هذا الي تبيه, جرب : 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)
  9. 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)
  10. getTickCount interpolateBetween
  11. Which code were you using, maybe you used the first code that I gave you not the second.
  12. 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)
  13. 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)
  14. 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