Jump to content

Rockyz

Members
  • Posts

    1,862
  • Joined

  • Days Won

    8

Everything posted by Rockyz

  1. 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
  2. * 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)
  3. Rockyz

    سؤال

    فيه اكثر من طريقة outputChatBox(table.concat(myTable[1], ", "), source, 255, 0, 0) outputChatBox(myTable[1][1]..", "..myTable[1][2], source, 255, 0, 0)
  4. يمكن يقصد 1660 ti
  5. راجع معلوماتك https://wiki.multitheftauto.com/wiki/Element_tree
  6. الكرت عادي وش المشكلة ? و اصلا وش دخل عنق الزجاجة في مشكلته يمكن انت فاهم عنق الزجاجة غلط، لصاحب الموضوع تأكد دائما انك محدث النظام و كرت الشاشة
  7. 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
  8. You must get the player position when he dies not after the timer starts
  9. @HassoN Check your code again @holuzs That's not what he wanted Try this
  10. 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)
  11. 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)
  12. انا اشوف من سنوات تقولون ان اللعبة انتهت ومن هذا الكلام، اذا انت او الي تعرفهم ما صرتوا تلعبوا اللعبة هذا ما يعني انها انتهت، ترا في الآف من الأشخاص غيرك يلعبونها، اذا تفكر ان اللعبة انتهت لمجرد انك انت او الي تعرفهم اعتزلوا فأنت غلطان و انا اصلا ما صرت العبها من زمان بس شوف كثير يقولون ان اللعبة انتهت
  13. السلام عليكم, استقبل طلبات البرمجة بمقابل مادي السعر الأدنى لأي طلب هو 5 دولار ويزيد السعر على حسب الوقت و الجهد المبذول طريقة الدفع المتوفرة حاليا هي PayPal للتواصل : Discord : xiRockyz#8488
  14. Visual studio code, و استخدم هذي الإضافة في البرنامج عشان اللعبة https://marketplace.visualstudio.com/items?itemName=subtixx.mtasa-Lua
  15. Rockyz

    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
  16. للحين عندك اخطاء ..
  17. الي مسويه خطأ اول خطأ هو انك حطيت ال cancelEvent في اللوب ثاني شي حاط ال outputChatBox في اللوب و عندك اخطاء في السطر 16 و في اند زيادة و قوس ناقص
  18. وش مسوي انت ??
  19. تقدر، يمكن انت مسوي شي غلط و اقرأ الرابط الي عطيتك اياه عشان تفهم
  20. راجع كلامك https://wiki.multitheftauto.com/wiki/Element_tree
  21. راجع معلوماتك cache من اسمها يعني ما تخزن الملف يعني كل مرة لازم تحمل الملف و بالنسبة ل وش افضل اذا استخدمت fileDelete، الملف بيتحمل على هاردسك و رام اللاعب واذا خلص تحميل الملف بينحذف من الهاردسك و بيبقى على الرام و اذا استخدمت cache، الملف بيتحمل مباشرة على الرام و ما بيتحمل على الهاردسك و طبعا ان اشوف ان استخدام cache افضل و اكثر امان ولكن انصحك بتشفير الملف ايضا اذا تبي تضمن
  22. في اكثر من طريقة اذا تبي تضيف سطر جديد مثلا تقدر تستخدم \n وبيضيف سطر جديد عدلت على المثال شوي عشان تقدر تعدل عليه اسهل local sx, sy = guiGetScreenSize() local list = { buttons = {--{coordinates = {احداثيات الزر}, colors = {button = {لون الزر}, text = {لون ليبل الزر}}, text = "تيكست ليبل الزر", label = "تيكست الليبل"}, {coordinates = {(sx/2)-155, (sy/2), 100, 30}, colors = {button = {255, 0, 0, 255}, text = {255, 255, 255}}, text = "Button 1", label = "Label 1\n Hello World !"}, {coordinates = {(sx/2)-50, (sy/2), 100, 30}, colors = {button = {0, 255, 0, 255}, text = {255, 255, 255}}, text = "Button 2", label = "#00FF00Label 2\n\n Hello World !"}, {coordinates = {(sx/2)+55, (sy/2), 100, 30}, colors = {button = {0, 0, 255, 255}, text = {255, 255, 255}}, text = "Button 3", label = "#0000FFLabel 3\n\n\n Hello World !"}, }, label = { coordinates = {sx/2, (sy/2)+35, sx/2, (sy/2)+35}, -- احداثيات الليبل colors = {255, 0, 0, 255}, -- لون الليبل font = "default-bold", -- خط الليبل align = {x = "center", y = "top"} -- align الليبل }, selected = 1 } showCursor(true) addEventHandler("onClientRender", root, function() for key, value in ipairs(list.buttons) do local data = value.coordinates local alpha = 255-(isMouseInPosition(unpack(value.coordinates)) and (value.colors["button"][4]/2) or 0) local r, g, b = unpack(value.colors["button"]) dxDrawRectangle(data[1], data[2], data[3], data[4], tocolor(r, g, b, alpha)) r, g, b = unpack(value.colors["text"]) dxDrawText(list.buttons[key].text, data[1], data[2], data[1]+data[3], data[2]+data[4], tocolor(r, g, b, alpha), 1, "default-bold", "center", "center", true) end if list.buttons[list.selected] then local label = list.label dxDrawText(list.buttons[list.selected].label, label.coordinates[1], label.coordinates[2], label.coordinates[3], label.coordinates[4], tocolor(unpack(label.colors)), 1, label.font, label.align["x"], label.align["y"], false, false, false, true, false) end end) addEventHandler("onClientClick", root, function(button, state) if button == "left" and state == "down" then for key, value in ipairs(list.buttons) do if isMouseInPosition(unpack(value.coordinates)) then list.selected = key break end end end end) function isMouseInPosition(x, y, width, height) if not isCursorShowing() then return false end local sx, sy = guiGetScreenSize() local cx, cy = getCursorPosition() local cx, cy = cx*sx, cy*sy return (cx >= x and cx <= x+width) and (cy >= y and cy <= y+height) end تقدر تضيف وتحذف ازرار على كيفك من الجدول
×
×
  • Create New...