Ambrosia Community

General Category => Support Section => Tutorials => Topic started by: TeeKaaY on December 11, 2013, 05:53:36 pm

Title: AMX MOD X guide for whoever wants to start scripting
Post by: TeeKaaY on December 11, 2013, 05:53:36 pm
Basically I posted this in another community a while back, and I thought of sharing it here for all the noobies who keep asking me that question.

Hello,

I am glad you asked about this . I just have one small correction, it's not AMX, it's actually AMXX, there is a big difference between them.

First before even thinking of starting scripting plugins, i advise you to learn the pawn syntax. What I mean by that is that you understand all the functionality of the pawn scripting language, learning its basics such as variables, loops... etc. If you wish to learn that, please visit this link: http://wiki.alliedmods.net/Introduction_to_Pawn (http://wiki.alliedmods.net/Introduction_to_Pawn) and http://wiki.alliedmods.net/Pawn_Tutorial (http://wiki.alliedmods.net/Pawn_Tutorial)

After that you might wanna learn how to compile a plugin (this is a stupid suggestion since most people know how, but anyway), because if you code a plugin but you don't know how to compile it, then its not going to work, please visit this link: https://wiki.alliedmods.net/Compiling_Plugins_%28AMX_Mod_X%29 (https://wiki.alliedmods.net/Compiling_Plugins_%28AMX_Mod_X%29)

Now you might wanna learn a very brief introduction to AMX MOD X scripting, please visit: http://wiki.alliedmods.net/Intro_to_AMX_Mod_X_Scripting (http://wiki.alliedmods.net/Intro_to_AMX_Mod_X_Scripting)

Cvars are a very importing thing in AMX MOD X plugins. It allows to turn off/on the plugin or any separate functions inside it. You wanna learn that too, check how here: http://wiki.alliedmods.net/Scripting_Cvars_(AMX_Mod_X) (http://wiki.alliedmods.net/Scripting_Cvars_(AMX_Mod_X))

Optimizing your code is crucial. Witch one would you pick if you had two plugins that does the same job but one does it better and/or does more efficiently? I am pretty sure I don't have to answer that. So head on here: https://wiki.alliedmods.net/Optimizing_Plugins_%28AMX_Mod_X_Scripting%29 (https://wiki.alliedmods.net/Optimizing_Plugins_%28AMX_Mod_X_Scripting%29)

There are lots of other great wikis in the AMX MOD X scripting wiki page: https://wiki.alliedmods.net/Category:Scripting_%28AMX_Mod_X%29 (https://wiki.alliedmods.net/Category:Scripting_%28AMX_Mod_X%29)

I also would like to give you this: http://www.amxmodx.org/funcwiki.php?go=all_func (http://www.amxmodx.org/funcwiki.php?go=all_func) (not working anymore, just check the .inc files, it has all the functions you need)
This is a list of all the present functions in AMX MOD X that you can use. These functions allow you to do special things, for example: cs_set_user_deaths() allows you to set a user a specified deaths amount, and so on.

This topic has almost all the tutorials for several things that you might want to do: http://forums.alliedmods.net/showthread.php?t=172936 (http://forums.alliedmods.net/showthread.php?t=172936)

Just a small note before I end here: don't expect to start making some huge plugins like GunGame or JailBreak in a matter of weeks, but at least you will get there eventually, I hope .
One more thing, when starting as a new coder, I advise to look at other plugins that do a similar job to what you are trying to accomplish, it will make your life easier, and it would be better if you edit other plugins to do what you want them to do instead of starting from scratch, just don't forget to give credits where you have to .

Hope this helped
Requesting this to be stickied? I don't mind actually but I figured that this would help those who wish to go on the same path.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Suhaib on December 11, 2013, 05:55:07 pm
thanks dude!
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: TeeKaaY on December 11, 2013, 05:57:34 pm
That was fast O.o
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 11, 2013, 07:01:25 pm
Tbh I don't see people learning pawn if they don't have previous experience of coding languages. It's nothing too hard, but not the most basic language either.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: TeeKaaY on December 11, 2013, 07:05:20 pm
If you think about it its a simplified version of a very basic C language.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: tajski on December 11, 2013, 08:55:43 pm
I'm studing Java and JavaScript. I'll get there soon :D

//ON I haven't read it all but that's good that you've decided to share your experience as well as knowledge :)
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 11, 2013, 09:36:25 pm
If you think about it its a simplified version of a very basic C language.

