Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 17/09/20 in all areas

  1. @Patrick Thank you very much for being kind and helpful, you're answer helped me a lot.
    1 point
  2. Para isto, você vai precisar, que sua bindKey, ative um comando. Exemplo : -- # Client-Side. addCommandHandler ("painel aleatorio", function ( ) outputChatBox ( "Testar.", 255, 255, 255, true ) end) bindKey("F2", "down", "painel aleatorio") Então, aparecerá no Esc/Opções/Teclas para ser editada.
    1 point
  3. Hi, There is a problem with C:\Windows\system32\DRIVERS\amdxhci.sys on your PC, it's not original and authentic but it has been produced by, or tampered with by, something that is usually used in correlation to malware or hacks. It's most likely a symptom of a virus infection on your PC. Likewise, if you installed custom or non-official drivers on your PC after re-installing (you apparently downgraded from Win10 to Win7, went with a fresh install), don't use that. Search for official drivers, like those that i will link in the below instructions Steps: Note: the video drivers steps are mentioned in 1 breath because they tend to include USB drivers (as part of the chipset drivers). 1) Run full virus and malware scans 2) Download DDU from https://www.wagnardsoft.com/forums/viewtopic.php?f=5&t=3271 and run it, selecting in your case "ATI" 3) Uninstall "AMD USB3" driver/software, or any USB related stuff on your PC 4) Check if the mentioned file is still there. If it is, delete it, but if you can't delete it, go into your Windows 7's safe mode 5) Install the latest drivers for your card, in your case download them from https://www.nvidia.com/Download/driverResults.aspx/162977/en-us 6) Install the latest drivers for your USB3, which can be found at https://www.win-raid.com/t834f25-USB-Drivers-original-and-modded.html Then it should be solved EDIT: Instructions are changed, @yuyu
    1 point
  4. Isso é Um Exemplo de como você pode fazer isso, já que não significa que o cara que fez o mod da concessionária colocou o ElementData com a Chave ID. --supondo que o cara comprou o carro e o " ElementData " do Carro é o id do player com a chave ID. -- Ficaria assim na concessionária: setElementData([veiculo],"ID",id) -- "[id] é o id do player" --ai pra mandar a msg function mandarmsg(veh) local id = getElementData(veh,"ID") if id then local acc = getAccountByID(id) local player = getAccountPlayer(acc) outputChatBox("#FFFF00[DESMANCHE] #FFFFFFO OH NÃO SEU CARRO FOI DESTRUIDO! .. ;-; .",player,r,g,b,true) end end addEvent("msg",false) -- se a função tiver no mesmo script do desmanche deixe como false, senão bota como true. [true ativa o trigger remoto] addEventHandler("msg",root,mandarmsg) --- Isso é um Exemplo!!!!!!!!, já que sem o script que seta a Info no carro eu não tenho como adivinhar qual chave o cara usou, eu usei aqui a Chave ID pra dar uma idéia de como seria.
    1 point
  5. TUTORIAL/GUIDE NO LONGER MAINTAINED This tutorial is no longer maintained and it's contents may be deprecated or no longer work. I created this tutorial in 2014, when I was very involved with MTA and the community around it. Due to the nature of life, I ended up leaving MTA to focus on more important things (work, family, life, etc). I believe this tutorial has helped a lot of people get into scripting for MTA over the years, and I'm happy I was able to do answer questions and help people get into coding! Introduction Hello everyone, and thank you for viewing my introduction for Lua scripting. This tutorial will cover the basics of Lua, but nothing too advanced. This tutorial is highly detailed and should give you a pretty good understanding on how Lua works, even if you have never coded it before. Something to remember is that I do not teach or even talk about using object-oriented programming in this tutorial. Things you'll be learning: For general lua - Variables - Complete - Tables - Complete - Functions - Complete - Return - Complete - Loops - Complete - If/Else/Elseif - Complete - Usage of pre-defined variables Any type of programming - Formatting your code For mta - Create a resource and what is required for one - Complete - Events - Complete - Commands - Complete - Exports & how to call one - Complete So, now that you know what you're going to be learning about, let's get started! Variables Tables Functions Working with return inside functions Loops If/Else/Elseif Usage of pre-defined variables __________________________________________________________________________________________________ Formatting your code __________________________________________________________________________________________________ Making a resource Introduction to events Commands Exports Good luck with your Lua scripting career, I hope that this tutorial has helped you!
    1 point
  6. Okay, so in this tutorial you will learn how to export a function, in this side to show a GUI and set the label text using "exports" let's start of with making the actual GUI part. requirements: a brain and an image called "warning.png" placed in a folder called "files" warning = guiCreateWindow(756,395,409,290,"Warning!",false) guiSetAlpha(warning,1) warningimage = guiCreateStaticImage(122,28,159,92,"files/warning.png",false,warning) warninglabel = guiCreateLabel(17,145,377,89,"Warning msg",false,warning) guiSetFont(warninglabel,"clear-normal") warningButton = guiCreateButton(18,245,376,29,"Close",false,warning) guiLabelSetHorizontalAlign(warninglabel,"center",false) Now we got our GUI, we'll need to make the function which we will later export. function warningWindow() end Okay, when we trigger the export, we will send a message right? So, we will need to retrieve the message by doing: function warningWindow(message) end Sweet! Now let's make sure that the GUI is actually visible and show them a cursor when we trigger the function using the export. function warningWindow(message) guiSetVisible(warning, true) showCursor(true) end And, of-course setting the label text to the message we will retrieve. function warningWindow(message) guiSetVisible(warning, true) showCursor(true) guiSetText(warninglabel, message) end Okay, now I think we're done with the function so let's add the event (because we will need to trigger it server sided if we make an export for server sided which we will!) and let's don't forget to disable the window when the players presses on the close button! warning = guiCreateWindow(756,395,409,290,"Warning!",false) guiSetAlpha(warning,1) warningimage = guiCreateStaticImage(122,28,159,92,"files/warning.png",false,warning) warninglabel = guiCreateLabel(17,145,377,89,"Warning msg",false,warning) guiSetFont(warninglabel,"clear-normal") warningButton = guiCreateButton(18,245,376,29,"Close",false,warning) guiLabelSetHorizontalAlign(warninglabel,"center",false) guiSetVisible(warning, false) function warningWindow(message) guiSetVisible(warning, true) showCursor(true) guiSetText(warninglabel, message) end addEvent("warningBox", true) addEventHandler("warningBox", root, warningWindow) function disableWarning() guiSetVisible(warning, false) showCursor(false) end addEventHandler("onClientGUIClick", warningButton, disableWarning) And, voila! You now have the full client code above! Now let's make the server-sided part! Since it's server-sided we need to retrevie the player and what message, so we just do as we did earlier function warningBoxServer(player, message) end And now we trigger the client event which we added with what player and what message. function warningBoxServer(player, message) triggerClientEvent(player, "warningBox", player, message) end Okay, now we're done with the lua part! Let's add those two functions to the meta! <export function="warningBoxServer" type="server"/> <export function="warningWindow" type="client"/> And now we can use this! --client: exports.RESOURCENAME:warningBox("Your message!") -- server: exports.RESOURCENAME:warningBoxServer(player, "Your message!") Enjoy, I tried to be so clear as I possibly could and hope you learnt something.
    1 point
×
×
  • Create New...