That's overly complicated. All you have to do is find all entities which have the substring "weapon_" in their classname and delete them:
No need for great long lists of specific weapons.PHP Code:
init()
{
if(getCvar("scr_remove_weapons") == "")
setCvar("scr_remove_weapons","1");
level.rmWeapons = getCvarInt("scr_remove_weapons");
if( !level.rmWeapons )
return;
ents = getentarray();
for( i=0; i < ents.size; i++ )
{
if( isSubStr( ents[i].classname, "weapon_" ) )
ents[i] delete();
}
}