Raised This Month: $ Target: $400
 0% 

array must be indexed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
h4r4ld
New Member
Join Date: May 2009
Old 05-24-2009 , 18:03   array must be indexed
Reply With Quote #1

Hi guys,

I'm quiet new to AMX Scripting, so I tried to start with mixing up some scripts I found here to get a bit into business.

So, heres the code:
Code:
deletei(text[], const what[])
{
       new pos
       new len
       new i
       pos = containi(text, what)
       while (pos>=0) 
    {
           len = strlen(what)
           i = 0
           while (text[pos+len+i]!=0) 
        {
                text[pos+i] = text[pos+len+i]
                   i++
           }
           text[pos+i] = 0
           pos = containi(text, what)
       }
}

cant_use_tag(id)
{
    if(get_cvar_num("amx_tagprotect") == 0)
    return PLUGIN_CONTINUE
    if(get_cvar_num("amx_taginfront") == 1)
    {
        new name[32]
        get_user_name(id, name, 31)
        new authid[32]
        get_user_authid(id,authid,31)
#if defined CLANTAGD
log_message("[StammiTAG] Authenticating tag: ^"%s^" steamID: ^"%s^"",clantag,authid)
#endif
        if ( (equal(authid,"STEAM_ID_PENDING")) || (equal(authid,"")) ) 
        {
            set_task(0.5,"admin_entered",id)
            return false
        } 
        for (new i=0; i<num_clantags; ++i)
        {
            if ( containi(name, clantaglist[i]) && (equal(authid, authids[i])))
                return false
        }
#if defined CLANTAGD
log_message("[StammiTAG] Authorized tag: ^"%s^" steamID: ^"%s^"",name,authid)
#endif
        for (new m=0; m<num_clantags; ++m)
        {
            if( (containi(name, clantaglist[m])<0) && (equal(authid, authids[m])))
            {
                copy(name,23,name)
                client_cmd(id,"name ^"%s%s^"",clantaglist[m],name)
            }
            return false
        }
#if defined CLANTAGD
log_message("[StammiTAG] Authorized tag: ^"%s^" steamID: ^"%s^"",name,authid)
#endif  
        for (new f=0; f<num_clantags; ++f)
        {
            if( ( containi(name, clantaglist[f]>=0)) && (!equal(authid, authids[f])))
            {
                deletei(name, clantaglist[f])
                trim(name)
                if(strlen(name) == 0)
                { 
                    copy(name, 7, "Player")
                }
                client_cmd(id, "name ^"%s^"", name)
            }
#if defined CLANTAGD
log_message("[StammiTAG] Unauthorized tag - Tag deleted: ^"%s^" steamID: ^"%s^"",name,authid)
#endif          
            
            return PLUGIN_CONTINUE
         }
     return true
     }
}
And the compiler tells there is a problem in line 132
phpaTghvm.sma(132) : error 033: array must be indexed (variable "clantaglist")
Code:
for (new f=0; f<num_clantags; ++f)
        {
            if( ( containi(name, clantaglist[f]>=0)) && (!equal(authid, authids[f])))
            {
                deletei(name, clantaglist[f])
                trim(name)
                if(strlen(name) == 0)
                { 
                    copy(name, 7, "Player")
                }
                client_cmd(id, "name ^"%s^"", name)
            }
*edit: Its the if

I hope someone will help and have a little explaintation would be nice. ;)
Thanks a lot
h4r4ld is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-24-2009 , 18:17   Re: array must be indexed
Reply With Quote #2

Show the full code.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
h4r4ld
New Member
Join Date: May 2009
Old 05-24-2009 , 18:19   Re: array must be indexed
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
Show the full code.

Not nessesary, I fixed myself, but thanks anyway.

Close pls
h4r4ld 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 01:30.


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