Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 30/08/18 in all areas

  1. أستطلاع اخر: ماذا تريد ان يكون تصميم السيرفر معتمد على ؟ - GUI كافة الاشياء تكون بتصميم الجيو (Like) - DX كافة الاشياء تكون بتصميم الدي اكس (Thanks) - DX & GUI الاشياء المهمة تكون دي اكس لكن الاشياء البسيطة تكون جيو (Hahaha) التصويت يكون بالرياكشن حتى لانطيل الموضوع -
    6 points
  2. Fiz esse exemplo pra ficar mais fácil. A variavelAzul também funciona dentro da área verde e da vermelha, mas a variavelVerde não funciona na área azul mas funciona na vermelha. E a variavelVermelha só funciona dentro do próprio escopo onde ela foi criada. A variável azul funciona em todo esse arquivo.lua, mas somente dentro dele. Se não fossem variáveis locais, elas funcionariam em qualquer lugar do seu script, inclusive fora deste arquivo.lua. Mas não funcionariam em scripts de lado oposto ao script de origem. (Se este arquivo.lua for client-side, elas não funcionam em arquivos server-side e nem vice-versa.) De forma resumida: As variáveis locais funcionam somente em seu escopo e nos escopos que estão dentro dele. Mas nunca funcionam fora de seu escopo. No caso da variavelAzul, que não está dentro de um escopo, ele funciona no script inteiro. -------------------------------------------------------------------- Esse é um dos principais motivos do porquê é importante indentar seu código (colocar os espaços no início das linhas), pois demarcam quais linhas pertencem a qual escopo, deixando o código muito mais fácil de interpretar e ler.
    1 point
  3. A pergunta que voce tem que se fazer é .. eu preciso disso em mais algum lugar? se sim : não se usa local se não : usa local exemplo : voce tem um arquivo chamado "config.lua" e tem nele este codigo: config = { priceweapons = 5000, priceColete = 2000 } como voce vai usar isso em outros arquivos, entao esta tabela nao pode ser local, quando voce torna uma variavel local ela só é acessivel dentro daquele arquivo. cuidado tambem ao usar local dentro de funçoes exemplo: local info = {50,200,10} function execute() local info = {} end neste caso a funcao execute esta criando uma nova tabela dentro de seu escopo. local info = {50,200,10} function execute() info = {} end neste caso a funcao execute esta resetando a tabela info. Espero ter ajudado vlw '-'
    1 point
  4. setTimer(function() local ped1 = createPed(125,2581.99756, -2137.35791, -0.10042) setPedRotation(ped1, 90.0041198) setPedAnimation(ped1, "WUZI", "CS_Dead_Guy", -1, true) end, 100, 1)
    1 point
  5. 1. onClientPedDamage (2-nd parameter). cancelEvent() will disable damage 2. element data . You can store it into database by using triggerServerEvent triggerServerEvent("your_event_name",localPlayer,getElementData(localPlayer,"name") ) 3. I can't undestand this question a little bit. @wlasser
    1 point
  6. I think this can help you (change it to false) @Samking
    1 point
  7. اجل تباها ما تخلص ابدا و انت اخر سنه ؟ههههههههههه
    1 point
  8. addCommandHandler ("teste1", function () local numero1 = 1 if numero2 > 1 then -- Erro: Impossivel calcular nulo com 1. outputChatBox ("Olá") end end) addCommandHandler ("teste2", function () local numero2 = 2 if numero1 > 0 then -- Erro: Impossivel calcular nulo com 2. outputChatBox ("mundo.") end end) Local é usado para variáveis que devem ser usadas somente dentro do escopo em que foram criadas. Faça o seguinte teste: Crie 2 funções com um addCommandHandler diferente em cada uma delas. Dentro de cada função crie uma variável local com um valor diferente em cada uma. Tente usar a variável de uma função na outra função e perceba que ele vai dar erro como se a variável nem existisse. Também é possível fazer funções locais.
    1 point
  9. خلاص كل سنة حاول ترسب
    1 point
  10. كل مشآرآتك مآلهآ فآيدة .. يآريت مآ تشآرك دآم كدآ آحسن ..
    1 point
  11. اوهه, أنا آسف ما انتبهت من النوم والله, آسف مره ثانيه
    1 point
  12. بالتوفيق
    1 point
  13. local sx, sy = guiGetScreenSize ( ) function centerGUI ( guiElement ) local width, height = guiGetSize ( guiElement, false ) local x, y = ( sx / 2 - width / 2 ), ( sy / 2 - height / 2 ) guiSetPosition ( guiElement, x, y, false ) end function showHide() if isElement(wind) then destroyElement(wind) showCursor(false) removeEventHandler("onClientGUIClick",getRootElement(),buttonClick) end end addEventHandler("showHide",getLocalPlayer(),showHide) function showGUI (event) wind = guiCreateWindow(423, 331, 523, 367, "", false) guiWindowSetSizable(wind, false) showCursor(true) centerGUI(wind) -- tabpanel = guiCreateTabPanel(11, 109, 502, 241, false, wind) bt_close = guiCreateButton(5, 5, 153, 42, "Закрыть", false, wind) local memo = guiCreateMemo(11, 109, 502, 241,event['description'],false,wind) guiMemoSetReadOnly(memo, true) bt_accept = guiCreateButton(5, 55, 153, 42, "Принять", false, wind) eventButton = event addEventHandler("onClientGUIClick",getRootElement(),buttonClick) end addEvent("showEventGUI", true) addEventHandler( "showEventGUI", localPlayer, showGUI ) function buttonClick(bt, st) if bt == "left" and st == "down" then if source == bt_close then showHide() elseif source == bt_accept then -- triggerServerEvent("startEvent") --function startEvent(eventId, player) triggerServerEvent("startEvent",resourceRoot, localPlayer, eventButton['id']) -- there is event_id? showHide() end end end i made a little edit. Now it should work properly @wlasser
    1 point
  14. السلام عليكم ورحمة الله وباركته كيفكم ي مسلمين ان شاءالله كلكم بخير اليوم حبيت اقدم لكم موضيعي الخاص و انشاءالله يعجبكم الموضوع هو 1- ماذا تريد ان تعرف عني ؟ 2- ما سبب كرهك لى ؟ 3- ماذا انا بنسبة لك ؟ وانشاءالله اشوف تفاعلكم ودعمكم واتمنى نجاحكم كلكم وشكراَ للجميع
    1 point
  15. المدرسة جميلة ، تسليك وتاخذ معلومات جديدة يعني فلة وبس ، من ناحيتي ودي ان الدراسة ماتخلص للأبد ..
    1 point
  16. اللهم فجر جميع المدارس : امين اللهم اخسف بجميع المعلمين والمعلمات الارض : امين اللهم فجر معمل الكيمياء : امين اللهم انتقم من مدرس الفيزياء : امين ومدرس الرياضيات : امين ومدرس اللغة الفرنسية : امين اللهم اخسف بهم الارض : امين اللهم اخسف بهم الارض : امين اللهم اخسف بهم الارض : امين
    1 point
  17. اخاف اقولك وتزعل . اكيد تعرف وين تحطها في الكود يالطيب ..
    1 point
  18. Use o evento "onClientRender". Dentro desse evento, você pode verificar se está ou não num veículo com a função getPedOccupiedVehicle e dxDrawText pra mostrar o texto.
    1 point
  19. يا أخوان الموضوع انحل من اول رد وانتم للحين تعيدون وتزيدون
    1 point
  20. You can easily find the resource/piece of code responsible for anything you'd like to locate, by using certain tools. My favourite method: - download & install Notepad++ (https://notepad-plus-plus.org/download) - go to the main folder (parent to all your resource folders) and use Windows explorer to perform a file search for: *.lua like this; Depending on the size of your gamemode, all script files (.lua) will be the search result after a while. Now, select all of them (CTRL + A) and rightclick, "Edit with Notepad++". Notepad++ will take a while to open all files at the same time, again depending on the amount and size of them (trust me, it's never a hang.. just wait). The final step is, once Notepad has the files open, to press CTRL + F which is the "Find" window. Now, enter the keyword or what you need to locate in which script it is (in your case the "OMG ...arabic text.. OMG") and don't just hit enter or search, but click: "Find All in All Opened Files". It's exactly this button: Now we're done, all results from any script files are listed at the bottom of your screen, nicely sorted. Ofcourse grep is easier and quicker ('better' editors like VS code can even include similar functionality), this is just for beginners. You can use these instructions for any type of file if you change the search query in explorer (like .xml, .fx, .js, anything that can be found in resources and contains code or text). Novice tip: you could search (in Notepad++) for anything you see visually in-game (in text form) to identify the resource and part of the code responsible, just write it over from your screen or copy it. These methods are especially helpful when you're not very familiar with your codebase.
    1 point
×
×
  • Create New...