Raised This Month: $ Target: $400
 0% 

Error: Array must be indexed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
skis
Junior Member
Join Date: Jul 2008
Old 07-23-2008 , 19:34   Error: Array must be indexed
Reply With Quote #1

Can someone please look at this code and see if you can see anything wrong? I get this error:

Error: Array must be indexed (variable "-unknown-") on line 31

Code:
22 public bombpickup() {
23     new players[32];
24     new num, i;
25     get_players(players, num, "e", "TERRORIST");
26     for(i = 0;i < num; i++) {
27         new weapons[32];
28         new numweapons, j;
29         get_user_weapons(i, weapons, numweapons);
30         for (j = 0; j < numweapons; j++) {
31             if (weapons[j] == "weapon_c4") {
32                 //do something if he has the bomb
33             }
34         }
35     }
36 }
Does the variable "j" not work as an index in a for loop or something?
skis is offline
 



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 05:40.


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