waqaarali Posted April 21, 2014 Share Posted April 21, 2014 Well i read MTA SA Scripting Wiki 500 times and i try stuff out but i am such a big noob that i still can't get it to work, can someone give me some tips to learn scripting quickly ? I been trying to script for the last 2 years but it didn't work out for me, I tried to make a script again for the last time but it still didn't work i wanted to make a simple Spawn GUI but i failed again please someone help me to learn scripting, Client Side resourceSpawn = getResourceRootElement() function showMain( theResource ) mainwindow = guiCreateWindow(236, 197, 405, 296, "", false) guiWindowSetSizable(mainwindow, false) hospital = guiCreateButton(18, 42, 117, 43, "Hospital", false, mainwindow) police = guiCreateButton(18, 104, 117, 43, "Police Department", false, mainwindow) cityhall = guiCreateButton(18, 168, 117, 43, "City Hall", false, mainwindow) ammunation = guiCreateButton(18, 234, 117, 43, "Ammunation", false, mainwindow) memo = guiCreateMemo(143, 43, 252, 234, "Welcome to Gangsta's Paradise Roleplay Server. Before you can start playing please select one of the positions you would like to spawn. Remember once you have spawned you cannot then come back to this window unless you die. So make a wise choice before you spawn.\n\n\n\n\nSpawn Script By Gangsta v1 ", false, mainwindow) guiMemoSetReadOnly(memo, true) showCursor ( true ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showMain) Link to comment
waqaarali Posted April 21, 2014 Author Share Posted April 21, 2014 When people click on the buttons i want people to spawn to there . Link to comment
-.Paradox.- Posted April 21, 2014 Share Posted April 21, 2014 Events onClientGUIClick Functions spawnPlayer Btw i read the whole wiki in 1 hour and only one time. Try to read it carefully and watch to every step Link to comment
Vinctus Posted April 22, 2014 Share Posted April 22, 2014 Reading the wiki doesn't make you any better scripter, you has to understand what you are doing as well Link to comment
tosfera Posted April 22, 2014 Share Posted April 22, 2014 Reading the wiki doesn't make you any better scripter, you has to understand what you are doing as well You can read all you like but you'll never be able to fix a problem if you keep working out of a book or wiki page. Trying and gettings errors, that's what makes you better. Understanding every bit of code step by step, that's what makes you a great scripter / programmer. As a tip from me; grab someone his code, an easy script. Read it, understand it, rewrite it. Link to comment
Noki Posted April 22, 2014 Share Posted April 22, 2014 If you've been trying for the past 2 years, and it "doesn't work out for you", then you have no motivation. You need motivation to start with. I remember when I learnt Lua. I sat myself down and said to myself, "I am going to learn this shit even if it drives me crazy". I sat down 6 months ago, and now I can confidently say I'm a reasonable scripter. It's all about motivation and willpower. If you read the Wiki over and over, you'll never learn! It's about writing, testing and fixing and doing it all over again. Just find a simple snippet of code, study it and rewrite it, as tosfera said. I know multiple languages, and that's how I've learnt. Trying. If you don't put effort it, you won't get any return. function helloWorld() outputChatBox("Hello world!") end addCommandHandler("hello", helloWorld) It's all about basics. Good luck. Link to comment
myonlake Posted April 22, 2014 Share Posted April 22, 2014 NOki: As a pro-tip of the day; use indentation when doing code. I know you know this, but your code isn't doing so. It's important, because it makes code readable. Link to comment
Wisam Posted April 22, 2014 Share Posted April 22, 2014 lol story of my life, but now i can script a bit and still learning btw thanks for the tips Link to comment
Perfect Posted April 22, 2014 Share Posted April 22, 2014 Well, First of All, don't Panic. Scripting is a thing, which can gain by time and petiance. It is a thing of knowledge. It is not like reading whole wiki in few minutes and telling your self "I am a Programmer now!!". You also have to practice, make a simple script as N0ki paste, then Improve it by adding something like setElementPosition, etc.... I can see that you didn't straightly practice script those 2 years. I think you practice 1 or 2 days then left it and then now you again want to learn. well, You also need to increase your basic vocabulary. You can start it from here :- https://wiki.multitheftauto.com/wiki/Sc ... troduction If you have any doubts as little as which function to use for something, you can come here and ask it freely. We are always eager to help new programmers. I myself started it in 2011 and left it for some reason and now again i am trying ragain my Scrpting Knowledge. Link to comment
Noki Posted April 22, 2014 Share Posted April 22, 2014 NOki: As a pro-tip of the day; use indentation when doing code. I know you know this, but your code isn't doing so. It's important, because it makes code readable. I know how to indent, but I just typed something out quickly in my browser. And yes, indentation is a must. Link to comment
-.Paradox.- Posted April 22, 2014 Share Posted April 22, 2014 (edited) Try http://www.lua.org Edited April 22, 2014 by Guest Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now