Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/03/19 in Posts

  1. Traduzindo: Seu bug é tão sinistro que nem o developer do MTA sabe o motivo.
    3 points
  2. Render events enhancement Having a lot of render events in your resource? Easier attach and remove? Or do you want to pass arguments in to a function which is attached to a render event? Then this might be something for you. Syntax: addRenderEvent bool addRenderEvent(function functionVar [, string eventName, arguments ...]) Arguments: The function you want to attach/target. The event you want to use. ( "onClientRender", "onClientPreRender", "onClientHUDRender") If you do not fill in one of these three, it will automatic fallback to "onClientRender". Fool proof. Arguments you can pass to the target function. (which isn't possible with the default addEventHandler + onClientRender function) Returns: true when added, and false otherwise. Syntax: removeRenderEvent bool removeRenderEvent(function functionVar [, string eventName]) Arguments: The function you want to attach/target. The event you want to use. ( "onClientRender", "onClientPreRender", "onClientHUDRender") If you do not fill in one of these three, it will automatic fallback to "onClientRender". Fool proof. Returns: true if found + removed, and false otherwise. (Not recommended to execute this function every frame > performance) onClientPreRender + timeslice If you use "onClientPreRender", just like the default event, it will pass the timeSlice to the attached/targetted function. https://wiki.multitheftauto.com/wiki/OnClientPreRender I am not sure if attached is the right word for this example, because it isn't really attached to the event. It is saved in a table which gets looped every frame. Performance Is this code bad for performance? The answer to that is NO. I ran a test for it, and it seems that addRenderEvent used less CPU AFTER adding the events. (addRenderEvent: 31% CPU, addEventHandler 99/100% CPU) Adding the event will probably use more CPU, but that is only one execution. Feel free to re-test this example, I am interested how it would perform on your pc's. Performance test code (Not the source code ) Source code:
    1 point
  3. A simple script of dressable characters and deformable faces. You can move every vertex of the head with a simple displacement shader. The script is in test state right now, I'll create a new editor later. Hope you like it.
    1 point
  4. Hello, i started this gamemode for nTL but they declined a mgm they wanted a normal race server. So i dont know what i can do with it. it have 8 lobbys and they work well. - Streamed Map Music - IPB Forum Account Connection - Settings - Money System - EXP System My Skype: nico.wissman - TobseN
    1 point
  5. السلام عليكم اليوم عندي موضوع أتوقع يهم أغلبكم قررت اسوي احصائية لعدد زوار السيرفرات العربية ساعة بساعة واخترت افضل وقت وهو الويكند اللي مفترض يكون اكبر عدد يدخلون فيه الناس : نبدآ .......................................................................................................... : 8 الساعة العدد / 791 .......................................................................................................... انتظروني الساعة 9
    1 point
  6. local AllowVehicles = { [ 483 ] = true , [ 534 ] = true , [ 535 ] = true , [ 536 ] = true , [ 558 ] = true } addEvent ( 'changePaintJob' , true ) addEventHandler ( 'changePaintJob' , root , function ( PaintJob ) local Table = { [ 'Vehicle' ] = getPedOccupiedVehicle ( source ) , [ 'Money' ] = getPlayerMoney ( source ) , [ 'Ammount' ] = 500000 } if ( not Table [ 'Vehicle' ] ) then return outputChatBox("#FFFAAAPaintjob #FFFFFF:#C10000 !يجب عليك ركوب السيارة لإعطائك وشم", source,255, 0, 0, true) end if ( not AllowVehicles [ getElementModel ( source ) ] ) then return outputChatBox("#FFFAAAPaintjob #FFFFFF:#C10000 !لا يمكنك وضع وشم لهذه السيارة", source,255, 0, 0, true) end if ( not Table [ 'Money' ] >= Table [ 'Ammount' ] ) then return outputChatBox( '#FFFAAAPaintjob #FFFFFF:#C10000 !ليس معك مال كافي لشراء الوشم' , source , 255 , 0 , 0 , true ) end takePlayerMoney( source , Table [ 'Ammount' ] ) setVehiclePaintjob( Table [ 'Vehicle' ] , PaintJob ) outputChatBox("#FFFAAAPaintjob #FFFFFF:#00FF00 !تم اعطائك وشم للسيارة بنجاح",source,0, 255, 0, true) end ) @Abdo Nour
    1 point
  7. عفوا حياك الله
    1 point
  8. شكرا لتفهمك يرجى الاتصصال في وقت لاحق هههه بالتوفيق
    1 point
  9. Nah it's not rapid , looks like it but it isn't. I have created basics for this system about 1~ month ago. And hardest (for me) things i am doing now (after a lot of other stuff creating. You helped me a lot of with certain things, big thanks to you ), at nearly end of this which I am doing. So this way should work, I am right? Still i don't know how can i get awaiting damage from this table. -- table structure -- local damageToSync = { [vehicle] = { [attacker] = loss, [attacker] = loss } [vehicle] = { [attacker] = loss, [attacker] = loss } } ]]
    1 point
  10. جرب local VehicleIDw = { '483' , '534' ,'535','536','558','559','560','561','562','565','567','575','576' } function isValueInTable( Table , value ) for key = 1 , #Table do if( tostring( value ) == Table[ key ] ) then return true end end return false end addEvent( "changePaintJob" , true ) addEventHandler( "changePaintJob" , root , function( paintJob ) local vehicle = getPedOccupiedVehicle( source ) if( not vehicle ) then return outputChatBox("#FFFAAAPaintjob #FFFFFF:#C10000 !يجب عليك ركوب السيارة لإعطائك وشم", source,255, 0, 0, true) end local id = getElementModel( vehicle ) if ( not isValueInTable( VehicleIDw , id ) ) then -- تحقق اذا موديل السيارة يوافق الموديلات اللى فوق return outputChatBox("#FFFAAAPaintjob #FFFFFF:#C10000 !لا يمكنك وضع وشم لهذه السيارة", source,255, 0, 0, true) -- يكتب لا يمكنك وضع وشم end if( not getPlayerMoney( source ) >= 500000 ) then return outputChatBox( '#FFFAAAPaintjob #FFFFFF:#C10000 !ليس معك مال كافي لشراء الوشم' , source , 255 , 0 , 0 , true ) end takePlayerMoney( source , 500000 ) setVehiclePaintjob( vehicle , paintJob ) outputChatBox("#FFFAAAPaintjob #FFFFFF:#00FF00 !تم اعطائك وشم للسيارة بنجاح",source,0, 255, 0, true) end )
    1 point
  11. Oke, it is growing rapidly I can see. Well then, how to BLOCK incorrect new data before you letting it flows in to your collection of all data: if damage and type(damage) == "number" then local vehicleArmorPoints = vehiclesCacheData.armorPoints[index] if vehicleArmorPoints and type(vehicleArmorPoints) == "number" then vehiclesCacheData.armorPoints[index] = vehicleArmorPoints - damage else outputDebugString("`vehicleArmorPoints` should contain a number, but it contains: " .. inspect(vehicleArmorPoints), 2) end else outputDebugString("`damage` should contain a number, but it contains: " .. inspect(damage), 2) end If it enters your collection, then you are more or less ** *** ** **** *** ***! because everything that relies on it will break. Might not be the case in your example, but `better safe than sorry`.
    1 point
  12. ******** احاول اقلل الكلام في الرد لان الكبيورد زي ال ومشكور علي المعلومات يا عسل منك نستفيد
    1 point
  13. Problem solved defining interior. Thank you so much
    1 point
  14. Is the gate used in an interior? If yes, then you also have to change that: https://wiki.multitheftauto.com/wiki/SetElementInterior
    1 point
  15. فيه سيارات ما تقدر تعدل عليها, وهذي قائمة بالسيارات المسموح بالتعديل عليها https://wiki.multitheftauto.com/wiki/Paintjob
    1 point
  16. Utilize o botão de <> do fórum para postar o código. Regras do fórum:
    1 point
  17. سويتها وتجمعنا بالفعل 17 مبرمج وكنا بنفتح سيرفر خرافه بس للاسف ما طلع على النور بسبب سوء ادارة مني @_@ لو اني كنت اعرف ادير المبرمجين زين واقسم الشغل كان نفع لكن قدر الله ما شاء فعل
    1 point
  18. Thanks you mate, working but about that verification code: " and isElement( element ) and available_types[ getElementType( element ) ] ) then " I had to remove it so it work, it's something in available_types, but nvm I've fix that error in it, thanks.
    1 point
  19. Cheguei a pensar que esse problema acontecendo só no lado cliente era por motivos de segurança (quando testei a função aqui também tinha dado esse mesmo erro, e depois funcionou). Bom, pelo menos funciona agora. Aqui está essa alternativa: https://github.com/multitheftauto/mtasa-blue/commit/e9ce827def7b4dc5dcd97f3ac4e8fd22c3b234ea
    1 point
  20. @DNL291, Depois de um tempo me ajudando, o @ccw fez algumas atualizações no MTA, criou uma alternativa, caso o fileRename não funcione ele vai tentar copiar e excluir o arquivo. Se alguém quiser atualizar o seu servidor, caso outro jogador tenha esse mesmo problema e não saiba, troque no mtaserver.conf a versão: <minclientversion> para 1.5.6-9.16571 Disse que não sabia se isso pode afetar outros jogadores, a solução para meu problema foi atualizar o MTA para a versão: mtasa-1.5.6-rc-16571-20190307.exe Obrigado a todos no tópico!
    1 point
  21. Para el dinero es mejor utilizar setPlayerMoney con los valores de la db al loguearse el player y luego guardarlos al salir o al modificarse obteniendo el valor con getPlayerMoney. El elementData lo utilizan mayoritariamente para valores personalizados que quieran compartir (o no) en ambos lados (cliente - servidor). Ejemplo: nivel o experiencia. ¿Por qué utilizar elementData para esto (lo mencionado arriba)? Te permite utilizar el valor en ambos lados por lo cual puedes modificarlo tanto en cliente como en servidor y hacer por ejemplo (en este caso) una barra de nivel en el lado cliente obteniendo el valor con getElementData. Se puede optimizar y mejorar sí pero para empezar y para que le pilles el truquillo va bien. Pd: es posible que me haya explicado como el c*lo pero estoy desde el móvil.
    1 point
  22. اعتقد عندهم استرداد خلال 30 يوم
    1 point
  23. Sim, é isso mesmo. Porém tem que verificar se o tipo de dano é por afogamento ou não. Caso contrário o jogador fica imortal enquanto estiver na água. (n morre nem com tiro) No evento onPlayerDamage tem o parâmetro attackerWeapon, que também representa o tipo de dano que o jogador está tomando.
    1 point
  24. Link: http://www.lua.org/gems/sample.pdf I think it should be useful for everyone.
    1 point
  25. You can also add this in top of the script, it should increase performance. local unpack = unpack; local len = table.getn; -- instead of #, you can't # make as local variable. Here is an updated version: https://github.com/Kenix157/mta_render_events
    1 point
  26. line 93 is just killTimer, replace this with if isTimer(timerVehicle) then killTimer(timerVehicle) end
    1 point
  27. أفكر ان شاءالله مستقبلا اسوي شروحات عن تحويل المواتر وبرضو تصميم مابات ووضعها باللعبه
    1 point
×
×
  • Create New...