I know but what I tried to point out, that due to lack of tutorials for the specific language, it may be difficult for beginners to get into the groove.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Dr.Richtofen on December 11, 2013, 09:57:28 pm
Does it require Binary Code? (Professor Computerssss right here.)


Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Deathknife on December 11, 2013, 10:07:15 pm
I recommend you not to waste your time learning this, learn some useful language instead like Java.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 11, 2013, 10:09:25 pm
Does it require Binary Code? (Professor Computerssss right here.)

I'm sorry but I doubt you know how coding works, at all.

To answer your question, no it doesn't, well theoretically it does since everything computer processes is in binary code, including user input, however you do not directly write in binary, would take more than numerous human lifetimes to produce programs in binary code. Imagine spacing out all the 0s and 1s. That's why we use computer languages so we don't have to use binary codes. So, to take away the confusion, while basically anything pc related runs through binary code, you can code without any actual binary knowledge with no hassle whatsoever.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 11, 2013, 10:11:46 pm
I recommend you not to waste your time learning this, learn some useful language instead like Java.

Depends if you want to program for money in the future or just have programming as a hobby in free time. Whilst java has many more uses, if you're generally not interested in becoming a professional coder, you might as well learn pawn only.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Fisu on December 11, 2013, 10:22:30 pm
I've got already problems learning french, but anyway thanks for trieng.. :D
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: 'PL' on December 11, 2013, 10:43:36 pm
Good guide.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: TeeKaaY on December 11, 2013, 10:50:04 pm
rawrplus if you have read it, you would notice that there are actually two linked tutorials to pawn.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 12, 2013, 08:35:07 am
rawrplus if you have read it, you would notice that there are actually two linked tutorials to pawn.

Mate I did read it. What I'm trying to tell, for example php has phpacademy, thenewboston, w3schools and occupied support forums while pawn has few tutorials from volunteers that's about it. While it may not be an issue for more experienced coders, but once you finish the tutorials and are supposed to do things on your own, it very well may come in handy to posses the ability to simply search your way out of the issue thanks to the knowledge base. Pawn isn't the worst documented language either, but when I was completely clueless about coding I decided to start with pawn and frankly I had some issues with learning it. Only after I learned other a bit more simplified C based languages I felt confident in learning pawn
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: terraboN on December 12, 2013, 08:59:12 am
rawrplus if you have read it, you would notice that there are actually two linked tutorials to pawn.

Mate I did read it. What I'm trying to tell, for example php has phpacademy, thenewboston, w3schools and occupied support forums while pawn has few tutorials from volunteers that's about it. While it may not be an issue for more experienced coders, but once you finish the tutorials and are supposed to do things on your own, it very well may come in handy to posses the ability to simply search your way out of the issue thanks to the knowledge base. Pawn isn't the worst documented language either, but when I was completely clueless about coding I decided to start with pawn and frankly I had some issues with learning it. Only after I learned other a bit more simplified C based languages I felt confident in learning pawn

So you are telling me that C helps with Pawn?

Also, you know when you recommended the coding route (HTML -> php -> C++ -> Whatever..) Do i have to go through it? I know i don't but will it make the coding easier as i progress from one language to another, if you know what i mean? Also i heard of Python but have no idea what it is used for.. Can someone elaborate on it please?

On topic :

Good guide, quite a few sources to help out beginners, i shall definately be using it in the near future :)
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on December 12, 2013, 09:07:22 am
rawrplus if you have read it, you would notice that there are actually two linked tutorials to pawn.

Mate I did read it. What I'm trying to tell, for example php has phpacademy, thenewboston, w3schools and occupied support forums while pawn has few tutorials from volunteers that's about it. While it may not be an issue for more experienced coders, but once you finish the tutorials and are supposed to do things on your own, it very well may come in handy to posses the ability to simply search your way out of the issue thanks to the knowledge base. Pawn isn't the worst documented language either, but when I was completely clueless about coding I decided to start with pawn and frankly I had some issues with learning it. Only after I learned other a bit more simplified C based languages I felt confident in learning pawn

So you are telling me that C helps with Pawn?

Also, you know when you recommended the coding route (HTML -> php -> C++ -> Whatever..) Do i have to go through it? I know i don't but will it make the coding easier as i progress from one language to another, if you know what i mean? Also i heard of Python but have no idea what it is used for.. Can someone elaborate on it please?

On topic :

