Leaderboard
Popular Content
Showing content with the highest reputation on 21/02/19 in all areas
-
نسيت اذكر حاجة جدا مهمة , اعضاء فريق مجتمع العرب كان شرف كبير لنا دخولكم معنا وكان من اجمل الاوقات صراحة قضيناها معكم والعلاقه بتكون مستمرة ان شاء الله بالسيرفر او بدونه احلى تحية لاعضاء فريق مجتمع العرب .4 points
-
Most likely it's fault of scripts, thanks to IIYAMA i got some information about that. There can be plenty of reasons: - badly optimized scripts - too much elementData's (if you don't turn off synchronization, it synchronize with every player and also server), more players = more server resources usage. - high-res models/a lot of objects, or players in one place. - weapon sounds. - things which are drawing frequently on player screen (OnClientRender) I suggest you to check which resource, and what exactly is making big traffic/takes a lot of % of CPU. You will need a resource called 'ipb' which you should have within base server resources. Type start ipb in console, and then, once again type ipb. After that you will have possibility to check which resources are using a lot of CPU/server resources. If i am wrong, i bet IIYAMA, or someone else will correct me.3 points
-
Exemplo com localPlayer -- // CLIENT-SIDE triggerServerEvent( "someTrigger", localPlayer, 1, 2, 3 ); -- // SERVER-SIDE addEvent( "someTrigger", true ); addEventHandler( "someTrigger", root, function( n1, n2, n3 ) print( n1 ); -- // retorna 1 print( n2 ); -- // retorna 2 print( n3 ); -- // retorna 3 --[[ Quando você usa o parâmetro 'localPlayer' em algum triggerServerEvent, o elemento retornado é source. Abaixo está um exemplo simples de como obter o nickname do jogador que executou o 'someTrigger'. ]]-- print( getPlayerName( source ) ); end ); Exemplo com resourceRoot -- // CLIENT-SIDE triggerServerEvent( "someTrigger", resourceRoot, 1, 2, 3 ); -- // SERVER-SIDE addEvent( "someTrigger", true ); addEventHandler( "someTrigger", resourceRoot, function( n1, n2, n3 ) print( n1 ); -- // retorna 1 print( n2 ); -- // retorna 2 print( n3 ); -- // retorna 3 --[[ Agora, quando você usa o parâmetro 'resourceRoot' em algum triggerServerEvent, o elemento retornado é client (que seria o mesmo caso do source, porém client). Veja o exemplo abaixo. ]]-- print( getPlayerName( client ) ); end );2 points
-
2 points
-
Não é necessário, mas como você disse Então sim, pode destruir os elementos e anular as variáveis. A propósito, vejo que você ainda está errando naquilo que eu lhe disse, sobre nomes iguais em tabelas. Veja o seu código com atenção e tente-o corrigir. Cada vez que você posta algo aqui, fico surpreendido com sua evolução. De fato, colocar todos os elementos dentro de apenas uma função, fica bem otimizado. Seus eventos estão otimizados. Lembre-se: verifique o seu código e tente encontrar os erros de repetição.2 points
-
اغلاق مجتمع العرب بشكل رسمي والسبب حاولنا اننا نبحر في عالم الانترنت ونستقطب جميع انواع الهوايات من القيمنق والبرمجة والتصميم وغيرها كان مجتمع العرب من افضل الاشياء اللي سويتها صراحه ومن انجح المشاريع لي شخصيا لكن للاسف فيه سببين غالبا هو السبب باغلاق مجتمع العرب اولا : انا وسترونق اصحاب مجتمع العرب , تقريبا الظروف ماساعدتنا اننا نطوره اكثر واكثر من الرغم اننا سوينا اشياء كثيرة وحاولنا نطلع مجتمع العرب لاجهزه الجوال وحاولنا نسوي منصه اجتماعية ولكن للاسف فشلنا ليس في البرمجة وانما الظروف هزمتنا , فحيث ان كلاً مننا له دراسته الخاصه وله اهتماماته ولقد بذل كل منا مجهود كبير جدا عشان نطلع مجتمع العرب مب بس في هالمنتدى حاولنا اكثر من مره سوينا تطبيقات سوينا الالعاب سوينا برامج سوينا مواقع سوينا استضافات سوينا متاجر وسوينا وسوينا ... الخ لكن لاتجري الرياح كما تشتهي السفن السبب الثاني غالبا يجي عدم اهتمام الناس فينا حاولنا اكثر من مره نسوي اشياء مفيدة ك مشروع سابق لنا وهو موقع للافلام والمسلسلات ومشروع مجتمع العرب بلس لكن للاسف مافي تفاعل يحمسنا اننا نسوي اكثر حتى بعد ماطلقنا المنتدى يرجل مافي احد سجل وغالبا هالشيء يجي من عدم اهتمام الاشخاص في جالسين نسويه , حاولنا ندعم افكاركم قلنا لكم عطونا افكاركم نعطيكم فلوس عطونا افكاركم نصف الربح بيكون لك سوينا مسابقات كثيرة وغالبا اكبر مسابقة في رمضان اللي راح , وللاسف تفاعل جدا ميت لذلك ردة الفعل بالنسبة لنا بتكون ميته ولكن حاولنا اكثر من مره اننا نطلع بشيء كويس , على سبيل المثال لعبه سبع ابواب واللي بالمناسبة هو مشروع حي جالسين نشتغل عليه , لكن بيطلع باسم غير مجتمع العرب عالعموم هالمشروع كان من المفترض انه يكون من اكبر المشاريع في مجتمع العرب ولكن للاسف مافي اي تفاعل , تقريبا بتقول معكم هالمشاريع وجاي تنشرها عندنا بمنتدى اللعبه ؟ غالبا ان هنا يوجد اصدقاء اعرفهم واريد اخذ ارائهم وتم نشر موضوع اللعبه في انداي قوقو اللي هي غالبا تدعم المشاريع وبرضو مافي اي اهتمام من المجتمع العربي ولا في اي اهتمام هنا , على سبيل المثال والله مافي احد تعب نفسه وجاني خاص ي خالد وش الفكرة وش بتسوون مافي اي اهتمام يرجل , لذلك قررنا اغلاق مجتمع العرب تحياتي . ادارة مجتمع العرب - خالد العمري - سترونق2 points
-
Quando você aciona a função de aparecer o login ou registro, você está CRIANDO novamente o conteúdo, esse é o motivo do travamento. Use simplesmente a função guiSetVisible para deixar a window visível. Outro detalhe: você está usando, novamente, o mesmo nome para dois elementos. Isto: CEGUI.image["background"] = guiCreateStaticImage( 0, 0, screenW, screenH, "files/background.jpg", false ) Troque o nome da janela de registro para "background_register" e a janela de login para "background_login". Daí, para fazer aparecer ou ocultar, basta fazer isso: addEventHandler ("onClientGUIClick", guiRoot, function() if (source == CEGUI.button["back"]) then guiSetVisible( CEGUI.image[ "background_login" ], true ); -- // Irá voltar para a janela de login guiSetVisible( CEGUI.image[ "background_register" ], false ); -- // Irá ocultar a janela de registro e seus respectivos elementos que estão anexados. end end end)2 points
-
addEventHandler + group elements I noticed that some people like to add 10000000000000000 addEventHandlers for each element, while you probably only need 1 addEventHandler. Using ONE addEventHandler on a group of elements? Answer: local group = createElement("groupMyCutePeds") -- Create a custom element and save it in to the variable <group>. -- Create 3 peds. local ped1 = createPed(120, 5540.6654, 1020.55122, 1240.545) local ped2 = createPed(120, 5541.6654, 1021.55122, 1240.545) local ped3 = createPed(120, 5542.6654, 1022.55122, 1240.545) -- Set the parent of the 3 peds. setElementParent(ped1, group) setElementParent(ped2, group) setElementParent(ped3, group) -- Add an addEventHandler and use the <group> as <attachedTo> element. addEventHandler("onPedWasted", group, -- "onPedWasted" = serverside. "onClientPedWasted" = clientside. function () outputChatBox("One of my cute peds just died. ;'( No exceptions!") end) Code is untested, but the method is tested. Syntax for functions in example createElement syntax element createElement ( string elementType, [ string elementID = nil ] ) setElementParent syntax bool setElementParent ( element theElement, element parent ) addEventHandler syntax bool addEventHandler ( string eventName, element attachedTo, function handlerFunction, [ bool getPropagated = true, string priority = "normal" ] ) DO NOT disable getPropagated getPropagated: A boolean representing whether the handler will be triggered if the event was propagated down or up the element tree (starting from the source), and not triggered directly on attachedTo (that is, handlers attached with this argument set to false will only be triggered if source == this). If you disable this, children of the <group> element are not included. Make use of the element tree Element tree For applying addEventHandlers to elements created by the resource: Use: resourceRoot / getResourceRootElement For applying addEventHandlers to elements created by scripts of the resource: Use: getResourceDynamicElementRoot For applying addEventHandlers to elements created by maps of the resource: Use: getResourceMapRootElement I hope your code will be without... print(10^10^10^10) -- Print here: https://www.lua.org/cgi-bin/demo ...addEventHandlers in the future.1 point
-
Hola vengo a compartirles un pequeño gran proyecto en el cual estuve trabajando hace mucho tiempo y con el poco tiempo que pude fui adelantando y modificando fue creado a base de un concepto creado por uno de los lideres de la comunidad Insane Style Gamers RACE CONCEPT: https://imgur.com/KFp14Uc USERPANEL CONCEPT: https://imgur.com/I99yU9c Lo que logre hasta ahora1 point
-
1 point
-
1 point
-
1 point
-
Tente redimensionar para 256, tanto na largura quanto na altura. Se mesmo assim não funcionar, baixe outra camisa.1 point
-
1 - dentro do evento onClientGUIClick 2 - Como você removeu os códigos em hex. dos nicks na gridList, você vai precisar obter o jogador assim, por exemplo: function _getPlayerFromName( name ) if not (name) then return false end -- for i,p in pairs(getElementsByType("player")) do if getPlayerName(p):gsub("#%x%x%x%x%x%x", "") == name then return p end end return false end Feito isso só substituir o uso da função getPlayerFromName por essa. Para verificar element-data você vai usar o jogador obtido com a função acima, e para as armas faça um loop com a função getPedWeapon verificando o slot do jogador com os slots de 0 a 12.1 point
-
Então mano. É o seguinte: A versão desse teu servidor está bem desatualizada. Já estamos na versão 1.5.6-release-16535 (servidores locais geralmente atualizam automaticamente) Se você olhar na Wiki da função getAccountID, vai perceber que existe um aviso de versionamento logo no começo, indicando que esta função só retorna o ID a partir daquela versão ali. Como vc está numa versão antiga demais, então no seu servidor essa função ainda não existe. E é justamente isso que o erro está dizendo, que não encontrou a função global getAccountID. Entre em contato com sua host e solicite a atualização do servidor para a versão mais nova.1 point
-
Por se tratar de índices de tabelas, pode repetir sim. Da mesma forma que as tabelas indexadas com números repetem os índices de outras tabelas com números. Índices de string também podem repetir, mas não na mesma tabela. Já tentou usando guiSetText?1 point
-
@SuperX الخبر قد ازعجني جدا لانني كنت احب هذا السيرفر جدا بدون مبالغة ولم اكن اتواجد بأي سيرفر بسيرفرات الديسكورد عداه وهو اول سيرفر ديسكورد احببته والله بدون مبالغة كان سيرفر حلو خصوصا اعضائه واتمني انه يرجع يوما ما + كل كلامي مافيه مزح والله كتبته منجد1 point
-
No, you can disable synchronization whenever you setElementData. Anyway i had bad experience with elementData's, with same count of players. That's why i'm gonna test custom system for it. I don't think so that disabling fourth argument will help so much. https://wiki.multitheftauto.com/wiki/SetElementData bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )1 point
-
You can use tables as fast-temporary-storage, i will test soon custom temporary data system, thanks to help from MTA forums. (Check topics which i have created, related to them.) You can read about it here, it's simple, i already learned how to use it. Of course you don't need to use tables everywhere, you can setElementData, only when is important and needed, that's what i learned.1 point
-
1 point
-
Tem este shader que faz esse efeito: https://community.multitheftauto.com/index.php?p=resources&s=details&id=7349 Uma dica pra você otimizar o evento "onClientGUIClick" é sempre definir guiRoot (assim como você fez no seu código) em vez de root/getRootElement(). Isso quando você não anexar o evento diretamente a um elemento GUI. guiRoot irá englobar todos os elementos GUI criados no próprio resource, enquanto root fará executar para todos GUIs criados. Sobre usar o guieditor, pessoalmente eu prefiro sempre usar, pois crio esboços antes de fazer meus projetos, e isso também ajuda muito quem não tem muito conhecimento, vai te poupar tempo posicionando sem nenhuma ferramenta. É possível também usar uma folha pra calcular manualmente.1 point
-
Coloque false depois de 'click' na linha 9. Na função click, você está usando o parâmetro state e verificando se o clique está 'segurado'. Mas na verdade esse parâmetro só funciona para o state "up" (botão solto), tornando essa verificação desnecessária. Também, a verificação (source == playerList) será desnecessária já que source sempre será a gridList, e por fim, gui deve estar definido no seu código, caso contrário a verificação será sempre invalidada. Sobre o clique nas rows, o código funcionará assim: local sr = guiGridListGetSelectedItem (source) -- obtendo a row selecionada if sr and sr ~= -1 then -- verificando se o clique foi na row local playerName = guiGridListGetItemText ( source, sr, 1 ) -- obtendo o valor da row selecionada outputChatBox ( playerName ) else -- o clique foi fora de qualquer 'row' outputChatBox ( "Nenhuma row selecionada" ) end1 point
-
Faça assim: -- // CLIENT-SIDE addEventHandler( "onClientPlayerDamage", root, function( attacker, weapon, bodypart, loss ) cancelEvent( ); -- // Cancela o dano if ( attacker == localPlayer ) then -- // Verifica se o 'attacker' é o jogador que está dando dano e não o que está sofrendo o dano triggerServerEvent( "onClientGotDamage", localPlayer, attacker, weapon, bodypart, loss, source ); -- // Sincroniza o dano else if ( weapon == 53 ) then -- // Verifica se o jogador sofreu uma queda setElementHealth( localPlayer, loss ); -- // Sofreu? Então ele perderá vida end end end ); -- // SERVER-SIDE local TABLE_DAMAGE = { -- // [ID da Arma] = Novo Dano [23] = 20, -- // Pistola Silenciada [24] = 35, -- // Desert Eagle [30] = 25, -- // AK-47 }; addEvent( "onClientGotDamage", true ) -- // atirador, arma, bodypart, dano, alvo addEventHandler( "onClientGotDamage", root, function( attacker, weapon, bodypart, damage, target ) if ( not isPeadDead( attacker ) ) then -- // Caso o atirador esteja morto, o alvo não sofrerá mais danos local newDamage local targetArmor = getPedArmor( target ); -- // Obtém o valor do colete (se tiver) local targetHealth = getElementHealth( target ); -- // Obtém o valor da vida if ( getElementData( attacker, "mane123" ) ) then -- // A sua verificação, se ele é um "admin" local g_Damage = TABLE_DAMAGE[ weapon ] or damage; newDamage = g_Damage; if ( targetArmor > 0 ) then -- // O alvo tem colete? setPedArmor( target, targetArmor - newDamage ); else -- // O alvo não tem colete? Então bora tirar a vida dele. local h = math.max( targetHealth - newDamage, 0 ); setElementHealth( target, h ); if ( h <= 0 ) then killPed( target, attacker, weapon, bodypart, false ); end end end end end );1 point
-
Obtenha o texto com guiGetText e verifique se é maior que 0. Exemplo: local g_Text = guiGetText( eLogin ); if ( #g_Text > 0 ) then -- O símbolo # (hashtag) antes de uma variável que é string, retorna o valor de caracteres que essa variável possui. -- // blá, blá, blá end OBS.: Não é recomendado colocar o mesmo nome da variável para a mesma função. Você definiu "eLogin" para o campo de login e registro. Sendo assim, use sempre tabelas para armazenar e poupar Memória RAM do jogador. local CEGUI = { window = { }, button = { }, edit = { }, gridlist = { } } -- // Exemplo com números CEGUI.window[ 1 ] = guiCreateWindow( ... ); CEGUI.button[ 1 ] = guiCreateButton( ... ); CEGUI.edit[ 1 ] = guiCreateEdit( ... ); CEGUI.edit[ 2 ] = guiCreateEdit( ... ); -- // Exemplo com strings (nomes) CEGUI.window[ "janelaPrincipal" ] = guiCreateWindow( ... ); CEGUI.button[ "botãoRegistro" ] = guiCreateButton( ... ); CEGUI.edit[ "campoUsuário" ] = guiCreateEdit( ... ); CEGUI.edit[ "campoSenha" ] = guiCreateEdit( ... ); --[[ Você pode usar tanto números quanto nomes. (Para mim, nomes são melhores para facilitar o que cada um é) SIM! Você pode usar acentuação caso esteja usando strings. ]]--1 point
-
Insert this line somewhere your code: -- SERVER SIDE setTimer(restartResource, 600000, 1, getThisResource())1 point
-
1 point
-
1 point
-
Even better idea would be offical MTA tournaments in DD and other competitve gamemodes. But this is a good idea anyway. I support it.1 point
-
I support this ideea but i believe it will need alot of work to make it happen but if this will ever happen it could open up the competitive side of the Destruction Derby. I believe that not only the DD side of the game gets overlooked but the whole game, anyways would be good to see streamed (and maybe commented) tournamens (just like other competitive games) because i know that top clans will agree with me when i say that there is definitely a major strategic side to DD clanwars.1 point
-
0 points
-
الخروج عن سياق الموضوع المرة القادمة سوف يؤدي الى تحذيرك0 points
-
بلاك ولا وايت وايت ولا بلو بلو ولا ريد ريد ولا يلوو ؟ بلوو ولا بلوتو ؟ بلوتو ولا نبتون ؟ نبتون ولا اورانوس ؟ اورانوس ولا المشتري ؟ المشتري ولا المباع ؟ المباع ولا المأخوذ ؟ المأخوذ ولا المعطى ؟ المعطى ولا المعطيات ؟ المعطيات ولا الرايحات ؟ الرايحات ولا الجايات ؟ الجايات ولا الذاهبات ؟0 points