Jump to content

Help with scripting


Mike269

Recommended Posts

There is no "best way". People have different ways of learning and it is up to you to decide what you like the most.

Personally, I like to learn via trial and error; it can and will be frustrating at times. But by doing this, you'll learn how to try to fix it yourself, rather than ask on a forum as soon as an issue arises.

Start with a small project, get familiar with client-sided code and then take it from there. Start with outputting messages, play around with how elements and element data work

Most importantly; Get used to navigating the MTA Wiki, being able to find functions or events to accomplish what you want is crucial.

It may not sound like much of an advice, but this is how I started and got myself into scripting and programming.

Link to comment

Of course , it's pretty easy.

  
  
Accepted = guiCreateButton(100, 385, 133, 22, "ACCEPT", false) -- Creation of the button "Accepted" 
  
addEventHandler ("onClientGUIClick", getRootElement(),  
function() 
    if source == Accepted then  -- If the clicked button is Accepted then 
        outputChatBox("Button Clicked") -- It output a message " Button Clicked " 
        end 
        end)  

This should make you know , how it work. If you have more questions , feel free to say :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...