waqaarali Posted March 5, 2013 Share Posted March 5, 2013 (edited) Ok i will explain to you how i started to learn scripting firstly i read the MTA:SA Scripting Wiki, Read it like 10 times then i made a GUI Rules Panel which they show you how to make, this is important don't just copy it because then you don't learn from copying also it's not a developed script by you then. Once you have read Wiki and you understand it then go to forum.multitheftauto.com and go to the scripting section and find and useful basic scripts that you can learn of. Or you can find some scripts you can learn of at community.multitheftauto.com. Here is an example below of a script i made with Wiki and other script ideas! Note : This is one of my script also available on community! Client Side local testGrid = guiCreateGridList( 0.8, 0.6, 0.2, 0.03, true, testWindow ) -- guiCreateGridList( x axis, y axis, width, height, absolute/relative numbers, is it attached to something ) --right, lets make some labels that tell you a number of online players local testLabel = guiCreateLabel( 0.8, 0.6, 0.2, 0.04, 'Online Players: ', true, testWindow ) -- guiCreateLabel( x axis, y axis, width, height, name, absolute/relative numbers, attached to ) setTimer( -- lets create a timer function( ) -- timer needs a function guiSetText(testLabel, 'Online Players: '.. #getElementsByType('player')) -- set new text to stuff, for this instance to the label we created earlier end, 100, 0 -- lets end the function and set 100miliseconds to get the function executed, for infinity times ) -- lets close the timer Meta.xml type="script" decription="Online Players 1-100" name="Online Players" version="1.0" author="Gangsta"/> Ok this is a simple GUI script i had made my second script when i was new to scripting, it took me about approximatley 10-15 Minutes because i was new. Ok so here you go a simple start of scripting! Also still learning how to script btw not a pro yet! : D Edited March 6, 2013 by Guest Link to comment
Baseplate Posted March 6, 2013 Share Posted March 6, 2013 Looks like a spaghetti code with no explication. Try to explain the code step by step, I do know how to make that but just showing things to others. Link to comment
manve1 Posted March 16, 2013 Share Posted March 16, 2013 looks like my code i made earlier for one of my gamemodes. Link to comment
codeluaeveryday Posted March 16, 2013 Share Posted March 16, 2013 testWindow is not defined, returning false. @Manve, I started off by making a speed booster using the mouse scroll. Link to comment
manve1 Posted March 16, 2013 Share Posted March 16, 2013 I know that the window isn't defined, but i still can see that he didn't create this, as i got this in one of my scripts for a long time, and the description is mine aswell, he once asked me about how to create scripts with gui's in it, i gave him the description and this kind of code. Link to comment
PaiN^ Posted March 16, 2013 Share Posted March 16, 2013 (edited) I think [basic Help With Scripting For Starters] should be about the most usable functions in scripting, Such ass addEventHandler and addCommandHandler and not gridlists and labels ... EDIT : Fixed addEventHandler ! Edited March 16, 2013 by Guest Link to comment
manve1 Posted March 16, 2013 Share Posted March 16, 2013 You misspelled 'addEventHandler' (( you spelled 'addEventHanderl' )) after all, i think this topic should be locked or deleted as he posted this code without me noticing about it, as this code is mine + description on it is mine (( i know description is bad )) Link to comment
Anderl Posted March 16, 2013 Share Posted March 16, 2013 You misspelled 'addEventHandler' (( you spelled 'addEventHanderl' ))after all, i think this topic should be locked or deleted as he posted this code without me noticing about it, as this code is mine + description on it is mine (( i know description is bad )) It was a tribute to me (: Ahahah Link to comment
Recommended Posts