AlliedModders

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

addicted2sex 09-02-2009 04:13

Index array
 
Code:

    new t1[1], t2[32]
    read_argv(1,t1,1)
    str_to_num(t1)
   
    if(totalmsgs[t1] >= MAX) {

but the compiler gives me error "array must be indexed" :S I'm newbie in amxx scripting so can u tell me how to index "t1" ?!

Arkshine 09-02-2009 04:27

Re: Index array
 
t1[1] -> t1[2]

str_to_num(t1) returns the num, you have to create a var to store the value.

addicted2sex 09-02-2009 04:28

Re: Index array
 
so can u give me an example of the code above ..

Arkshine 09-02-2009 04:34

Re: Index array
 
new myvar = str_to_num(t1);


All times are GMT -4. The time now is 15:08.

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