Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/03/19 in all areas

  1. When you run a loop in pairs, it grabs not only indexed items but also objects. Objects have keys and values. for k, v in pairs(table) do in this case k would be your key, and v would be its value. Keys are always strings. Say it's not an object, instead its an indexed item, k would become the index, and v would be the value for that index. ipairs however, loops through ONLY indexed items and it does them in order. So ipairs will not grab objects. pairs is faster than ipairs since it does not have to sort through the table first. for i=1, #table do this is called an Int loop, where it simply goes from 1 number to another, i=start, end i represents index mostly because people use this loop to grab table index's. it is by far the fastest loop, as it doesn't have to sort through the table, or return an extra argumented variable. #table just returns the amount of items in a table
    2 points
  2. السلام عليكم الموضوع التالي حبيت بس اني اناقش في كم من نقطة واتمنى مشاركة الاعضاء فيها اولا الكل ملاحظ طبعا انه والحمد لله صارت شركات الاستضافة اكثر من عدد السيرفرات وعدد اللاعبين حتى كل يوم تطلع استضافة جديدة وكل واحد الحمد لله يدعي انه شركته هي الافضل الرسالة اللي حابب اني اوجها هي الك انتا كزبون شو اللي لازم تسوي وهاي نصيحة مني الك ما تعتمد على شركات الاستضافة لانه وللاسف لا يمكن الاعتماد عليهم ورح اعطيك اهم سبب ليش لا يمكن الاعتماد عليها , قلة الادارة الفنية الها اهم عامل معظم سيرفرات الاستضافة تعطيك عدد لاعبين خيالي يعني يمكن يحكيلك تاخذ 200 او 400 لاعب بس 1 دولار الحين انتا كزبون رح تفكر انه هذا الشي كويس بس لو حسبت الباندويث لانه حضرة اللي عامل الاستضافة لا يفقه شيء اصلا كل اللي هامه بس انه ياخذ فلوسك الا من رحم ربي عشان هيك نصيحة مني للك انساك من هم هاي الشركات واحجز خادم افتراضي او خادم كامل مثل ovh.com او online.net Arbor Networks هاي الشركتين ماخذين شراكة مع شركة layer 7 وتعتبر الرائدة في مجال الحماية من الهجمات الاكترونية وتعطيك SSD تجنب ovh بالنسبة ل خوادم لو صارت اي مشكلة كل السيرفرات اللي شغالة عليه تطفي وتقريبا بدهم 30 دقيقة عشان يرجعوا متل ما كانوا ssd مشكلة سيرفرات cloud ram vps وال cloud vps بالنسبة لل cloud vps ram هما اللي لازم تختارهم وبالاخص بكون من ناحية اداء المعالج اكثر من الرام cloud vps لانه سيرفرك يعتمد اكثر على الرام مش على المعالج وتركيز بالنسبة ل شركة اونلاين بنصحك تاخذ سيرفر كامل لانه اسعارهم رخيصة واي حد بدو اي مساعدة بتنزيل اي خادم يحاكيني وانا رح انزله السيرفر اللي بدو اياه
    1 point
  3. @queenshe the issue is that you are creating the objects clientside. Try creating them serverside and sending them over to client properly synced by using element data.
    1 point
  4. Boa. Por isso é bom saber depurar o código, salva o seu tempo e agiliza pra fazer o projeto.
    1 point
  5. Acabei achando o erro, se olhar a print verá que teve uma parte que estava com o valor "nil nil", sem a vírgula
    1 point
  6. Tente removendo a linha do loop na função initSpraying. Na linha 30 substitua a função por esta: function initSprayingForPlayer(player) if player then createTagForPlayer(player) return end -- addEventHandler("onElementDataChange",root,createAnotherTagForPlayer) for i,p in ipairs(getElementsByType("player")) do createTagForPlayer(p) end end Na função initSpraying chame essa função acima: initSprayingPlayer()
    1 point
  7. Depure o seu código: local c = getElementData(getLocalPlayer(), "mercadoCoisas") outputChatBox("c: "..tostring(c)) local d = split(c, ',') iprint(d) setElementData(getLocalPlayer(), "mercadoCoisas", ""..d[1]..","..d[2]..","..d[3]..",1,"..d[5]..","..d[6]..","..d[7]..","..d[8]..","..d[9]","..d[10])
    1 point
  8. ديم يرجال , لازم تكون موجود في مخططاتي القادمة
    1 point
  9. Já tentou reinstalar o GTA SA?
    1 point
  10. addEvent("adatokLekerdezese", true) addEventHandler("adatokLekerdezese", resourceRoot, function(serial) local queryHandler = dbQuery(con, 'SELECT * FROM accounts') local result = dbPoll(queryHandler, 500) local serial = getPlayerSerial(client) for num, row in paits(result) do if ( row.serial == serial) then setElementData(client, "admimlvl", tostring(row.adminlvl)) else end end end ) Try this
    1 point
  11. local startMarker = createMarker(0,0,3, "cylinder", 1, 0, 255, 0) -- The start marker (Here you can change the marker's position and color) local endMarker = createMarker(0,10,3, "cylinder", 1, 255, 0, 0) -- The end marker (Here you can change the marker's position and color) local sx, sy = guiGetScreenSize() function renderTime() local currentTime = getTickCount() local elapsedTime = (currentTime - startTime) / 1000 dxDrawText(elapsedTime, 0, 0, sx, sy/4, tocolor(255,255,255,255), 2, "default-bold", "center", "center") end addEventHandler("onClientMarkerHit", startMarker, function(hitPlayer, matchingDimension) -- Attach onClientMarkerHit event to startMarker if hitPlayer == localPlayer and matchingDimension then -- You need the check the player who hit the marker is the client. AND localPlayers's dimension is matching with marker's dimension if started then -- timer already started, need to reset it startTime = getTickCount() else -- timer not running, you need to start the onClientRender and display time on client's screen started = true startTime = getTickCount() addEventHandler("onClientRender", root, renderTime) end end end) addEventHandler("onClientMarkerHit", endMarker, function(hitPlayer, matchingDimension) -- Attach onClientMarkerHit event to endMarker if hitPlayer == localPlayer and matchingDimension then -- You need the check the player who hit the marker is the client. AND localPlayers's dimension is matching with marker's dimension if started then -- if the timer is running need to stop it. local currentTime = getTickCount() local elapsedTime = currentTime - startTime outputChatBox("Your time is: " .. elapsedTime) removeEventHandler("onClientRender", root, renderTime) started = false end end end)
    1 point
  12. local sx, sy = guiGetScreenSize() function renderTime() local currentTime = getTickCount() local elapsedTime = (currentTime - startTime) / 1000 dxDrawText(elapsedTime, 0, 0, sx, sy/4, tocolor(255,255,255,255), 2, "default-bold", "center", "center") end addEventHandler("onClientMarkerHit", startMarker, function(hitPlayer, matchingDimension) -- Attach onClientMarkerHit event to startMarker if hitPlayer == localPlayer and matchingDimension then -- You need the check the player who hit the marker is the client. AND localPlayers's dimension is matching with marker's dimension if started then -- timer already started, need to reset it startTime = getTickCount() else -- timer not running, you need to start the onClientRender and display time on client's screen started = true startTime = getTickCount() addEventHandler("onClientRender", root, renderTime) end end end) addEventHandler("onClientMarkerHit", endMarker, function(hitPlayer, matchingDimension) -- Attach onClientMarkerHit event to endMarker if hitPlayer == localPlayer and matchingDimension then -- You need the check the player who hit the marker is the client. AND localPlayers's dimension is matching with marker's dimension if started then -- if the timer is running need to stop it. local currentTime = getTickCount() local elapsedTime = currentTime - startTime outputChatBox("Your time is: " .. elapsedTime) removeEventHandler("onClientRender", root, renderTime) started = false end end end)
    1 point
  13. Ele está dizendo que este evento já está ativo. Isso acontece quando vc tenta dar addEventHandler em um evento que já está adicionado. Para corrigir isso, vc tem 2 alternativas: Impeça que ele tente adicionar outra vez o mesmo evento. Remova o evento antes de adicioná-lo novamente. Como vc não colocou o script completo, é só isso que dá pra afirmar.
    1 point
  14. ابحث بليوتيوب او جوجل بتلاقي ..
    1 point
  15. Mais uma vez irei dizer, NÃO PRECISA CITAR MINHA MENSAGEM TODA HORA, Talvez agora você consegue ler No código acima que enviei não tem nada sobre /motor tem apenas o bindkey, Pelo que deu pra entender se o veiculo estiver com pouco HP irá bloquear o uso da bindkey "j". Então ai vai um exemplo do que você pode fazer. Isso aqui deve ser útil. function BindK ( source ) for _, players in ipairs( getElementsByType 'player' ) do -- Verifica Todos jogadores Online local Vehicle = getPedOccupiedVehicle ( players ) -- Verifica o Veiculo que os Jogadores estão Ocupando if ( Vehicle ) then -- Verificação if getPedOccupiedVehicleSeat ( players ) == 0 then -- Verifica se o Jogador é Motorista local HP = getElementHealth(Vehicle) -- Verifica HP Do veiculo if HP > 350 then -- HP Do veiculo deve ser maior que 350 outputChatBox ( "MOTO LIGADOR", source, 231, 217, 176, true ) else outputChatBox ( "SEU VEICULO ESTÁ QUEBRADO, MOTO NÃO PODE SER LIGADO", source, 231, 217, 176, true ) end end end end end -- IRÁ ATIVAR A BIND ASSIM QUE O MOD FOR LIGADO function Bind_Start() for index, player in ipairs(getElementsByType("player")) do bindKey(player, "K", "down", BindK) end end addEventHandler("onResourceStart", root, Bind_Start) -- IRÁ ATIVAR A BIND ASSIM QUE O JOGADOR ENTRAR NO SERVIDOR function onPlayerJoin() bindKey(source, "K", "down", BindK) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) -- IRÁ REMOVER A BIND ASSIM QUE DESLIGAR O MOD function Stop_Mod(player) for index, player in ipairs(getElementsByType("player")) do unbindKey(player, "K", "down", BindK) end end addEventHandler("onResourceStop", root, Stop_Mod)
    1 point
  16. Client Side : function centerWindow (center_window) local screenW, screenH = guiGetScreenSize() local windowW, windowH = guiGetSize(center_window, false) local x, y = (screenW - windowW) /2,(screenH - windowH) /2 return guiSetPosition(center_window, x, y, false) end addEventHandler("onClientResourceStart", resourceRoot, function() wnd = guiCreateWindow(397, 188, 501, 316, ".:[Paintjop System]:.", false) centerWindow(wnd) guiSetVisible(wnd, false) guiWindowSetMovable(wnd, false) guiWindowSetSizable(wnd, false) guiSetAlpha(wnd, 1.00) guiSetProperty(wnd, "CaptionColour", "FF189FE5") label1 = guiCreateLabel(288, 56, 65, 21, "رقم الوشم :", false, wnd) guiSetFont(label1, "default-bold-small") paintjopE = guiCreateEdit(221, 50, 57, 32, "", false, wnd) guiEditSetMaxLength(paintjopE, 1) take = guiCreateButton(196, 102, 106, 48, "آخذ الوشم", false, wnd) guiSetFont(take, "default-bold-small") guiSetProperty(take, "NormalTextColour", "FF0CFE00") label2 = guiCreateLabel(10, 160, 481, 18, "---------------------------------------------------------------------------------------------------------------", false, wnd) guiSetFont(label2, "default-bold-small") guiLabelSetColor(label2, 77, 0, 252) guiLabelSetHorizontalAlign(label2, "center", false) guiLabelSetVerticalAlign(label2, "center") label3 = guiCreateLabel(64, 195, 379, 18, "لوحة آخذ وشم للسيارة", false, wnd) guiSetFont(label3, "default-bold-small") guiLabelSetColor(label3, 89, 193, 223) guiLabelSetHorizontalAlign(label3, "center", false) label4 = guiCreateLabel(64, 213, 379, 18, "لأخذ وشم للسيارة اكتب رقم الوشم من 1-3", false, wnd) guiSetFont(label4, "default-bold-small") guiLabelSetColor(label4, 40, 173, 211) guiLabelSetHorizontalAlign(label4, "center", false) label5 = guiCreateLabel(64, 231, 379, 18, "وأضغط علي زر آخذ الوشم وسوف يتم اعطائك وشم للسيارة", false, wnd) guiSetFont(label5, "default-bold-small") guiLabelSetColor(label5, 31, 136, 167) guiLabelSetHorizontalAlign(label5, "center", false) label6 = guiCreateLabel(10, 259, 481, 18, "---------------------------------------------------------------------------------------------------------------", false, wnd) guiSetFont(label6, "default-bold-small") guiLabelSetColor(label6, 77, 0, 252) guiLabelSetHorizontalAlign(label6, "center", false) guiLabelSetVerticalAlign(label6, "center") label7 = guiCreateLabel(180, 289, 140, 17, "For Wnash Time", false, wnd) guiSetFont(label7, "default-bold-small") guiLabelSetColor(label7, math.random(0,255),math.random(0,255),math.random(0,255)) guiLabelSetHorizontalAlign(label7, "center", false) label8 = guiCreateLabel(10, 27, 126, 19, "سعر الوشم : 500.000$", false, wnd) guiSetFont(label8, "default-bold-small") guiLabelSetColor(label8, 196, 0, 0) guiLabelSetHorizontalAlign(label8, "center", false) addEventHandler( "onClientGUIClick" , take , function( ) local paintJob = guiGetText( paintjopE ) if( tonumber( paintJob ) and tonumber( paintJob ) >= 0 and tonumber( paintJob ) <= 3 ) then triggerServerEvent( "changePaintJob" , localPlayer , paintJob ) else outputChatBox( "يرجي التحقق من رقم الوشم" , 255 , 0 , 0 , true ) end guiSetEnabled ( take , false ); setTimer ( guiSetEnabled ,5000 , 1 , take , true ); end , false ) end ) Server Side : addEvent( "changePaintJob" , true ) addEventHandler( "changePaintJob" , root , function( paintJob ) local vehicle = getPedOccupiedVehicle( source ) if( vehicle ) then if( getPlayerMoney( source ) >= 500000 ) then takePlayerMoney( source , 500000 ) setVehiclePaintjob( vehicle , paintJob ) outputChatBox("#FFFAAAPaintJob #FFFFFF:#00FF00 !تم اعطائك وشم للسيارة بنجاح",source,0, 255, 0, true) else outputChatBox( '#FFFAAAPaintJob #FFFFFF:#C10000 !ليس معك مال كافي لشراء الوشم' , source , 255 , 0 , 0 , true ) end else outputChatBox("#FFFAAAPaintJob #FFFFFF:#C10000 !يجب عليك ركوب السيارة لإعطائك وشم", source,255, 0, 0, true) end end ) بالتوفيق
    1 point
  17. 1 point
  18. Maybe this (Just change the intensity to whatever you want): // // blackwhite.fx // texture screenSource; float intensity = 0.5; sampler TextureSampler = sampler_state { Texture = <screenSource>; }; float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); float value = (color.r + color.g + color.b) / 3 * intensity; color.r = value; color.g = value; color.b = value; return color; } technique BlackAndWhite { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } } Or this: // // blackwhite.fx // texture screenSource; float intensity = 0; sampler TextureSampler = sampler_state { Texture = <screenSource>; }; float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); float value = (color.r + color.g + color.b) / 3; color.r = value; color.g = value; color.b = value; return color * intensity; } technique BlackAndWhite { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }
    1 point
  19. مرحبا لقد قمت بإطلاق الاصدار الجديد من لوحة الادمنية العربية بعد ان لاحظت ان معظم الاعضاء يقومون بإستخدام لوحات الادمنية العربية القديمة التي مر عليها الدهر من دون اي تحديثات او حماية وكما انها غير مؤمنه كـ اي لوحة ادمنية حديثة الإنشاء,( وبالمناسبة انني هولندي ولا اتحدث اللغة العربية ) وكما انني بذلت الكثير من جهدي حتي اقوم بنقل الترجمة العربية من اللوحات العربية القديمة الي هذه اللوحة حديثة الصنع وكل ما اريده هو ان اقوم بإفادة اصحاب السيرفرات الذين يستخدمون لوحة الادمنية العربية القديمة وكما انه يمكنك ان تري اخر تحديثات لوحة الادمنية من خلال : https://github.com/multitheftauto/mtasa-resources/commits/master/[admin]/admin وإذا كان لديك صاحب سيرفر يستخدم لوحة الادمنية العربية القديمة رجاء اخبره بهذا الموضوع لكي يقوم بتحميل النسخة الحديثة من اللوحة العربية لتحميل اللوحة العربية DOWNLOAD:https://community.multitheftauto.com/?p=resources&s=details&id=14837 واذا كان هناك خطأ في ترجمة اللوحة رجاء اخبرني " لقد تمت ترجمة الموضوع من قبل نصور " ENG: I'm here releasing a new Arabic-translated admin panel from today's version (september 2017) after I noticed all community circulating AR panels were outdated as hell. As they pose serious security risks, eventhough I'm not Arabic, I felt it of such importance that I've spent a long time transferring translations from older circulating panels to this most up-to-date Admin panel. I'm helping a huge amount of server owners with this, because most will just use a Community version that is outdated because of the great time to invest in translating yourself. Ofcourse, you'll also benefit from new features and updates made to Admin recently, (look here: https://github.com/multitheftauto/mtasa-resources/commits/master/[admin]) both for this reason and security I advise you inform all server owners you know about this release and suggest they update if they're using Arab panels. If you spot any translation issues, please leave a reply. Main view example; (updated 24/09/2018)
    1 point
  20. بسم الله الرحمان الرحيم السلام عليكم روحمة الله وبركاته انشأت هاذا الموضوع مشان اساعد اصحاب السيرفر الجدد في حماية سيرفرهم من اغلب طرق السرقة ban , kick : اول شي عشان نوقف اوامر صك لوحة الادمن من ف8 مثال conf : نروح لوحة الادمن ندخل الملف هاذا commands.xml : بعدين نفتح ملف -: ونحذف كل شي فيه و نستبدله في هاذا <commands> <player> </player> <team> </team> <vehicle> </vehicle> <server> </server> <bans> </bans> </commands> start , stop , stopall , restart : الحماية من اوامر ف8 الخاصة بالعبة مثال حمل هاذا المود المنشور من قبل و لا تنسا تبدل السريال الموجود داخل المود بسريالك http://v.ht/mod7maya والباقي بكون من خلال برمجتك للوحة الادمن و الصلاحيات الا تاركها للرتب و السلام عليكم ورحمة الله و بركاته
    1 point
  21. Só adicionar setElementPosition depois de fechar o painel. Isso é mais simples do que fazer uma pergunta. addEventHandler ("onClientClick", getRootElement(), function (button, state, absoluteX, absoluteY) if (button == "left") and (state == "up") and isDxShowing then if absoluteX >= 567 and absoluteX <= 650 and absoluteY >= 528 and absoluteY <= 559 then -- Se a coordenada clicada estiver dentro do retângulo "Fechar", então: gerenciaPainel () -- Fecha o painel. setElementPosition (localPlayer, 0, 0, 0) -- Onde 0, 0, 0 é as coordenadas X, Y, Z pra ir. end end end) Cara, vc pelo menos fez o mínimo de esforço para ler a Wiki? Ou vc nem sabe que ela existe? Lá também tem exemplos prontos pra vc estudar como funciona a função. Sabendo como funciona a função, vc pode usá-la para o propósito que vc quiser.
    1 point
  22. Em gerenciaPainel () vai fechar o painel (tem até o comentário ao lado da função, se você começar ler nossos posts você vai perceber) No caso, só colocar o setElementPosition ...
    1 point
×
×
  • Create New...