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

Array must be indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-23-2020 , 19:37   Array must be indexed
Reply With Quote #1

Hi,
I want to test some code, so i does this:
PHP Code:
        new userData[MAX+1][16] {
            
g_iUserPoints[id],
            
g_iUserDust[id],
            
g_iUserKeys[id],
            
g_iUserCase[id],
            
g_iUserKills[id],
            
g_iUserRang[id]
        }; 
and it throws this error:
PHP Code:
Array must be indexed <variable userData
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 04-23-2020 at 19:56.
Shadows Adi is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-23-2020 , 20:02   Re: Array must be indexed
Reply With Quote #2

Try this:
PHP Code:
enum UserData
{
    
UserPoints,
    
UserDust,
    
UserKeys,
    
UserCase,
    
UserKills,
    
UserRang
}

new 
g_udPlayerDataMAX_PLAYERS ][ UserData ];

public 
Testid )
{
    
g_udPlayerDataid ][ UserPoints ] = 34;

__________________

Last edited by Bugsy; 04-23-2020 at 20:02.
Bugsy is offline
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 12:56.


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