Raised This Month: $ Target: $400
 0% 

Must be assigned to an array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EclipseCP
BANNED
Join Date: Dec 2010
Old 11-12-2011 , 05:37   Must be assigned to an array
Reply With Quote #1

hi all

I get the error Must be Assigned to an array in the following line:

PHP Code:
for (06i++) g_character_slot[id][i] = temp 
the entire code:

PHP Code:
new g_character_slot[33][5]

// ---------------------
    
new id data[0]
    
    
loading(id)
    
    if (
SQL_NumResults(query))
    {
        new 
temp[32], i
        
        SQL_ReadResult
(queryi++, tempcharsmax(temp))
        
        for (
06i++) g_character_slot[id][i] = temp
        
        g_type
[id] = LOAD
        
        MENU_account
(id)     
    } 
EclipseCP is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 11-12-2011 , 06:32   Re: Must be assigned to an array
Reply With Quote #2

i < 6 to i < 5
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-12-2011 , 07:37   Re: Must be assigned to an array
Reply With Quote #3

temp is a string (multiple cells) and you are trying to fit it into a single cell. You must add a third dimension so each player has 5 strings instead of 5 regular cells, I used 10 as the max size but this can be changed depending on what you need. Explain better what you're storing in this array if the below doesn't solve your problem. This is just going to copy the same string 5 times, I'm not sure what you're trying to do, explain and it can get done correctly.

PHP Code:
new g_character_slot[33][5][10]

for (
0sizeofg_character_slot[] ) ; i++) 
   
copyg_character_slot[id][i] , charsmaxg_character_slot[][] ) , temp ); 
__________________

Last edited by Bugsy; 11-12-2011 at 08:23.
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 14:24.


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