AlliedModders

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

Styles 06-03-2007 20:58

Array Help..
 
Error is with line
PHP Code:

g_AdList[g_adAmount] = parsedad 

ERROR: Error: Must be assigned to an array on line 31
PHP Code:

#define maxstuff 256

new g_AdList[maxstuff]

public 
load()
{
    new 
readdata[128],steamid[32],txtlenparsedad[256]
    
    new 
g_adAmount 0
    
while(!read_file(filename,g_adAmount++,readdata,127,txtlen))
    {
        
parse(filename,parsedad,sizeof(parsedad))
        
g_AdList[g_adAmount] = parsedad
    
}


PS: I'm sorry hawlk for what I said on aim :(

Arkshine 06-03-2007 22:18

Re: Array Help..
 
You can't copy a string by this way.

Try to use copy() or format(ex)() .

Maybe like : formatex( g_AdList[g_adAmount], maxstuff - 1, parsedad );

Styles 06-03-2007 22:38

Re: Array Help..
 
o wow thank you very much1

VEN 06-06-2007 12:24

Re: Array Help..
 
Note: this would be valid:
Quote:

new array1[256]
new array2[256]
array2 = array1
because number of arrays' elements is the same.


All times are GMT -4. The time now is 10:37.

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