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?