Jump to content

Leaderboard

Popular Content

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

  1. @+[T]rakin Sobre o seu problema, isso acontece pois dentro do setTimer, o source deixa de existir. Para contornar esse problema, você deve declarar o source após o tempo do timer e usar um parâmetro de função no setTimer como novo "source". No caso, creio que o exemplo do nosso colega acima irá resolver. Caso você não tenha entendido, vou explicar a parte do setTimer. setTimer(function(p) -- (2) p = parâmetro de função do setTimer. outputChatBox("╔═════════════════════════════════════════════════╗", p, 0, 0, 0) -- (3) p = source. outputChatBox("[#cf2d2dFazenda Ilegal#000000] #afafafVocê Processou mais 1 Tijolo! #ffffffTotal: #cf2d2d"..TijoloDeMaconha.."#afafaf Tijolo de Maconha", p, 0, 0, 0, true) outputChatBox("╚═════════════════════════════════════════════════╝", p, 0, 0, 0) -- (4) Removidos os HEX codes pois você não precisa usá-los se o texto todo tem somente 1 cor. end, 5000, 1, source) -- (1) parâmetro de função do setTimer = source.
    2 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. قناة ولد اعرفه و حبيت انشره هنا و ان شاء الله يعجبكم الفيديو : )
    1 point
  4. @MainSCR Não precisa citar a mensagem do autor do post se só tem a sua resposta no tópico. Use o "quote" com bom senso.
    1 point
  5. Você não definiu source no setTimer Tente: function ProcessarMaconha () if getElementData(source,"FolhaDaMaconha") >= 10 then local FolhaDaMaconha = getElementData(source,"FolhaDaMaconha") local TijoloDeMaconha = getElementData(source,"TijoloDeMaconha") setPedAnimation(source,"CARRY","putdwn05",-1,false,false,true,false) setElementData(source, "FolhaDaMaconha",getElementData(source,"FolhaDaMaconha") -10 ) setElementData(source, "TijoloDeMaconha",getElementData(source,"TijoloDeMaconha")+1 ) outputChatBox("#000000╔═════════════════════════════════════════════════╗", source, 255,255,255,true) outputChatBox("#000000[#cf2d2dFazenda Ilegal#000000] #afafafVocê Usou 10 Folha de Maconha! #ffffffTotal: #cf2d2d"..FolhaDaMaconha.."#afafaf Folhas de Maconha", source, 255,255,255,true) outputChatBox("#000000╚═════════════════════════════════════════════════╝", source, 255,255,255,true) setTimer(function(p) outputChatBox("#000000╔═════════════════════════════════════════════════╗", p, 255,255,255,true) outputChatBox("#000000[#cf2d2dFazenda Ilegal#000000] #afafafVocê Processou mais 1 Tijolo! #ffffffTotal: #cf2d2d"..TijoloDeMaconha.."#afafaf Tijolo de Maconha", p, 255,255,255,true) outputChatBox("#000000╚═════════════════════════════════════════════════╝", p, 255,255,255,true) end, 5000, 1, source) else outputChatBox("#000000[#cf2d2dFazenda Ilegal#000000] #afafafVocê Não tem Folha de Maconha Suficiente, Para Processar!", source, 255,255,255,true) end end addEvent ( "ProcessarMaconha", true ) addEventHandler ("ProcessarMaconha", getRootElement(), ProcessarMaconha)
    1 point
  6. وعليكم السلام الافضل تسويها كدا .. عشان ما يحصل اخطاء function Health( ) if source == BuyHealth then triggerServerEvent("TestxX",localPlayer) end end addEventHandler("onClientGUIClick", root, Health) -- server addEvent("TestxX",true) addEventHandler("TestxX",root, function ( ) setElementHealth( source, 200 ) outputChatBox( 'تــم اعطــائك دم (200) #',source, 255, 255, 0, true ) end )
    1 point
  7. Da próxima vez, poste na seção Programação em Lua. E não exagere no negrito. Veja as regras neste tópico: Sobre o seu problema. A sua linha 4 está com lógica errada. Substitua ela por isso: if lvls and lvls >= 20 then
    1 point
  8. بس افضل تستخدام setElementHealth ع سيرفر و العفو
    1 point
  9. function Health( ) if source == BuyHealth then setElementHealth( localPlayer, 200 ) end end addEventHandler("onClientGUIClick", root, Health)
    1 point
  10. غير كلمة player الي localPlayer وغير اسم الزر بدون فصله
    1 point
  11. 1 point
  12. Aqui está o código atualizado. addCommandHandler( "darcnh", function (player, cmd, nickName) local acc = getPlayerAccount (player) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ("Admin")) then if not nickName then return outputChatBox( "(ERR0) #FFFFFFSintaxe: /"..cmd.." (Nick)", player, 255, 30, 30, true) end local targetPlayer = getPlayerFromPartialName(nickName) if not (targetPlayer) then return outputChatBox ("Jogador não encontrado!", player, 255, 30, 30) end local targetAcc = getPlayerAccount(targetPlayer) if isGuestAccount(targetAcc) then return outputChatBox ("Jogador não logado.", player, 255, 30, 30) end if setElementData (targetPlayer, "Habilitacoes:Carros", true) then outputChatBox ("Você deu a habilitação ao jogador '"..getPlayerName(targetPlayer):gsub("#%x%x%x%x%x%x", "").."'", player, 0, 255, 0) outputChatBox ("O(a) Admin '"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."' lhe deu uma habilitação.", targetPlayer, 0, 255, 0) else outputChatBox ("Este jogador já tem uma habilitação.", player, 255, 30, 30) end end end) addCommandHandler( "tirarcnh", function (player, cmd, nickName) local acc = getPlayerAccount (player) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ("Admin")) then if not nickName then return outputChatBox( "(ERR0) #FFFFFFSintaxe: /"..cmd.." (Nick)", player, 255, 30, 30, true) end local targetPlayer = getPlayerFromPartialName(nickName) if not (targetPlayer) then return outputChatBox ("Jogador não encontrado!", player, 255, 30, 30) end local targetAcc = getPlayerAccount(targetPlayer) if isGuestAccount(targetAcc) then return outputChatBox ("Jogador não logado.", player, 255, 30, 30) end if getElementData (targetPlayer, "Habilitacoes:Carros" ) == true then if setElementData (targetPlayer, "Habilitacoes:Carros", false) then outputChatBox ("Você retirou a habilitação do jogador '"..getPlayerName(targetPlayer):gsub("#%x%x%x%x%x%x", "").."'", player, 0, 255, 0) outputChatBox ("O(a) Admin '"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."' retirou sua habilitação.", targetPlayer, 0, 255, 0) end else outputChatBox ("Este jogador não tem uma habilitação.", player, 255, 30, 30) end end end) OBS: Testado. @Madruga
    1 point
  13. Essas datas não são setadas quando o cara inicia o teste? A imagem do debug não esta pegando. Quando o cara sai do server é salvo na conta com setAccountData né? pode me mostrar o evento onPlayerQuit no lado servidor por favor?
    1 point
  14. You're welcome just try and learn from that and it'll help you in many cases working with allot of resources. Best of luck!
    1 point
  15. Testa este comando: addCommandHandler( "darcnh", function (player, cmd, value) local acc = getPlayerAccount(player) if isObjectInACLGroup ( "user." ..getAccountName(acc), aclGetGroup ( "Admin" ) ) then if not value then return outputChatBox ("Uso correto: /"..cmd.." < Nick >", player, 255, 30, 30) end local targetPlayer = getPlayerFromPartialName( tostring(value) ) if not (targetPlayer) then return outputChatBox ("Jogador não encontrado!", player, 255, 30, 30) end local targetAcc = getPlayerAccount(targetPlayer) if isGuestAccount(targetAcc) then return outputChatBox ("Jogador não logado.", player, 255, 30, 30) end if not getElementData (player, "Habilitacoes:Carros" ) == true then outputChatBox ( "@executou", player) if setElementData (player, "Habilitacoes:Carros", true) then outputChatBox ("Você deu a habilitação ao jogador '"..getPlayerName(targetPlayer):gsub("#%x%x%x%x%x%x", "").."'", player, 0, 255, 0) outputChatBox ("O(a) Admin '"..getPlayerName(player):gsub("#%x%x%x%x%x%x", "").."' lhe deu uma habilitação.", targetPlayer, 0, 255, 0) else outputChatBox ("Este jogador já tem uma habilitação.", player, 255, 30, 30) end end else outputChatBox ( "Você não tem permissão !", player, 230, 20, 20 ) end end) Verifica se vai realmente dar a carteira assim conseguimos corrigir o /retirarcnh. Use /debugscript 3
    1 point
  16. Mostre o código da carteira pra gente ver.
    1 point
  17. I've never used latent events, but I'm pretty sure it doesn't get triggerServerEvent/triggerClientEvent details. That's why I said to try triggerLatentServerEvent/client instead. However I think you may find this bit of information useful: Give it a try but I do recommend IIYAMA's suggestion or something similar. Or even try this if it helps:
    1 point
  18. حبيبي لغة lua تستخدم خارج اللعبة ايضا في عدة انظمة اخرى مثل تصميم الالعاب والفوتشوب وغيرها من البرامج من وجهة نظري ان موضوعك سلبي للأعضاء الجدد في عالم البرمجة ، انا بدايتي في البرمجة كانت من اللعبة ذي يعني قبل اللعبة ماكنت اعرف شي اسمه برمجة او لغات واستفدت كثير من ذا المجال بأكثر من شي ، تعلمت من المشاكل البرمجية اللي توصلني او اللي تصادفني أثناء البرمجة و استفدت بتطوير مهاراتي أكثر و زيادة الوعي بالتعلم بكل الجوانب .. واستنتجت ان الحلول متوفرة ولكن نحتاج التركيز لفهم الخلل وتحليله ثم إختيار الحل الأنسب
    1 point
  19. No, most (if not all) of your posts are asking for some sort of help, and our policy is that such posts won't ever be deleted because they may help others with the same problem in future. Furthermore, even if they weren't in those places, deleting particular posts would break existing discussions and make them look awkward. It's possible to 'delete' your account (anonimize it, so your posts will appear as made by 'Guest') but unfortunately anonimizing particular posts isn't possible. If you want to opt for account removal instead, feel free to read more about the procedure at https://forum.multitheftauto.com/topic/12275-forum-rules/ (Appendix D). So unfortunately it's all or nothing, @Gat
    1 point
  20. Hi there. The Winter Holidays are here, so as usual we have got a new recap and status update post for you. Here is the summary of what has happened this year. ? 2018 in Recap We made efforts towards the new release through the first half of the year, so there was not much to talk about. There was an incompatibility issue with the 360 Total Security software which we advised you about and later in the year, there was a similar issue with McAfee. Late July, we have asked you about your thoughts about refreshing the community.multitheftauto.com portal. We have received some interesting feedback from you and we are still thinking about ways of implementing it, while considering our current resources. Also in July, we have migrated our bug tracking services to GitHub Issues, making it easier to track specific issues and link them to GitHub commits and pull requests. This has also allowed us to clean up our bug tracker - the old system had nearly 8000 tracked issues, some of which were 13 years old or so. On 7th of September, we have released Multi Theft Auto: San Andreas 1.5.6. This release added support for custom IFP animations among other things, like fixing the input and FPS lag reported by some of our users. Then a few days later, we have advised you to upgrade your MTA:SA servers to the latest version due to a server crash exploit that was discovered. There were some additional issues with this hotfix that were spotted later, but they have been all fixed within few days. If you have not yet upgraded your servers though, we still urge you to do so. ? A bunch of interesting MTA:SA-related YouTube videos from this year nX_ Vol.18 - CodeNX™ - 첫 장 - video by ElCrowMvs / map by nX [GTA:DM] Wonder - Interstellar - by Wonder MTA [MTA] Vice City - Map Preview #1 (JStreamer v3) - by Liberty City Roleplay Multi Theft Auto - Tactics - by LoG4nTG Multi Theft Auto - MTA CIT / GTA SA - San Andreas Police Department's 7th Anniversary (Dance Show) - video by PeteyFTW / server: CIT Multi Theft Auto San Andreas Fail + Funny moments #1 - by Mr. Green Gaming Multi Theft Auto: San Andreas - MTA DD - Map: Orgazm Cross - video by Game Master / map by Orgazm MTA:SA Fast And Furious Paradise Trailer ! - by SDRIFTER Abdlmounaim ? Current player counts and version fragmentation statistics Type Amount of players Date / Time Recent peak number of concurrent unique players 30625 players 2018.12.16 (at 16.30 GMT) Highest recorded number of concurrent unique players 34653 players 2018.02.03 (at 17.30 GMT) Recent number of daily unique players 150390 players 2018.12.01 (Saturday) Highest recorded number of daily unique players 185818 players 2018.02.03 (Saturday) Recent number of monthly unique players 605834 players November, 2018 Highest recorded number of monthly unique players 805903 players January, 2018 Player counts were just slightly lower than last year, but we have also had some nice peak values at the beginning of the year. Good to see that there is still an interest in old but great games. MTA:SA Version or series Percentage of players using that version or series as of 24th of December, 2018 1.6.0 (alpha) 0.05% 1.5.6 97.20% 1.5.5 2.00% 1.5.4 (and older) 0.40% 1.4.x 0.20% 1.3.x 0.15% Similar to last year, two of our most recent releases are used by over 99% of our player base. It means that there is little fragmentation between our releases and that players in general upgrade to the newest release once it is available. Also, there seems to be some interest in the newest alpha version as well - that is nice too. ? Status updates Community-wise, our Discord has expanded this year - currently we have got 10 language-specific sections available for you there, as well as the active as usual English ones. We have also opened a new forum section recently to keep appeals for global game bans in one place. Over the next few weeks we intend to refresh our forum rules to better suit the current forum needs. As for mod's development, we will continue working on the next release. We are thinking of integrating a new version of the client installer to reduce amount of issues encountered when installing MTA:SA (as well as to make it easier to investigate the remaining ones). We will also consider adding new features provided by our community members, such as editing collisions and adjusting surface properties by CrosRoad95. That's it for now. ?❄Happy Holidays and all the best to you in 2019! ? -- MTA Team
    1 point
  21. https://code.google.com/p/mtasa-blue/so ... il?r=5106# http://www.pcre.org/ https://wiki.multitheftauto.com/wiki/PregFind https://wiki.multitheftauto.com/wiki/PregReplace https://wiki.multitheftauto.com/wiki/PregMatch Edit: It will be in the next release. (1.3.5)
    1 point
  22. اسال نفسك مين سوالك سمعة جيدة بالمنتدى الع*** مردها عند العم سترونق يربيها مره ثانية اسف ماقدر اتكلم بحرية أخاف يزعل طيطي عمر مسوي معصب انت ووجهك, ترا اطردك
    0 points
  23. الله يرزقني فضاوتك
    0 points
×
×
  • Create New...