Raised This Month: $ Target: $400
 0% 

Pawn Picture Tutorial


Post New Thread Reply   
 
Thread Tools Display Modes
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 06-14-2009 , 12:24   Re: Pawn Picture Tutorial
Reply With Quote #21

Quote:
Originally Posted by Emp` View Post
Brackets [structure] [top]
Types of Brackets:
  • Curly-Brackets: { }
  • Square-Brackets: { }
  • Parenthesis: ( )
Those are some funny looking "Square brackets" ;)
__________________
minimiller is offline
Send a message via MSN to minimiller
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 08-20-2009 , 18:12   Re: Pawn Picture Tutorial
Reply With Quote #22

Quote:
Originally Posted by Hawk552 View Post
This is incorrect. Pawn bools can store other values as can Floats. The tags are just that, tags. I don't believe in the idea of misleading beginners to make things more simple to understand. I think you should explain this properly.
Personally I think it is okay to simplify it for beginners. It is not that important, but important enough to get a basic understanding of it. If I can think of a way to describe it, I will add it in eventually.

Quote:
Originally Posted by Hawk552 View Post
This is bad practice and you should avoid it not only in Pawn but also in other languages. It is always better to use the proper escape character. In this case, it is '^0', which the ASCII code for is 0. This will also give you an excuse to talk about escape characters, which you did not cover.
I changed it, but I have not created a section on escape characters yet.

Quote:
Originally Posted by Hawk552 View Post
Pawn functions always return something. Even if no return is explicitly stated in a function, it will return 0.
It was mentioned else where, I added it there also though.

Quote:
Originally Posted by Hawk552 View Post
There's no real problem here. I would just suggest that you say that some forwards will ignore their return value (i.e. plugin_init()).
Added.

Quote:
Originally Posted by Hawk552 View Post
Functions which have multiforwards hooked to them get called whether or not they are declared as forwards. The only real purpose of forwards is for documentation. There may be something else I don't know about, though.
Either way, I think it is better for people to know which forwards are being called and not to just expect them.

Quote:
Originally Posted by Hawk552 View Post
Terrible variable naming. Please do not encourage people to write code like this.
Didn't mean to. Fixed.

Quote:
Originally Posted by Hawk552 View Post
I'm very uncertain about both this and my following comment. I'm pretty sure that mp3s have to be precached using precache_generic(). I'm also pretty sure that only wav files can be precached using precache_sound(). I could be wrong, though. Don't hold me to that. I just suggest you look into it.
Haven't had time still; if someone else finds out, let me know and I'll add/change what it says.

Quote:
Originally Posted by Hawk552 View Post
You should clarify that a default case is not required.
Added.

Quote:
Originally Posted by Hawk552 View Post
This is completely wrong. The compiler ignores lines while parsing this. For example, this would compile fine and in the way you would intend it to:
Fixed.


Quote:
Originally Posted by Hawk552 View Post
This is a terrible style as well and you should not be encouraging people to use it. If you have to, for some God-forsaken reason, leave your curly braces on the same line as the opening statement, at least add a space between them.
I actually agreed with you on this one. I prefer the curly brackets on the line after, but I seemed to be using that style more in my scripts. Anyway, it carried over into the tutorial. Fixed.

Quote:
Originally Posted by Hawk552 View Post
You should clarify the difference between pre/post incrementing/decrementing.
IIRC, I saw a problem with pre incrementing/decrementing somewhere, so I would rather not have people doing it since I am not even sure about it.

Quote:
Originally Posted by minimiller
Those are some funny looking "Square brackets" ;)
Fixed.
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`
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-21-2009 , 02:29   Re: Pawn Picture Tutorial
Reply With Quote #23

Quote:
Originally Posted by Emp` View Post
Personally I think it is okay to simplify it for beginners. It is not that important, but important enough to get a basic understanding of it. If I can think of a way to describe it, I will add it in eventually.
I disagree. Misleading people now to make your case easier to demonstrate just leads to more trouble later when they have to not only unlearn the wrong information that you've given them but also learn new information.

There are many cases I've needed to know this, too. For example, a beginner may not know that you can just detag a bool to pass into a set_task() function as the ID. They would either have to accept the tag mismatch and not understand why it actually works, or they would have to write some sort of conversion function.

This is just a simple example. There are many other cases where giving people wrong information in general is bad.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-21-2009 , 03:38   Re: Pawn Picture Tutorial
Reply With Quote #24

Quote:
Haven't had time still; if someone else finds out, let me know and I'll add/change what it says.
Using mp3 with precache_sound() works but you will get an "Missing RIFF/WAVE chunk" message in the console. precache_sound() would be only for wav.
__________________
Arkshine is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 08-21-2009 , 07:54   Re: Pawn Picture Tutorial
Reply With Quote #25

Remove that picture of Michael Jackson

1. He's dead
2. It never has been proved that its true
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 08-22-2009 , 14:05   Re: Pawn Picture Tutorial
Reply With Quote #26

Quote:
Originally Posted by Hawk552 View Post
I disagree. Misleading people now to make your case easier to demonstrate just leads to more trouble later when they have to not only unlearn the wrong information that you've given them but also learn new information.

There are many cases I've needed to know this, too. For example, a beginner may not know that you can just detag a bool to pass into a set_task() function as the ID. They would either have to accept the tag mismatch and not understand why it actually works, or they would have to write some sort of conversion function.

This is just a simple example. There are many other cases where giving people wrong information in general is bad.
Okay, I will try to think of a way to place it into the tutorial.

Quote:
Originally Posted by Arkshine View Post
Using mp3 with precache_sound() works but you will get an "Missing RIFF/WAVE chunk" message in the console. precache_sound() would be only for wav.
Alright, I'll just tell people to use wav only to avoid confusion.

Quote:
Originally Posted by crazyeffect View Post
Remove that picture of Michael Jackson

1. He's dead
2. It never has been proved that its true
1. I've added this information into this example to help understand comments better.
2. It is only a warning.
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`
TwinRraZzorR
Member
Join Date: Apr 2009
Old 10-28-2009 , 00:58   Re: Pawn Picture Tutorial
Reply With Quote #27

Very instructive tutorial ,
just a little remark about one picture which represente a died personne , let peace be on him, thanks for your understanding
__________________

TwinRraZzorR is offline
ScHrAnZ DiNgEnS
Senior Member
Join Date: Sep 2007
Old 10-28-2009 , 06:03   Re: Pawn Picture Tutorial
Reply With Quote #28

Im confused now, where i can buy so many boxes?
__________________
ScHrAnZ DiNgEnS is offline
Send a message via ICQ to ScHrAnZ DiNgEnS Send a message via AIM to ScHrAnZ DiNgEnS
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 10-28-2009 , 16:19   Re: Pawn Picture Tutorial
Reply With Quote #29

Quote:
Originally Posted by Arkshine View Post
Using mp3 with precache_sound() works but you will get an "Missing RIFF/WAVE chunk" message in the console. precache_sound() would be only for wav.
I guess using precache_generic should work fine for mp3 files.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-28-2009 , 17:36   Re: Pawn Picture Tutorial
Reply With Quote #30

Yes, it works fine.
__________________
Arkshine 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 16:57.


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