if((newkeys & KEY_FIRE) && (GetPlayerState(playerid) == 1) && GetPlayerWeapon(playerid) == 40) { // Do Something... }