Leaderboard
Popular Content
Showing content with the highest reputation on 05/08/19 in all areas
-
3 points
-
سلام عليكم ورحمة الله آخخبااركم ان شاء الله طيبين ------------------------------------- في هذا الموضوع عندي مود متجر يشتغل بالنقاط يعني عندك نقاط تشتري بها اسلحه ودم ودرع الخخ لمعرفة كل شي عن المود في هذا الرابط / الفيديو وبالتـــوفييقء ~~ |~ الإهداءات ~| @!#DesTroyeR_,) @Kareem Amer @MrKAREEM @Mr.Falcon @DABL @KillerX @NX_CI @[AcM] - Major . @MR_Mahmoud @Ahmed Ly @MR.Mosa @N3xT @Abu-Solo @SuperX @#BrosS @iMr.WiFi..! @Mr.CnTroL @Abdul KariM @Hakan @!#NssoR_) @Simple. @Abdo Nour و جميع أعضاء المنتدى2 points
-
1 point
-
https://forum.multitheftauto.com/search/?q=download&type=forums_topic&nodes=127 Você quem escolhe, pois dá para fazer nos dois.1 point
-
@Maloi2k Use it serverside. You can't remove players from vehicles on clientside with that function.1 point
-
addEventHandler é uma função que manipula eventos existentes. setTimer é uma função, o uso deve ser assim: setTimer( inicio, 10000, 0 )1 point
-
Yeah. I actually asked this because I was wondering how MTA handles internally element-data where the old value is the same as the new... (may have some verification for the sake of performance). As for the on(client)ElementDataChange, it only fires when the new value is different from the old one.1 point
-
1 point
-
Primeiro erro: onHitMarker não existe, deveria ser onMarkerHit Fora isso o evento onMarkerHit está sendo adicionado antes da marker ser criada, marker ali irá retornar nil (além de outros erros na função 'final'). Tente: infernus = createVehicle (411, 1183.784, -1312.099, 12.5 + 1) function teste (player) marker = createMarker(1206.313, -1284.754, 12, "cylinder",3,255,255,255,50) addEventHandler("onMarkerHit", marker, final) outputChatBox("Pegue o veiculo e leve ate o local indicado no mapa", player) end addEventHandler ( "onVehicleEnter", infernus, teste ) function final (player) if getElementType(player) == "player" then local veh = getPedOccupiedVehicle(player) if veh and veh == infernus then destroyElement(infernus) end end end1 point
-
Haz esto: function hasWeapon( jugador, idarma ) local armas = getPedWeapons( jugador ) if #armas > 0 then for i=1, #armas do if armas[i] == idarma then return true end end end return false end1 point
-
Você tem duas opções: não usar o parâmetro ou pulá-lo. Acho que é melhor eu responder a sua pergunta. Faça deste jeito: addCommandHandler('veh', function(player) local x, y, z = getElementPosition(player) vehicle = createVehicle(411, x, y, z, _, _, _, 'ABC-1337') end ) Na situação acima, suponhamos que você queira apenas criar o veículo com uma placa diferente. Porém, antes do parâmetro da placa, você tem 3 outros parâmetros: Rotação X, Rotação Y e Rotação Z. Para ignorar, basta adicionar um underline (_), como no exemplo acima.1 point
-
1 point
-
سلام عليكم كيفك صديقي الـ while do هي زيها زي أي loop ثانية، while = ما دام أن do = قم بالأمر التالي ما أنصحك تجرب while true do print('Lua') end لأن ما دام السكربت شغال بتقعد تكتب لك Lua إلى يوم القيامة هههه تقدر تستعمل break مثال آخر عشان تفهم local conolel = 0 while conolel <= 10 do -- مادام قيمة conolel أصغر من 10 بيسوي الأمر الجاي conolel = conolel + 1 -- الأمر هو أنه يضيف ل conolel 1 كل مرة حتى أصير أصغر أو أساوي 10 print(tostring(conolel)) end في هذا المثال ، يوم توصل قيمة conolel إلى 11 بيوقف الـ loop حقت while أتمنى يكون الشرح بسيط و ما فيه أخطاء لأني ساحب شوي1 point
-
وعليكم السلام العملية ذي شغلتها قريبة من اللوب ، بتقعد تسوي وظيفة لين مايصير العكس ، مدري كيف بشرحها بس يارب تفهم المثال local number = 0 -- نفترض رقم معين while (number ~= 5) do -- الحين بنقول دام الفاربل حقنا لايساوي 5 فـ بيفضل شغال number = number + 1 -- بنزيد ع الفاربل 1 كل شوية print(number) -- بس عشان نشوف النتيجة end الي بيطلع من الكود الي فوق ، انه بيقعد يضيف 1 ع المجموع لين مايوصل ل5 ثم يوقف ان شاء الله فهمت1 point
-
Both can be used. if type(value) == "number" then end Just tonumber is more forgiving, as you can also accept strings by converting them to numbers. local value = "123" value = tonumber(value) if value then end It just depends how forgiving you want to be. Do not do this: (2 function calls) if tonumber(c_buffer) and tonumber(c_buffer) >= 0 then end But do this: (1 function call) c_buffer = tonumber(c_buffer) if c_buffer and c_buffer >= 0 then end If you can reduce function calls, by just writing it a bit different without messing with the programming flow, you should take it.1 point
-
At first yes you would expect that. But there is one thing that isn't taken in account. If one of the other clients does this: setElementData(root, ":O", false, false) In that case, even if the value doesn't change, the value of this specific client must be updated. With other words it does not matter if the value is the same. All clients their value must be forced to set to the last known value. I don't know if the event is fired or not. But it is just as bad for the network.1 point
-
O maior erro é usar setElementData para qualquer tipo de armazenamento para um player/elemento. Isso é o que vejo em muitos scripts de amadores no assunto. Aqui vai um exemplo do uso incorreto: Código acima sem o setElementData: O erro que cometem com setElementData é usar de forma exagerada, e sem saber as consequências. Exemplos disso é: (1) Usar setElementData dentro do "onClientRender". (2) A desinformação quanto ao atributo synchronize (muito por conta do baixo nível de entendimento na programação/scripting). Há situações em que o scripter poderia simplesmente colocar false no 4º argumento, como em um caso que ele esteja usando element-data "no lugar de uma variável" (ou tabela). Ou seja, aquele element-data que não irá ter uso algum no lado server ou no lado cliente. Imagine um cliente com 1 setElementData no "onClientRender", isso irá criar um tráfego na rede do servidor umas 50-60 vezes por segundo (vai depender do fps). Claro que nem sempre terá esse tráfego todo na rede mesmo considerando a suposição acima, pois o element-data só é atualizado se ele for diferente do valor anterior (não posso afirmar isso com 100% de certeza mas acho que o MTA não iria deixar de fazer uma verificação antes, seria uma grande falha de otimização interna). Você pode continuar usando setElementData no código acima se o mesmo tiver com sync desativada. O mais otimizado, porém, continua sendo a versão com variável. É válida uma alternativa com trigger events e tabelas como alternativa ao element-data. Em resumo: Saiba quando usar element-Data: Estude sobre tables (ou arrays); opte por table ou variável. O caminho mais fácil não significa que é o melhor, setElementData é prática mas tem seu custo. Faça uso do argumento synchronize da função: setElementData( element, key, value, synchronize ) Por padrão ele será true, então certifique-se de setar false caso o element-data não tiver a necessidade da atualização para o server ou para o cliente. Saiba as consequências de usá-la: Terá uma sincronização (se a sync tiver ativada) em todo o servidor e dependendo da quantidade do uso isso pode sobrecarregar o tráfego de rede. Além de que aumenta o uso de processamento.1 point
-
Exemplo de uso (server-side) local capacetes = {} addCommandHandler("capa1", function(player) if (not capacetes[player]) then -- se não possuir capacete --[[ -- adiciona capacete capacetes[player] = createObject(capa1, 0, 0, 0, 0, 0, 0) exports.bone_attachCapa:attachElementToBone(capacetes[player], player, 1, 0, 0.04, 0.07, 0, 270, 0) --]] end end ) addCommandHandler("tirar", function(player) if (capacetes[player]) then -- caso possua capacete --[[ -- remove capacete if (exports.bone_attachCapa:isElementAttachedToBone(capacetes[player])) then exports.bone_attachCapa:detachElementFromBone(capacetes[player]) end destroyElement(capacetes[player]) capacetes[player] = nil --]] end end ) É bom também efetuar a destruição do objeto no onPlayerQuit do player1 point
-
local eventList = {} setTimer( function () if next(eventList) then outputDebugString(inspect(eventList)) eventList = {} end end, 10000, 0 ) addDebugHook( "preEvent", function ( sourceResource, eventName, eventSource, eventClient, luaFilename, luaLineNumber, ... ) local i = inspect(sourceResource).."/"..eventName.."/"..inspect(eventSource) eventList[i] = (eventList[i] and eventList[i] + 1) or 1 end, "onElementDataChange" ) You could use this slightly adapted IIYAMA's code (only hooking onto onElementDataChange this time) which also includes the name of the resource and a readable identifier for the source element into the list, so you can tell which resource causes the large amount of data changes.1 point
-
1 point
-
resourceRoot = للسكربت نفسه، كمثال لو سويت حدث ماركر وحطيتها، أي ماركر مسويه داخل السكربت بيتأثر من الحدث. يعني لو سويت ماركرين وحطيت حدث اذت أحد دخل الماركر تجيه فلوس مثلاً، يصير لو أحد دخل اي ماركر من الإثنين بياخذ فلوس. ومثال آخر لو سويت داتا بتكون للسكربت نفسه بمعنى مابتكون للاعب، يعني بتكون داتا واحده فقط. ومثال آخر لو بتستدعي وظيفة من السكربت مابتقدر لأن الوظيفة أنت خليتها للسكربت نفسه فقط. root = عكس الكلام اللي فوق مع الإمكانية انك تحدد الشي اللي تبغاه من خلال الشروط، كمثال الماركر تقدر تسوي شرط في الحدث انه اذا أحد دخل الماركر الأول فقط يتحقق الحدث. بخصوص البراميترز، هي متغيرات تكون بين قوسين الوظيفة، الأحداث أو الوظائف الجاهزة تبع اللعبة تجي معها البراميترز جاهزة ماتقدر تغير في ترتيبها أو نوع المدخلات والأمثلة ذكروها لك فوق. بخصوص انك تبغى تستخدم أكثر من حدث ووظيفة، تقدر تسوي اكثر من حدث للوظيفة الواحدة وتستخدم الشروط عشان تتحقق إذا الحدث الأول تحقق تستخدم البراميتر الأول مثلاً، وتهمل الثاني عادي مايأثر، والعكس صحيح. والمعذرة ما اقدر احط لك أمثلة من الجوال، الكتابة صعبة?.1 point
-
عموما انا مجرب الكرت زمان وصراحة بيشغلك كل الالعاب الحالية ولاكن ما بيدوم لأكثر من سنة او سنتين فنصيحة اشتري لك كرت GTX 960 TI وفوق اما غير كذا لا تجيب حاليا جبت gtx 1060 ti 4gb وشغال معي بكل الالعاب ممتاز وعلي Ultra1 point
-
Aquilo é um efeito e não um objeto. Crie ele com isso: createEffect ("smoke_flare", 2492, -1660, 13, -90, 0, 0) -- Cria um na Grove Street. setFarClipDistance1 point
-
1 point
-
1 point
-
Bom, eu sinceramente não gosto de paineis DX, prefiro paineis normais do MTA por serem mais fáceis de fazer, melhores para fazer manutenção e mais leves. Mas estou comentando aqui pois fiquei curioso para saber como resolver isso. Além de claro, reviver seu tópico para não cair no esquecimento. (por via das dúvidas, já pensou em fazer o primeiro menu desaparecer quando o segundo aparece? Dessa forma não tem como um ficar em cima do outro de maneira errada.) Boa sorte.1 point