AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   1.8.1 Huge Problems (https://forums.alliedmods.net/showthread.php?t=76076)

Drak 08-17-2008 19:41

1.8.1 Huge Problems
 
When compiling over half of my plugins with the new AMXX (1.8.1) they all fail to compile, if they use a variable name of "Array".

Code:
new Array[2] Array[0] = id Array[1] = Target

Will give off "Tag Mismatches" and all kinds of crazy errors.

Arkshine 08-17-2008 19:42

Re: 1.8.1 Huge Problems
 
Show your full code.

EDIT: Don't forget that Array: is a reserved tag for dynamic array, that's why probably you get theses errors.

Drak 08-17-2008 19:51

Re: 1.8.1 Huge Problems
 
Oops, I didn't mean to post the thread in "Suggestions/Requests". And I didn't realize "Array" is a reserved tag. That's new in *.1 i'm assuming?

Arkshine 08-17-2008 19:53

Re: 1.8.1 Huge Problems
 
Since 1.8.0 - Dynamic array. ( see cellarray.inc )

Drak 08-17-2008 19:56

Re: 1.8.1 Huge Problems
 
Huh. I must of been compiling on 1.7X.
EDIT: Alright well, I don't know if it would make a difference, but I want to compile on 1.8.1.
So I commented out cellarray includes. So it doesn't compile with it.

Brad 08-17-2008 20:15

Re: 1.8.1 Huge Problems
 
Just saying but... "Array" is a *terrible* variable name. A variable name should describe what the contents are that it holds.

Exolent[jNr] 08-17-2008 20:18

Re: 1.8.1 Huge Problems
 
Moved to Scripting Help.

XxAvalanchexX 08-17-2008 21:35

Re: 1.8.1 Huge Problems
 
There are a few terms that you can't use for variable names; they'll give you ridiculous errors that are hard to decipher. Just rename the variable.

Drak 08-17-2008 21:48

Re: 1.8.1 Huge Problems
 
Quote:

Originally Posted by Brad (Post 671349)
Just saying but... "Array" is a *terrible* variable name. A variable name should describe what the contents are that it holds.

Well, it is describing the contents, kinda.

Code:
awTest() {     new Array = array_create();     array_set_int(g_MainArray,++g_Items,Array);     array_set_string(Array,1,"Hello World"); } RegisterItems() {     new Array[2]     Array[0] = ItemID     Array[1] = id         _RegisterItem("Test Item","N/A",Array); }
Things liek diiisss

danielkza 08-17-2008 22:36

Re: 1.8.1 Huge Problems
 
Quote:

Originally Posted by Drak (Post 671366)
Well, it is describing the contents, kinda.

Code:
awTest() {     new Array = array_create();     array_set_int(g_MainArray,++g_Items,Array);     array_set_string(Array,1,"Hello World"); } RegisterItems() {     new Array[2]     Array[0] = ItemID     Array[1] = id          _RegisterItem("Test Item","N/A",Array); }

Things liek diiisss

An variable name just describe it's use or purpose,not it's type. A variable named int tells it's a number,but a variable name iPlayerCount tells you what it's used for. Therefore,just avoid the already define names, and use descritive ones.


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

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.