What version of GM are you using? It looks like you're using an actual resource name, but you shouldn't be able to create a new array with the same name as a resource (it should throw naming conflict errors). Did you change the name of the sprite at some time? Or did you somehow manage to give the sprite name brackets?
I'm Using GMS2 v2.2.3.436. I didn't name the resource with any brackets. Heck, I can't find anywhere in the code I used that name with brackets. I'm also not finding any naming conflict errors. Although I did (in the last five minutes) change the name of the sprite (and all references to it) to "spr_meter" just to see if that would change anything. Nope. Still the same error. I haven't the slightest understanding how I managed to trick GM into thinking that a sprite is an array. I'm honestly kind of impressed with myself! XD
I'm gonna try setting up the code a bit differently and see if I can't figure this out.
The error claims that the value [that you passed into sprite_get_width] is an array. If it's a variable, try running the game with the debugger and seeing what is up.
I tried running the debugger, but honestly, I'm not too familiar with the debugger yet, and I didn't see anything in debug mode that struck me as an obvious issue with the code I've written. The mystery continues...
Oh! I forgot to mention. "spr_smw_barmeter" was indeed the name of a sprite resource, not a variable.
I FIGURED OUT THE PROBLEM.
The problem was on line 2 (where I actually was mistakenly referencing an array as a variable), but GM was telling me that the problem was on line 4. I tried commenting out line 2, and it fixed it. Wooh!
Thanks for the responses, though!
Moderator Edit: Posts merged. Please use the Edit button instead of posting several times in a row.