Raised This Month: $ Target: $400
 0% 

Programming for starters


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2009 , 10:25   Re: Programming for starters
Reply With Quote #11

I agree, how about variable naming etiquette too? May as well get people started off correctly . You could probably devote a subsection to this.

Also, when you go from variable to array, you should mention it is an array instead of just a group of numbers. It may help newer scripters who have seen the word array used in threads/tuts/books etc.
__________________

Last edited by Bugsy; 04-28-2009 at 10:31.
Bugsy is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-28-2009 , 10:32   Re: Programming for starters
Reply With Quote #12

Quote:
Originally Posted by minimiller View Post
It might be a good idea to mention that almost everything is case sensitive. So the declared variable and the called variable must be exactly the same.

Other than that, nice work

Quote:
Originally Posted by Bugsy View Post
I agree, how about variable naming etiquette too? May as well get people started off correctly . You could probably devote a subsection to this.

Also, when you go from variable to array, you should mention it is an array instead of just a group of numbers. It may help newer scripters who have seen the word array used in threads etc.
Thanks for the ideas, guys.

Quote:
you should mention it is an array
Ok. I will do it now.
__________________
joaquimandrade is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-28-2009 , 11:13   Re: Programming for starters
Reply With Quote #13

Good job, this tutorial is very well done.

I suggest also adding this exact text:

When creating new variables, if you are creating more than one you can always use commas instead of new lines.
PHP Code:
new colorcolor2color3 
Notice: I am not adding a comma on the last variable of the line. This is because it is the ending variable and no other variable after that is declared. Commas are only needed when creating new variables.

Last edited by BOYSplayCS; 04-28-2009 at 11:19.
BOYSplayCS is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-28-2009 , 11:19   Re: Programming for starters
Reply With Quote #14

Quote:
Originally Posted by BOYSplayCS View Post
Good job, this tutorial is very well done.

I suggest also adding this exact text:

When creating new variables, if you are creating more than one you can always use commas instead of new lines.
PHP Code:
new colorcolor2color3 
This will not work if you START a new line.

Notice: I am not adding a comma on the last variable of the line. This is because it is the ending variable and no other variable after that is declared. Commas are only needed when creating new variables.
Ok but, in another part.
__________________
joaquimandrade is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-28-2009 , 11:20   Re: Programming for starters
Reply With Quote #15

Okay, thank you ;)
BOYSplayCS is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 04-28-2009 , 13:03   Re: Programming for starters
Reply With Quote #16

Typo:

if(anyColor[1] < 255)
if(anyColor[2] < 255)

Change < to >

I think this is worthwhile for newbies to AMXX. You might find other tutorials online with the same intended audience, but you won't find one with a focus on Pawn and AMXX.

Now I'm thinking about writing a tutorial on a different subject
__________________
stupok is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-28-2009 , 13:08   Re: Programming for starters
Reply With Quote #17

Quote:
Originally Posted by stupok View Post
Typo:

if(anyColor[1] < 255)
if(anyColor[2] < 255)

Change < to >

I think this is worthwhile for newbies to AMXX. You might find other tutorials online with the same intended audience, but you won't find one with a focus on Pawn and AMXX.

Now I'm thinking about writing a tutorial on a different subject
Thanks, fixed.

I think that the big difference in mine is the approach that i had. I still don't know if it works right but it's certainly not normal.

Please do a tutorial. I would love to read a text of yours.
__________________

Last edited by joaquimandrade; 04-28-2009 at 13:13.
joaquimandrade is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-28-2009 , 14:13   Re: Programming for starters
Reply With Quote #18

I was planning on making a picture tutorial. I was using MS Paint, but now I have PhotoShop again so it will come faster. I'll get it out when I can.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2009 , 17:54   Re: Programming for starters
Reply With Quote #19

Quote:
Originally Posted by joaquimandrade View Post
Thanks, fixed.

I think that the big difference in mine is the approach that i had. I still don't know if it works right but it's certainly not normal.

Please do a tutorial. I would love to read a text of yours.
You could also do:

anyColor[x] = clamp( anyColor[x] , 0 , 255 )

Clamp is a fairly simple and useful function that I dont think will confuse new scriptors.
__________________
Bugsy is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-28-2009 , 18:02   Re: Programming for starters
Reply With Quote #20

Quote:
Originally Posted by Bugsy View Post
You could also do:

anyColor[x] = clamp( anyColor[x] , 0 , 255 )

Clamp is a fairly simple and useful function that I dont think will confuse new scriptors.
Its not suitable for what is written now because it is a function provided by amxmodx.
__________________
joaquimandrade is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:00.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode