View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-09-2010 , 04:46   Re: [TUT] Enumerations (enum)
Reply With Quote #6

That's not complete and there are few things to say :

- You don't talk about weak (lower case letter) and strong tag (upper case letter). The weak tag can be dropped implicitly in some situations. Check the pawn language guide to get more informations.
- Stop to cast the tags in your examples. At least the 3 first, there is no reason to cast.
- I would like to see an example with tagName + IncrementType.
- Don't say random things like "If the above code gives a tag mismatch warning[...]" ; When you set a value, which is important is the tag of the var (g_ePlayerData). When you get a value which is important is the tag of the item (Player_Speed). g_ePlayerData is untag, so if you try to set a value with a strong tag, you will get an error. If the tag was weak or if the the var (g_ePlayerData) was tagged with the same tag as the value you want to set, you won't get errors. In the next example when you get the value, since Player_Speed is a fload and since 250.0 too, the tag is the same, no error and no need to specify Float:.
- I don't see the point to show "Method #1:". Explaining the size it's ok, but showing an example is really a bad idea. It's confusing and you should avoid to show weird ways.
- ePlayerData[ Player_Speed ] = 250.0 ; should be casted.
- There is no example with custom tags.
- There is no example with structure inside a structure.
- In your last example, the problem can be simply solved by using a weak tag. The tag will be dropped automatically.

Here an old thread you may find some ideas
__________________
Arkshine is offline