Raised This Month: $51 Target: $400
 12% 

Solved help with error 161


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 12-11-2018 , 16:05   help with error 161
Reply With Quote #1

Hi, I rewriting one plugin to new syntax but i have one problem with this

PHP Code:
decl Handle:hCvarADTs[_:CvarOrder][g_iADTSize
i rewrited to

PHP Code:
Handle hCvarADTs[view_as<int>(CvarOrder)][g_iADTSize]; 
for info:
PHP Code:
enum CvarOrder
{
    
Order_First 0,
    
Order_Last

but i getting this error

error 161: brackets after variable name indicate a fixed-size array, but a dynamic size was given - did you mean to use 'new Handle[size]' syntax?
__________________

Last edited by _GamerX; 12-11-2018 at 18:19.
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-11-2018 , 16:26   Re: help with error 161
Reply With Quote #2

If I understand correctly what you want.

PHP Code:
Handle hCvarADTs[view_as<int>(Order_MAX)][g_iADTSize]; 
PHP Code:
enum CvarOrder
{
    
Order_First 0,
    
Order_Last,
    
Order_MAX,


Last edited by impossible_cc; 12-11-2018 at 16:45.
impossible_cc is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 12-11-2018 , 17:21   Re: help with error 161
Reply With Quote #3

Quote:
Originally Posted by impossible_cc View Post
If I understand correctly what you want.

PHP Code:
Handle hCvarADTs[view_as<int>(Order_MAX)][g_iADTSize]; 
PHP Code:
enum CvarOrder
{
    
Order_First 0,
    
Order_Last,
    
Order_MAX,

this i try but i get same error
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-11-2018 , 17:30   Re: help with error 161
Reply With Quote #4

g_iADTSize isnt constant, right?

You have to declare it as constant then do this
PHP Code:
Handle hCvarADTs[view_as<int>(Order_MAX)][g_iADTSize]; 
Or if g_iADTSize cannot be constant then declare it as dynamic-length array:
PHP Code:
Handle[view_as<int>(Order_MAX)][g_iADTSizehCvarADTs

Last edited by impossible_cc; 12-11-2018 at 17:40.
impossible_cc is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 12-11-2018 , 17:36   Re: help with error 161
Reply With Quote #5

So many errors now
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-11-2018 , 17:41   Re: help with error 161
Reply With Quote #6

Did you try to declare int as constant or Handle array as dynamic?
impossible_cc is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-11-2018 , 18:16   Re: help with error 161
Reply With Quote #7

Also, this should work if it is a local scope
Handle[][] hCvarADTs = new Handle[view_as<int>(Order_MAX)][g_iADTSize];
impossible_cc is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 12-11-2018 , 18:19   Re: help with error 161
Reply With Quote #8

oh god work! THX mate
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Reply



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 04:43.


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