you have to fill an array with the weapon strings, too. Now you can string compare these with the weapon you will get from GetEventString().
Code:
decl String:gWeaponStr[MAX_WEAPON][32];
strcopy(gWeaponSt[mg42], 32, "mg42");
if (!strcmp(weapon, gWeaponSt[mg42], 32)
{
PrintToServer("%f",gWeaponKnockBack[mg42]);
}