Raised This Month: $ Target: $400
 0% 

Index array


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
addicted2sex
Senior Member
Join Date: May 2009
Location: localhost
Old 09-02-2009 , 04:13   Index array
Reply With Quote #1

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" ?!
addicted2sex is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-02-2009 , 04:27   Re: Index array
Reply With Quote #2

t1[1] -> t1[2]

str_to_num(t1) returns the num, you have to create a var to store the value.
__________________
Arkshine is offline
addicted2sex
Senior Member
Join Date: May 2009
Location: localhost
Old 09-02-2009 , 04:28   Re: Index array
Reply With Quote #3

so can u give me an example of the code above ..
addicted2sex is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-02-2009 , 04:34   Re: Index array
Reply With Quote #4

new myvar = str_to_num(t1);
__________________
Arkshine 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 15:08.


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