PHP Code:
if (strequals(#p(1),a)&&this.inuse==1) {
setani("idle", "");
replaceani("idle", "idle");
replaceani("walk", "walk");
this.inuse=0;
}
This could possibly be causing it.
Change the ' if (strequals(#p(1),a)&&this.inuse==1) { ' to 'if (params[1] == "a" && this.inuse == 1) {'
A+D will change weapons. It's possible that it's returning strequals(#p(1),a) as always being true?