player(n,"weapontype") behaves quite differently nowadays. The initial base condition used to terminate the loops is to check whether the player still holds a weapon. Since 0.1.1.6, CS2D automatically reequips a player with a knife if he is stripped of everything. Here's a new implementation:
for _,wpn in ipairs(playerweapons(id)) do
parse(string.format("strip %s %s", id, wpn))
end
Hopefully, the ipairs returns a copy of the weapon table instead of a reference to the actual table.
Edit: On a side note, I never pushed out a patch of this bug for AMX2D since people used to believe that using @equip will automagically crash the server :D, but then Red realized that he can just @parse everything T_T