Good guide, quite a few sources to help out beginners, i shall definately be using it in the near future :)

PHP / C is enough to vaugely understand what to do in pawn :)

HTML is just arguably easiest coding language and it's a motivation booster. C++ is a biit more enhanced C, but if you want pawn, just learn basics of C instead.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Dr.Richtofen on December 12, 2013, 04:50:05 pm
Does it require Binary Code? (Professor Computerssss right here.)

I'm sorry but I doubt you know how coding works, at all.

To answer your question, no it doesn't, well theoretically it does since everything computer processes is in binary code, including user input, however you do not directly write in binary, would take more than numerous human lifetimes to produce programs in binary code. Imagine spacing out all the 0s and 1s. That's why we use computer languages so we don't have to use binary codes. So, to take away the confusion, while basically anything pc related runs through binary code, you can code without any actual binary knowledge with no hassle whatsoever.
Bullseye! *cough* , yeah I'm just starting right now.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: TeeKaaY on December 12, 2013, 05:20:32 pm
It was easy for me to quickly adapt to the pawn syntax since I already knew C++. But if you look at it from a person that knows nothing about languages it's quite easy to learn it.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Ðεмση ƒŦ Iℓℓusιση on January 06, 2014, 07:13:56 pm
I'm currently learning it. I'm a bit familiar with codes and I learn quite fast. Once I get a hold of the syntax and see some AMXX plugins examples I'll be able to make simple plugins.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: 'PL' on January 06, 2014, 07:43:54 pm
I'm currently learning it. I'm a bit familiar with codes and I learn quite fast. Once I get a hold of the syntax and see some AMXX plugins examples I'll be able to make simple plugins.
They are easy :D
Try ProLog :D
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Ðεмση ƒŦ Iℓℓusιση on January 06, 2014, 11:36:49 pm
I'm currently learning it. I'm a bit familiar with codes and I learn quite fast. Once I get a hold of the syntax and see some AMXX plugins examples I'll be able to make simple plugins.
They are easy :D
Try ProLog :D

What's ProLog, mind explaining ?
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Rawrplus on January 06, 2014, 11:44:45 pm
I'm currently learning it. I'm a bit familiar with codes and I learn quite fast. Once I get a hold of the syntax and see some AMXX plugins examples I'll be able to make simple plugins.
They are easy :D
Try ProLog :D

What's ProLog, mind explaining ?

Uhm, the easiest way to put it (IIRC) is it's the language for the artificial intelligence (not the AI we know from games directly), but the AI in general. Least that's what I remember from programming course, somebody correct me if I'm wrong please :>
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: 'PL' on January 07, 2014, 02:47:33 am
You are right Rawr, it's configuring Ai In logical situations. The problem is that you have to think of every plausible problem that the Ai will have to overcome and discover how to get around it/solve it. It's like coding a brain for a person :D
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: thEnd on January 07, 2014, 08:54:49 am
This looks like 3 IT nerds having a convo and other 8 guys trying to understand at least 20% about what speech is going on. No offence I understand only 10%. :D
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Ðεмση ƒŦ Iℓℓusιση on January 07, 2014, 10:55:32 am
I'd like to post this link too : http://forums.alliedmods.net/showthread.php?t=172936 (http://forums.alliedmods.net/showthread.php?t=172936)

It's a Compilation of almost all the threads of AMXX Scripting section in AlliedMods.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: TeeKaaY on January 07, 2014, 01:07:33 pm
This shows that you have not read the topic. This link has already been included above.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Ðεмση ƒŦ Iℓℓusιση on January 07, 2014, 01:38:41 pm
This shows that you have not read the topic. This link has already been included above.

My bad, I thought you missed it, I already checked the links, the first time I readed it, in post but didn't see it.
Title: Re: AMX MOD X guide for whoever wants to start scripting (ehh..)
Post by: Santa on January 27, 2014, 12:27:46 pm
Thank You Tony For sharing this, i've always wanted to know more and more about scripting, i will be studying this guide and it may be the first step for me to start scripting and have some knowledge about his Subject, i hope you share more and more in future, cause I'm really interested !

Edit/Update:
Hey i found site called codecademy Click Here (http://codecademy.com)

In that site you can learn the basics whether you was a noob or a pro :P ...

That site begin with you from small moves/steps into bigger, which can assure you to learn every basic step and understand it very carefully in the very and each language You Chose  ;)

GoodLuck

Hint : Start With Python easiest ;)