AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Compiler problem (https://forums.alliedmods.net/showthread.php?t=133658)

Aluta 07-27-2010 15:46

Compiler problem
 
2 Attachment(s)
Hi guys

I want to delete one of the blocks from the plugin but i get every time a error. Plz Help

Original Plugin

Code:

new const gszBlockNames[gBlockMax][32] =
{
    "Platform",
    "Bunnyhop",
    "Damage",
    "Healer",
    "No Fall Damage",
    "Ice",
    "Trampoline",
    "Speed Boost",
    "Invincibility",
    "Stealth",
    "Death",
    "Nuke",
    "Camouflage",
    "Low Gravity",
    "Fire",
    "Slap",
    "Random",
    "Honey",
    "CT Barrier",
    "T Barrier",
    "Boots Of Speed",
    "Glass",
    "Bunnyhop (No slow down)",
    "Auto Bunnyhop"
};

Error Plugin (without "Invincibility")

I deleted all of the "Invincibility" things out of the plugin
Code:

new const gszBlockNames[gBlockMax][32] =
{
    "Platform",
    "Bunnyhop",
    "Damage",
    "Healer",
    "No Fall Damage",
    "Ice",
    "Trampoline",
    "Speed Boost",
    "Stealth",
    "Death",
    "Nuke",
    "Camouflage",
    "Low Gravity",
    "Fire",
    "Slap",
    "Random",
    "Honey",
    "CT Barrier",
    "T Barrier",
    "Boots Of Speed",
    "Glass",
    "Bunnyhop (No slow down)",
    "Auto Bunnyhop"
};

If i try "new const gszBlockNames[gBlockMax][32] =" i get "error 052: multi-dimensional arrays must be fully initialized"

& if i try "new const gszBlockNames[gBlockMax][31 or 23] =" then i get "error 018 initialization data exceeds declared size"

Whats wrong?
I have no idea more.
Plz Help

Sry, for the bad english.

GXLZPGX 07-27-2010 16:00

Re: Compiler problem
 
http://forums.alliedmods.net/showthread.php?t=107153

DaxProxy 07-28-2010 08:04

Re: Compiler problem
 
Quote:

Originally Posted by Aluta (Post 1253354)
Hi guys

I want to delete one of the blocks from the plugin but i get every time a error. Plz Help

Original Plugin

PHP Code:

new const gszBlockNames[gBlockMax][32] =
{
    
"Platform",
    
"Bunnyhop",
    
"Damage",
    
"Healer",
    
"No Fall Damage",
    
"Ice",
    
"Trampoline",
    
"Speed Boost",
    
"Invincibility",
    
"Stealth",
    
"Death",
    
"Nuke",
    
"Camouflage",
    
"Low Gravity",
    
"Fire",
    
"Slap",
    
"Random",
    
"Honey",
    
"CT Barrier",
    
"T Barrier",
    
"Boots Of Speed",
    
"Glass",
    
"Bunnyhop (No slow down)",
    
"Auto Bunnyhop"
};[/code]Error Plugin (without "Invincibility")

I deleted all of the "Invincibility" things out of the plugin
[code]new const gszBlockNames[gBlockMax][32] =
{
    
"Platform",
    
"Bunnyhop",
    
"Damage",
    
"Healer",
    
"No Fall Damage",
    
"Ice",
    
"Trampoline",
    
"Speed Boost",
    
"Stealth",
    
"Death",
    
"Nuke",
    
"Camouflage",
    
"Low Gravity",
    
"Fire",
    
"Slap",
    
"Random",
    
"Honey",
    
"CT Barrier",
    
"T Barrier",
    
"Boots Of Speed",
    
"Glass",
    
"Bunnyhop (No slow down)",
    
"Auto Bunnyhop"
}; 

If i try "new const gszBlockNames[gBlockMax][32] =" i get "error 052: multi-dimensional arrays must be fully initialized"

& if i try "new const gszBlockNames[gBlockMax][32] =" then i get "error 018 initialization data exceeds declared size"

Whats wrong?
I have no idea more.
Plz Help

Sry, for the bad english.

Now when you start changing plugins, then it's very important that you first learn about PAWN's basics...i've been there, dont that and regretted that i even started changing something.

Anyways, new const gszBlockNames[gBlockMax][32]
As you can see, then gszBlockNames is two dimensional array, and the number 32 represents the ammount of data in the array. If you remove "Invincibility", then there will be only 31 items in array and that means that you get error, because compiler is told that there MUST be 32 items in array.

Mean that you need to change:
gszBlockNames[gBlockMax][32]
to
gszBlockNames[gBlockMax][31]

This thread will get trashed soon, but i hope that you get the point i was trying to explain.

Edit:
sh*t i think i totally failed, but you can try.

Aluta 07-28-2010 10:58

Re: Compiler problem
 
i edited my post,
i tried it with gszBlockNames[gBlockMax][31] and gszBlockNames[gBlockMax][23] ;)
Need Help

YamiKaitou 07-28-2010 11:50

Re: Compiler problem
 
Check the value of gBlockMax. DaxProxy is on the right track with his statement

Aluta 07-28-2010 17:37

Re: Compiler problem
 
What?
I did it or not?!

Jelle 07-28-2010 21:03

Re: Compiler problem
 
Quote:

Originally Posted by GXLZPGX (Post 1253372)


Aluta 07-29-2010 05:52

Re: Compiler problem
 
Plz help me or shut your mouth -.-

drekes 07-29-2010 08:09

Re: Compiler problem
 
Line 249:
PHP Code:

const gBlockMax 24

:arrow:
PHP Code:

const gBlockMax 23

Btw: don't be so rude to people next time.

YamiKaitou 07-29-2010 09:44

Re: Compiler problem
 
Quote:

Originally Posted by Aluta (Post 1254968)
Plz help me or shut your mouth -.-

This is Scripting Help, not Do It For Me. We are not here to give you the actual fix, only lead you in the right direction so you can fix it yourself


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

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